Merge pull request #1521 from MihaelaStoica/CA-248471

CA-248471: XenCenter offers passthrough on unlicensed hosts even when…
This commit is contained in:
Gabor Apati-Nagy 2017-04-05 10:50:30 +01:00 committed by GitHub
commit b332082d43
2 changed files with 14 additions and 2 deletions

View File

@ -200,7 +200,10 @@ namespace XenAdmin.SettingsPanels
var vgpuGroup = Connection.Resolve(vgpu.GPU_group);
if (Helpers.FeatureForbidden(Connection, Host.RestrictVgpu) || !vm.CanHaveVGpu)
currentGpuTuple = new GpuTuple(vgpuGroup, null, null);
{
if (vgpuGroup.HasPassthrough)
currentGpuTuple = new GpuTuple(vgpuGroup, null, null); //GPU pass-through item
}
else
{
VGPU_type vgpuType = Connection.Resolve(vgpu.type);
@ -251,6 +254,7 @@ namespace XenAdmin.SettingsPanels
{
if (Helpers.FeatureForbidden(Connection, Host.RestrictVgpu) || !vm.CanHaveVGpu)
{
if (gpu_group.HasPassthrough)
comboBoxGpus.Items.Add(new GpuTuple(gpu_group, null, null)); //GPU pass-through item
}
else

View File

@ -63,6 +63,14 @@ namespace XenAPI
}
}
/// <summary>
/// Has at least one supported_VGPU_type that is passthrough
/// </summary>
public bool HasPassthrough
{
get { return Connection.ResolveAll(supported_VGPU_types).Any(supportedType => supportedType.IsPassthrough); }
}
#region IEquatable<GPU_group> Members