mirror of
https://github.com/xcp-ng/xenadmin.git
synced 2025-01-20 23:39:51 +01:00
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:
parent
d148956a1b
commit
0e0160645c
@ -179,7 +179,7 @@ namespace XenAdmin.Dialogs
|
|||||||
{
|
{
|
||||||
cannotReason = null;
|
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))
|
if (vtpm.allowed_operations.Contains(vtpm_operations.destroy))
|
||||||
return true;
|
return true;
|
||||||
|
@ -93,7 +93,7 @@ namespace XenAdmin.Dialogs
|
|||||||
{
|
{
|
||||||
cannotReason = null;
|
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))
|
if (Vtpm.allowed_operations.Contains(vtpm_operations.destroy))
|
||||||
return true;
|
return true;
|
||||||
@ -114,7 +114,7 @@ namespace XenAdmin.Dialogs
|
|||||||
if (e.PropertyName == "is_protected" || e.PropertyName == "is_unique")
|
if (e.PropertyName == "is_protected" || e.PropertyName == "is_unique")
|
||||||
Program.Invoke(this, UpdateProperties);
|
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);
|
Program.Invoke(this, UpdateButtons);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -278,7 +278,7 @@ namespace XenAdmin.Actions.VMActions
|
|||||||
if (!_assignVtpm)
|
if (!_assignVtpm)
|
||||||
return;
|
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;
|
return;
|
||||||
|
|
||||||
new NewVtpmAction(Connection, VM).RunSync(Session);
|
new NewVtpmAction(Connection, VM).RunSync(Session);
|
||||||
|
@ -456,10 +456,10 @@ namespace XenAdmin.Core
|
|||||||
return coordinator == null || ProductVersionCompare(coordinator.GetXapiVersion(), "23.9.0") >= 0;
|
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);
|
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
|
#endregion
|
||||||
|
@ -1790,7 +1790,7 @@ namespace XenAPI
|
|||||||
{
|
{
|
||||||
cannotReason = null;
|
cannotReason = null;
|
||||||
|
|
||||||
if (Helpers.XapiEqualOrGreater_23_10_0(Connection))
|
if (Helpers.XapiEqualOrGreater_23_11_0(Connection))
|
||||||
{
|
{
|
||||||
if (allowed_operations.Contains(vm_operations.create_vtpm))
|
if (allowed_operations.Contains(vm_operations.create_vtpm))
|
||||||
return true;
|
return true;
|
||||||
|
Loading…
Reference in New Issue
Block a user