CP-14874: Enable XC SSH support for Netscaler VPX

Implemented special case for VM.IsWindows flag

Signed-off-by: Gabor Apati-Nagy <gabor.apati-nagy@citrix.com>
This commit is contained in:
Gabor Apati-Nagy 2015-12-08 14:12:11 +00:00
parent 45dfd11dd1
commit 6bcae1c984

View File

@ -1892,10 +1892,23 @@ namespace XenAPI
/// <summary> /// <summary>
/// Returns true if this VM is Windows. /// Returns true if this VM is Windows.
/// </summary> /// </summary>
/// <remarks>
/// This really should be just a flag from XAPI, but we do not have such.
///
/// To get an acceptable result, this getter is trying to detect some specific cases before falling back to the viridian flag
/// that may not be correct at all times.</remarks>
public bool IsWindows public bool IsWindows
{ {
get get
{ {
//try to detect special cases when we are sure - having guest_metrics can help
var gm = Connection.Resolve(this.guest_metrics);
if (gm != null)
if (gm.os_version.ContainsKey("distro") && gm.os_version["distro"].ToLowerInvariant().Contains("freebsd")
|| gm.os_version.ContainsKey("uname") && gm.os_version["uname"].ToLowerInvariant().Contains("netscaler"))
return false;
//generic check
return return
this.IsHVM && BoolKey(this.platform, "viridian"); this.IsHVM && BoolKey(this.platform, "viridian");
} }