Merge pull request #1473 from letsboogey/gpu

CP-21120 - XenCenter shows MxGPU as 'passthrough' rather than model
This commit is contained in:
Gabor Apati-Nagy 2017-03-07 18:53:20 +00:00 committed by GitHub
commit 5f3d49e9da
4 changed files with 18 additions and 3 deletions

View File

@ -203,10 +203,10 @@ namespace XenAdmin.Controls.GPU
vGpusPerGpuColumn.Value = string.Empty;
if (!isPassThru)
maxResolutionColumn.Value = VGpuType.MaxResolution;
maxResolutionColumn.Value = (VGpuType.MaxResolution == "0x0" || String.IsNullOrEmpty(VGpuType.MaxResolution)) ? "" : VGpuType.MaxResolution;
if (!isPassThru)
maxDisplaysColumn.Value = VGpuType.max_heads;
maxDisplaysColumn.Value = VGpuType.max_heads < 1 ? "" : String.Format("{0}",VGpuType.max_heads);
else
maxDisplaysColumn.Value = string.Empty;

View File

@ -35476,6 +35476,15 @@ namespace XenAdmin {
}
}
/// <summary>
/// Looks up a localized string similar to {0} virtual GPU ({1} per GPU).
/// </summary>
public static string VGPU_DESCRIPTION_ZEROES {
get {
return ResourceManager.GetString("VGPU_DESCRIPTION_ZEROES", resourceCulture);
}
}
/// <summary>
/// Looks up a localized string similar to Pass-through whole GPU.
/// </summary>

View File

@ -12295,6 +12295,9 @@ To learn more about the [XenServer] Dynamic Workload Balancing feature or to sta
<data name="VGPU_DESCRIPTION_ONE" xml:space="preserve">
<value>{0} virtual GPU ({1} per GPU, {2}, {3} display)</value>
</data>
<data name="VGPU_DESCRIPTION_ZEROES" xml:space="preserve">
<value>{0} virtual GPU ({1} per GPU)</value>
</data>
<data name="VGPU_PASSTHRU_TOSTRING" xml:space="preserve">
<value>Pass-through whole GPU</value>
</data>

View File

@ -55,6 +55,9 @@ namespace XenAPI
if (IsPassthrough)
return Messages.VGPU_PASSTHRU_TOSTRING;
if ((MaxResolution == "0x0" || string.IsNullOrEmpty(MaxResolution)) && max_heads < 1)
return string.Format(Messages.VGPU_DESCRIPTION_ZEROES, model_name, Capacity);
return string.Format(max_heads == 1 ? Messages.VGPU_DESCRIPTION_ONE : Messages.VGPU_DESCRIPTION_MANY,
model_name, Capacity, MaxResolution, max_heads);
}
@ -129,7 +132,7 @@ namespace XenAPI
public bool IsPassthrough
{
get { return max_heads == 0; }
get { return model_name == "passthrough"; }
}
}
}