Merge pull request #729 from GaborApatiNagy/master_CP-14470

CP-14470: UI: Show Management Agent not installed when guest agent does not support upgrading
This commit is contained in:
Mihaela Stoica 2015-11-04 11:02:18 +00:00
commit 8042081abc
2 changed files with 15 additions and 1 deletions

View File

@ -1356,7 +1356,9 @@ namespace XenAdmin.TabPages
bool isXenPrepInProgress = false; //TODO in CP-13247 when XenPrep functions will be added
bool canTurnOnAutoUpdates = false && !isReceivingUpdates && !isXenPrepInProgress; //TODO in CP-13247: remove &&false when XenPrep functions have been added
bool isManagementAgentInstalled = vm.HasRDP; //HasRDP is the way to detect .Net/Management Agent
//vmtype is not yet implemented (will likely have different name) in XAPI, but this is the type that refers to the windows update readyness/capability of the VM and is expected to have the following values: yes, no, dontknow, got_it
bool isManagementAgentInstalled = vm.HasUpgradeSupportInManagementAgent //&& vmtype != no"
|| vm.HasRDP; //&& vmtype == no;
bool canInstallIoDriversAndManagementAgent = InstallToolsCommand.CanExecute(vm) && !isIoOptimized;
bool canInstallManagementAgentOnly = InstallToolsCommand.CanExecute(vm) && isIoOptimized && !isManagementAgentInstalled;

View File

@ -456,6 +456,18 @@ namespace XenAPI
}
}
public bool HasUpgradeSupportInManagementAgent
{
get
{
var metrics = Connection.Resolve(this.guest_metrics);
if (metrics == null)
return false;
return 0 != IntKey(metrics.other, "feature-supports-driver-update", 0);
}
}
/// <summary>Returns true if
/// 1) the guest is HVM and
/// 2a) the allow-gpu-passthrough restriction is absent or