Merge pull request #759 from MihaelaStoica/CA-161457

CA-161457: Hide network if PIF.managed==false
This commit is contained in:
Gabor Apati-Nagy 2015-12-18 11:37:02 +00:00
commit 6db5d1ea37
2 changed files with 17 additions and 4 deletions

View File

@ -151,12 +151,12 @@ namespace XenAPI
if (IsGuestInstallerNetwork)
return false;
if (showHiddenVMs)
return true;
if (!ShowAllPifs(showHiddenVMs))
return false;
if (showHiddenVMs)
return true;
if (IsSlave)
return false;

View File

@ -160,7 +160,7 @@ namespace XenAPI
public override bool Show(bool showHiddenVMs)
{
return showHiddenVMs || !IsHidden;
return IsManaged && (showHiddenVMs || !IsHidden);
}
public override bool IsHidden
@ -171,6 +171,19 @@ namespace XenAPI
}
}
/// <summary>
/// Indicates whether the interface is managed by xapi.
/// Note that this is the same as PIF.managed property for Clearwater SP1 and later hosts.
/// And it is always true for older hosts, where the managed property is not available.
/// </summary>
public bool IsManaged
{
get
{
return Helpers.ClearwaterSp1OrGreater(Connection) ? managed : true;
}
}
// Whether this PIF is a management interface in the XenCenter sense.
// Note that this is not the same as PIF.management, which only includes
// the primary management interface. We also want all interfaces with an