Vitor de Lima has uploaded a new change for review. Change subject: webadmin: Prevent VM suspend in the ppc64 arch ......................................................................
webadmin: Prevent VM suspend in the ppc64 arch This change prevents the suspension of VMs in architectures that do not support it by disabling the suspend button in the frontend. Change-Id: Ibe6a5fd5ad1679045582afcc16aebbfba34f7429 Signed-off-by: Vitor de Lima <vitor.l...@eldorado.org.br> --- M frontend/webadmin/modules/uicommonweb/src/main/java/org/ovirt/engine/ui/uicommonweb/models/vms/VmListModel.java 1 file changed, 14 insertions(+), 1 deletion(-) git pull ssh://gerrit.ovirt.org:29418/ovirt-engine refs/changes/15/24015/1 diff --git a/frontend/webadmin/modules/uicommonweb/src/main/java/org/ovirt/engine/ui/uicommonweb/models/vms/VmListModel.java b/frontend/webadmin/modules/uicommonweb/src/main/java/org/ovirt/engine/ui/uicommonweb/models/vms/VmListModel.java index 6566b8d..938f519 100644 --- a/frontend/webadmin/modules/uicommonweb/src/main/java/org/ovirt/engine/ui/uicommonweb/models/vms/VmListModel.java +++ b/frontend/webadmin/modules/uicommonweb/src/main/java/org/ovirt/engine/ui/uicommonweb/models/vms/VmListModel.java @@ -2181,6 +2181,18 @@ } } + private boolean canVmsBePaused(List<VM> items) { + boolean result = true; + + for (VM vm : items) { + result &= + AsyncDataProvider.isSuspendSupportedByArchitecture(vm.getClusterArch(), + vm.getVdsGroupCompatibilityVersion()); + } + + return result; + } + private void updateActionAvailability() { List items = getSelectedItems() != null && getSelectedItem() != null ? getSelectedItems() @@ -2192,7 +2204,8 @@ getRunCommand().setIsExecutionAllowed(items.size() > 0 && VdcActionUtils.canExecute(items, VM.class, VdcActionType.RunVm)); getPauseCommand().setIsExecutionAllowed(items.size() > 0 - && VdcActionUtils.canExecute(items, VM.class, VdcActionType.HibernateVm)); + && VdcActionUtils.canExecute(items, VM.class, VdcActionType.HibernateVm) + && canVmsBePaused(items)); getShutdownCommand().setIsExecutionAllowed(items.size() > 0 && VdcActionUtils.canExecute(items, VM.class, VdcActionType.ShutdownVm)); getStopCommand().setIsExecutionAllowed(items.size() > 0 -- To view, visit http://gerrit.ovirt.org/24015 To unsubscribe, visit http://gerrit.ovirt.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: Ibe6a5fd5ad1679045582afcc16aebbfba34f7429 Gerrit-PatchSet: 1 Gerrit-Project: ovirt-engine Gerrit-Branch: master Gerrit-Owner: Vitor de Lima <vitor.l...@eldorado.org.br> _______________________________________________ Engine-patches mailing list Engine-patches@ovirt.org http://lists.ovirt.org/mailman/listinfo/engine-patches