Roy Golan has uploaded a new change for review.

Change subject: webadmin: Don't allow migration when using host cpu
......................................................................

webadmin: Don't allow migration when using host cpu

1."Use Host CPU" label is change to Pass-through Host Cpu

Its the actual behavior we use below, see libvirt doc[1]

2. make sure the only migration mode allowed is Non migratable

[1] http://libvirt.org/formatdomain.html#elementsCPU

Change-Id: Ifb736a69ff2a0a4995e18a5842a352d61f93bf00
Bug-Url: https://bugzilla.redhat.com/1052168
Signed-off-by: Roy Golan <rgo...@redhat.com>
---
M 
frontend/webadmin/modules/gwt-common/src/main/java/org/ovirt/engine/ui/common/CommonApplicationConstants.java
M 
frontend/webadmin/modules/gwt-common/src/main/java/org/ovirt/engine/ui/common/widget/uicommon/popup/AbstractVmPopupWidget.java
M 
frontend/webadmin/modules/uicommonweb/src/main/java/org/ovirt/engine/ui/uicommonweb/models/vms/VmModelBehaviorBase.java
3 files changed, 7 insertions(+), 7 deletions(-)


  git pull ssh://gerrit.ovirt.org:29418/ovirt-engine refs/changes/27/34827/1

diff --git 
a/frontend/webadmin/modules/gwt-common/src/main/java/org/ovirt/engine/ui/common/CommonApplicationConstants.java
 
b/frontend/webadmin/modules/gwt-common/src/main/java/org/ovirt/engine/ui/common/CommonApplicationConstants.java
index d9ffe37..fc59b5f 100644
--- 
a/frontend/webadmin/modules/gwt-common/src/main/java/org/ovirt/engine/ui/common/CommonApplicationConstants.java
+++ 
b/frontend/webadmin/modules/gwt-common/src/main/java/org/ovirt/engine/ui/common/CommonApplicationConstants.java
@@ -652,8 +652,8 @@
     @DefaultStringValue("Run VM on the selected host (no migration allowed)")
     String runOnSelectedHostVmPopup();
 
-    @DefaultStringValue("Use Host CPU")
-    String useHostCpu();
+    @DefaultStringValue("Pass-Through Host CPU")
+    String passThroughHostCpu();
 
     @DefaultStringValue("Allow VM migration only upon Administrator specific 
request (system will not trigger automatic migration of this VM)")
     String allowMigrationOnlyAdminVmPopup();
diff --git 
a/frontend/webadmin/modules/gwt-common/src/main/java/org/ovirt/engine/ui/common/widget/uicommon/popup/AbstractVmPopupWidget.java
 
b/frontend/webadmin/modules/gwt-common/src/main/java/org/ovirt/engine/ui/common/widget/uicommon/popup/AbstractVmPopupWidget.java
index 178b495..462b0ab 100644
--- 
a/frontend/webadmin/modules/gwt-common/src/main/java/org/ovirt/engine/ui/common/widget/uicommon/popup/AbstractVmPopupWidget.java
+++ 
b/frontend/webadmin/modules/gwt-common/src/main/java/org/ovirt/engine/ui/common/widget/uicommon/popup/AbstractVmPopupWidget.java
@@ -1393,7 +1393,7 @@
         hostTab.setLabel(constants.hostVmPopup());
         isAutoAssignEditor.setLabel(constants.anyHostInClusterVmPopup());
         // specificHostEditor.setLabel("Specific");
-        hostCpuEditor.setLabel(constants.useHostCpu());
+        hostCpuEditor.setLabel(constants.passThroughHostCpu());
         cpuPinning.setLabel(constants.cpuPinningLabel());
 
         // numa
diff --git 
a/frontend/webadmin/modules/uicommonweb/src/main/java/org/ovirt/engine/ui/uicommonweb/models/vms/VmModelBehaviorBase.java
 
b/frontend/webadmin/modules/uicommonweb/src/main/java/org/ovirt/engine/ui/uicommonweb/models/vms/VmModelBehaviorBase.java
index f8ec6b1..8d5280f 100644
--- 
a/frontend/webadmin/modules/uicommonweb/src/main/java/org/ovirt/engine/ui/uicommonweb/models/vms/VmModelBehaviorBase.java
+++ 
b/frontend/webadmin/modules/uicommonweb/src/main/java/org/ovirt/engine/ui/uicommonweb/models/vms/VmModelBehaviorBase.java
@@ -826,17 +826,17 @@
         }
     }
 
+    /**
+     * A VM which is set to use pass through host cpu cann't migrate, 
otherwise all migrationMode are valid
+     */
     public void updateUseHostCpuAvailability() {
 
         boolean clusterSupportsHostCpu =
                 getClusterCompatibilityVersion() != null
                         && 
(getClusterCompatibilityVersion().compareTo(Version.v3_2) >= 0);
         boolean nonMigratable = MigrationSupport.PINNED_TO_HOST == 
getModel().getMigrationMode().getSelectedItem();
-        boolean manuallyMigratableAndAnyHostInCluster =
-                MigrationSupport.IMPLICITLY_NON_MIGRATABLE == 
getModel().getMigrationMode().getSelectedItem()
-                        && 
Boolean.TRUE.equals(getModel().getIsAutoAssign().getEntity());
 
-        if (clusterSupportsHostCpu && (nonMigratable || 
manuallyMigratableAndAnyHostInCluster)) {
+        if (clusterSupportsHostCpu && nonMigratable) {
             getModel().getHostCpu().setIsChangable(true);
         } else {
             getModel().getHostCpu().setEntity(false);


-- 
To view, visit http://gerrit.ovirt.org/34827
To unsubscribe, visit http://gerrit.ovirt.org/settings

Gerrit-MessageType: newchange
Gerrit-Change-Id: Ifb736a69ff2a0a4995e18a5842a352d61f93bf00
Gerrit-PatchSet: 1
Gerrit-Project: ovirt-engine
Gerrit-Branch: master
Gerrit-Owner: Roy Golan <rgo...@redhat.com>
_______________________________________________
Engine-patches mailing list
Engine-patches@ovirt.org
http://lists.ovirt.org/mailman/listinfo/engine-patches

Reply via email to