CA-376894: The allowed_operations are not refreshed after vTPM removal in xapi 23.10.0.

Signed-off-by: Konstantina Chremmou <Konstantina.Chremmou@cloud.com>
This commit is contained in:
Konstantina Chremmou 2023-05-05 02:14:38 +01:00
parent d148956a1b
commit 0e0160645c
5 changed files with 7 additions and 7 deletions

View File

@ -179,7 +179,7 @@ namespace XenAdmin.Dialogs
{
cannotReason = null;
if (Helpers.XapiEqualOrGreater_23_10_0(vtpm.Connection))
if (Helpers.XapiEqualOrGreater_23_11_0(vtpm.Connection))
{
if (vtpm.allowed_operations.Contains(vtpm_operations.destroy))
return true;

View File

@ -93,7 +93,7 @@ namespace XenAdmin.Dialogs
{
cannotReason = null;
if (Helpers.XapiEqualOrGreater_23_10_0(Vtpm.Connection))
if (Helpers.XapiEqualOrGreater_23_11_0(Vtpm.Connection))
{
if (Vtpm.allowed_operations.Contains(vtpm_operations.destroy))
return true;
@ -114,7 +114,7 @@ namespace XenAdmin.Dialogs
if (e.PropertyName == "is_protected" || e.PropertyName == "is_unique")
Program.Invoke(this, UpdateProperties);
if (e.PropertyName == "allowed_operations" && Helpers.XapiEqualOrGreater_23_10_0(vtpm.Connection))
if (e.PropertyName == "allowed_operations" && Helpers.XapiEqualOrGreater_23_11_0(vtpm.Connection))
Program.Invoke(this, UpdateButtons);
}

View File

@ -278,7 +278,7 @@ namespace XenAdmin.Actions.VMActions
if (!_assignVtpm)
return;
if (Helpers.XapiEqualOrGreater_23_10_0(Connection) && !VM.allowed_operations.Contains(vm_operations.create_vtpm))
if (Helpers.XapiEqualOrGreater_23_11_0(Connection) && !VM.allowed_operations.Contains(vm_operations.create_vtpm))
return;
new NewVtpmAction(Connection, VM).RunSync(Session);

View File

@ -456,10 +456,10 @@ namespace XenAdmin.Core
return coordinator == null || ProductVersionCompare(coordinator.GetXapiVersion(), "23.9.0") >= 0;
}
public static bool XapiEqualOrGreater_23_10_0(IXenConnection conn)
public static bool XapiEqualOrGreater_23_11_0(IXenConnection conn)
{
var coordinator = GetCoordinator(conn);
return coordinator == null || ProductVersionCompare(coordinator.GetXapiVersion(), "23.10.0") >= 0;
return coordinator == null || ProductVersionCompare(coordinator.GetXapiVersion(), "23.11.0") >= 0;
}
#endregion

View File

@ -1790,7 +1790,7 @@ namespace XenAPI
{
cannotReason = null;
if (Helpers.XapiEqualOrGreater_23_10_0(Connection))
if (Helpers.XapiEqualOrGreater_23_11_0(Connection))
{
if (allowed_operations.Contains(vm_operations.create_vtpm))
return true;