CLOUDSTACK-6504: removed warnings coming in building hyper-v agent code

(cherry picked from commit 66f8e0e1b5)

Conflicts:
	plugins/hypervisors/hyperv/DotNet/ServerResource/HypervResource/HypervResourceController.cs
	plugins/hypervisors/hyperv/DotNet/ServerResource/HypervResource/WmiCallsV2.cs
This commit is contained in:
Anshul Gangwar 2014-04-24 22:30:12 -07:00 committed by Daan Hoogland
parent 48f9453a74
commit 8fb89cdc8e
4 changed files with 2502 additions and 2075 deletions

View File

@ -302,7 +302,7 @@ namespace HypervResource
path = Utils.NormalizePath(path);
if (Directory.Exists(path))
{
string[] choices = choices = Directory.GetFiles(path, volInfo.uuid + ".vhd*");
string[] choices = Directory.GetFiles(path, volInfo.uuid + ".vhd*");
if (choices.Length != 1)
{
String errMsg = "Tried to guess file extension, but cannot find file corresponding to " +
@ -609,6 +609,7 @@ namespace HypervResource
public struct VolumeInfo
{
#pragma warning disable 0414
public long id;
public string type;
public string storagePoolType;
@ -618,6 +619,7 @@ namespace HypervResource
public string path;
long size;
string chainInfo;
#pragma warning restore 0414
public VolumeInfo(long id, string type, string poolType, String poolUuid, String name, String mountPoint, String path, long size, String chainInfo)
{
@ -635,10 +637,12 @@ namespace HypervResource
public class VmState
{
#pragma warning disable 0414
[JsonProperty("state")]
public String state;
[JsonProperty("host")]
String host;
#pragma warning restore 0414
public VmState() { }
public VmState(String vmState, String host)
{
@ -649,6 +653,7 @@ namespace HypervResource
public struct StoragePoolInfo
{
#pragma warning disable 0414
[JsonProperty("uuid")]
public String uuid;
[JsonProperty("host")]
@ -667,6 +672,7 @@ namespace HypervResource
long availableBytes;
[JsonProperty("details")]
Dictionary<String, String> details;
#pragma warning restore 0414
public StoragePoolInfo(String uuid, String host, String hostPath,
String localPath, string poolType, long capacityBytes,

View File

@ -1,4 +1,4 @@
// Licensed to the Apache Software Foundation (ASF) under one
// Licensed to the Apache Software Foundation (ASF) under one
// or more contributor license agreements. See the NOTICE file
// distributed with this work for additional information
// regarding copyright ownership. The ASF licenses this file
@ -88,7 +88,7 @@ namespace HypervResource
{
IntPtr token = IntPtr.Zero;
bool isSuccess = LogonUser(cifsShareDetails.User, cifsShareDetails.Domain, cifsShareDetails.Password, LOGON32_LOGON_NEW_CREDENTIALS, LOGON32_PROVIDER_DEFAULT, ref token);
LogonUser(cifsShareDetails.User, cifsShareDetails.Domain, cifsShareDetails.Password, LOGON32_LOGON_NEW_CREDENTIALS, LOGON32_PROVIDER_DEFAULT, ref token);
using (WindowsImpersonationContext remoteIdentity = new WindowsIdentity(token).Impersonate())
{
String dest = "";