Hello Gustavo Frederico Temple Pedrosa,
I'd like you to do a code review. Please visit
http://gerrit.ovirt.org/25069
to review the following change.
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.
Bug-Url: https://bugzilla.redhat.com/show_bug.cgi?id=1070189
Change-Id: Ibe6a5fd5ad1679045582afcc16aebbfba34f7429
Signed-off-by: Vitor de Lima <[email protected]>
Signed-off-by: Gustavo Pedrosa <[email protected]>
---
M
frontend/webadmin/modules/uicommonweb/src/main/java/org/ovirt/engine/ui/uicommonweb/dataprovider/AsyncDataProvider.java
M
frontend/webadmin/modules/uicommonweb/src/main/java/org/ovirt/engine/ui/uicommonweb/models/userportal/VmItemBehavior.java
M
frontend/webadmin/modules/uicommonweb/src/main/java/org/ovirt/engine/ui/uicommonweb/models/vms/VmListModel.java
3 files changed, 17 insertions(+), 4 deletions(-)
git pull ssh://gerrit.ovirt.org:29418/ovirt-engine refs/changes/69/25069/1
diff --git
a/frontend/webadmin/modules/uicommonweb/src/main/java/org/ovirt/engine/ui/uicommonweb/dataprovider/AsyncDataProvider.java
b/frontend/webadmin/modules/uicommonweb/src/main/java/org/ovirt/engine/ui/uicommonweb/dataprovider/AsyncDataProvider.java
index 2d55a49..70a1082 100644
---
a/frontend/webadmin/modules/uicommonweb/src/main/java/org/ovirt/engine/ui/uicommonweb/dataprovider/AsyncDataProvider.java
+++
b/frontend/webadmin/modules/uicommonweb/src/main/java/org/ovirt/engine/ui/uicommonweb/dataprovider/AsyncDataProvider.java
@@ -318,6 +318,18 @@
callback);
}
+ public static boolean canVmsBePaused(List<VM> items) {
+ boolean result = true;
+
+ for (VM vm : items) {
+ result &=
+
AsyncDataProvider.isSuspendSupportedByArchitecture(vm.getClusterArch(),
+ vm.getVdsGroupCompatibilityVersion());
+ }
+
+ return result;
+ }
+
public static void initNicHotplugSupportMap() {
AsyncQuery callback = new AsyncQuery();
callback.asyncCallback = new INewAsyncCallback() {
diff --git
a/frontend/webadmin/modules/uicommonweb/src/main/java/org/ovirt/engine/ui/uicommonweb/models/userportal/VmItemBehavior.java
b/frontend/webadmin/modules/uicommonweb/src/main/java/org/ovirt/engine/ui/uicommonweb/models/userportal/VmItemBehavior.java
index a5c061f..4121754 100644
---
a/frontend/webadmin/modules/uicommonweb/src/main/java/org/ovirt/engine/ui/uicommonweb/models/userportal/VmItemBehavior.java
+++
b/frontend/webadmin/modules/uicommonweb/src/main/java/org/ovirt/engine/ui/uicommonweb/models/userportal/VmItemBehavior.java
@@ -158,9 +158,9 @@
getItem().getRunCommand().setIsExecutionAllowed(VdcActionUtils.canExecute(entities,
VM.class,
VdcActionType.RunVm));
-
getItem().getPauseCommand().setIsExecutionAllowed(VdcActionUtils.canExecute(entities,
- VM.class,
- VdcActionType.HibernateVm));
+ getItem().getPauseCommand().setIsExecutionAllowed(entities.size() > 0
+ && VdcActionUtils.canExecute(entities, VM.class,
VdcActionType.HibernateVm)
+ && AsyncDataProvider.canVmsBePaused(entities));
getItem().getShutdownCommand().setIsExecutionAllowed(VdcActionUtils.canExecute(entities,
VM.class,
VdcActionType.ShutdownVm));
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 fc55e06..9143f59 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
@@ -2338,7 +2338,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)
+ && AsyncDataProvider.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/25069
To unsubscribe, visit http://gerrit.ovirt.org/settings
Gerrit-MessageType: newchange
Gerrit-Change-Id: Ibe6a5fd5ad1679045582afcc16aebbfba34f7429
Gerrit-PatchSet: 1
Gerrit-Project: ovirt-engine
Gerrit-Branch: ovirt-engine-3.4
Gerrit-Owner: Vitor de Lima <[email protected]>
Gerrit-Reviewer: Gustavo Frederico Temple Pedrosa
<[email protected]>
_______________________________________________
Engine-patches mailing list
[email protected]
http://lists.ovirt.org/mailman/listinfo/engine-patches