mirror of
https://github.com/xcp-ng/xenadmin.git
synced 2024-11-23 20:36:33 +01:00
CP-12966 GPU drop-down to behave correctly when there is one vGPU type and no passthrough
This commit is contained in:
parent
86c755cba5
commit
8646a1ca3a
@ -125,7 +125,7 @@ namespace XenAdmin.Controls
|
||||
VgpuTypes = vgpuType == null ? null : new[] {vgpuType};
|
||||
if (vgpuType != null)
|
||||
{
|
||||
IsVgpuSubitem = gpuGroup.supported_VGPU_types.Count > 1;
|
||||
IsVgpuSubitem = gpuGroup.HasVGpu;
|
||||
IsFractionalVgpu = !vgpuType.IsPassthrough;
|
||||
if (disabledVGpuTypes != null && disabledVGpuTypes.Select(t => t.opaque_ref).Contains(vgpuType.opaque_ref))
|
||||
IsNotEnabledVgpu = true;
|
||||
|
@ -255,7 +255,7 @@ namespace XenAdmin.SettingsPanels
|
||||
|
||||
var disabledTypes = allTypes.FindAll(t => !enabledTypes.Exists(e => e.opaque_ref == t.opaque_ref));
|
||||
|
||||
if (allTypes.Count > 1)
|
||||
if (gpu_group.HasVGpu)
|
||||
{
|
||||
allTypes.Sort((t1, t2) =>
|
||||
{
|
||||
|
@ -30,6 +30,7 @@
|
||||
*/
|
||||
|
||||
using System;
|
||||
using System.Linq;
|
||||
using XenAdmin;
|
||||
|
||||
namespace XenAPI
|
||||
@ -54,6 +55,15 @@ namespace XenAPI
|
||||
: String.Format(Messages.GPU_GROUP_NAME_AND_NO_OF_GPUS, Name, PGPUs.Count);
|
||||
}
|
||||
|
||||
public bool HasVGpu
|
||||
{
|
||||
get
|
||||
{
|
||||
return Connection.ResolveAll(PGPUs).Any(pgpu => pgpu.HasVGpu);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
#region IEquatable<GPU_group> Members
|
||||
|
||||
/// <summary>
|
||||
|
Loading…
Reference in New Issue
Block a user