[CA-121012] Fixed: Offering GPU type with no GPUs available

# HG changeset patch
# User Gabor Apati-Nagy <Gabor.Apati-Nagy@citrix.com>
# Date 1384269857 0
#      Tue Nov 12 15:24:17 2013 +0000
# Node ID 75cc5c584b9670ad16658d459fc069b07c57a433
# Parent  6e77f45144cb01c9eba99be74ad9ffd056eeb110

Signed-off-by: Konstantina Chremmou <konstantina.chremmou@citrix.com>
This commit is contained in:
Konstantina Chremmou 2013-11-14 12:34:55 +00:00
parent d269e6f1f2
commit 0354bd7a85
3 changed files with 5 additions and 4 deletions

View File

@ -207,7 +207,7 @@ namespace XenAdmin.SettingsPanels
}
}
gpu_groups = Connection.Cache.GPU_groups;
gpu_groups = Connection.Cache.GPU_groups.Where(g => g.PGPUs.Count > 0 && g.supported_VGPU_types.Count != 0).ToArray();//not showing empty groups
gpusAvailable = gpu_groups.Length > 0;
if (!gpusAvailable)

View File

@ -66,6 +66,7 @@ namespace XenAdmin.TabPages
var allPgpus = xenObject.Connection.Cache.PGPUs;
pGPUs.AddRange(from pGpu in allPgpus
let host = xenObject.Connection.Resolve(pGpu.host)
where pGpu.supported_VGPU_types.Count > 0
orderby host, pGpu.Name ascending
select pGpu
);
@ -200,12 +201,12 @@ namespace XenAdmin.TabPages
gpuRow.RefreshGpu(pgpu);
}
if (e.PropertyName == "enabled_VGPU_types")
if (e.PropertyName == "enabled_VGPU_types" || e.PropertyName == "supported_VGPU_types")
{
Rebuild();
}
}
private void RegisterPgpuHandlers(PGPU pgpu)
{
pgpu.PropertyChanged -= pgpu_PropertyChanged;

View File

@ -87,7 +87,7 @@ namespace XenAdmin.Wizards.NewVMWizard
pageVgpu = new GpuEditPage();
if (!Helpers.FeatureForbidden(connection, Host.RestrictVgpu))
vgpuCapability = connection.Cache.GPU_groups.Length > 0;
vgpuCapability = connection.Cache.GPU_groups.Any(g => g.PGPUs.Count > 0 && g.supported_VGPU_types.Count > 0);
#region RBAC Warning Page Checks
if (connection.Session.IsLocalSuperuser || Helpers.GetMaster(connection).external_auth_type == Auth.AUTH_TYPE_NONE)