Tomas Jelinek has uploaded a new change for review.

Change subject: webadmin: improve edit vm dialog - vcpu editing (#854942)
......................................................................

webadmin: improve edit vm dialog - vcpu editing (#854942)

https://bugzilla.redhat.com/854942

Two changes:

- Disable the remembering of the already selected cores/socket
  and always set them to the lowest possible value, when the
  total cpu cores changes

- Move the advanced parameters section closer to the total cpu
  cores

Change-Id: Ie642e76e74891ddf1f8c55e61dcfc9efa0aa363a
Signed-off-by: Tomas Jelinek <[email protected]>
---
M 
frontend/webadmin/modules/gwt-common/src/main/java/org/ovirt/engine/ui/common/widget/uicommon/popup/AbstractVmPopupWidget.ui.xml
M 
frontend/webadmin/modules/uicommonweb/src/main/java/org/ovirt/engine/ui/uicommonweb/models/vms/VmModelBehaviorBase.java
2 files changed, 15 insertions(+), 28 deletions(-)


  git pull ssh://gerrit.ovirt.org:29418/ovirt-engine refs/changes/42/7842/1

diff --git 
a/frontend/webadmin/modules/gwt-common/src/main/java/org/ovirt/engine/ui/common/widget/uicommon/popup/AbstractVmPopupWidget.ui.xml
 
b/frontend/webadmin/modules/gwt-common/src/main/java/org/ovirt/engine/ui/common/widget/uicommon/popup/AbstractVmPopupWidget.ui.xml
index 87d20ff..f55e2d6 100644
--- 
a/frontend/webadmin/modules/gwt-common/src/main/java/org/ovirt/engine/ui/common/widget/uicommon/popup/AbstractVmPopupWidget.ui.xml
+++ 
b/frontend/webadmin/modules/gwt-common/src/main/java/org/ovirt/engine/ui/common/widget/uicommon/popup/AbstractVmPopupWidget.ui.xml
@@ -226,7 +226,7 @@
                                                        
<e:EntityModelTextBoxEditor ui:field="nameEditor" />
                                                        
<e:EntityModelTextBoxEditor ui:field="descriptionEditor" />
 
-<!--                                           New VM                          
                         -->
+<!--                                           New VM Pool                     
                                 -->
                                                        
<e:EntityModelTextBoxEditor ui:field="numOfVmsEditor" />
                             <g:FlowPanel ui:field="newPoolEditVmsPanel" 
addStyleNames="{style.poolEditVms}">
                                <g:FlowPanel 
addStyleNames="{style.prestartedLabelWithHelp}">
@@ -236,7 +236,7 @@
                                                                
<e:EntityModelTextBoxOnlyEditor ui:field="prestartedVmsEditor" 
addStyleNames="{style.prestartedVmsEditor}" 
contentWidgetStyleName="{style.prestartedVmsEditorContent}" />
                             </g:FlowPanel>
                             
-<!--                             Edit VM -->
+<!--                             Edit VM Pool -->
                             <g:FlowPanel addStyleNames="{style.poolEditVms}" 
ui:field="editPoolEditVmsPanel">
                                                                <g:FlowPanel 
addStyleNames="{style.editPrestartedLabelWithHelp}">
                                                                        
<g:Label ui:field="editPrestartedVmsLabel" 
addStyleNames="{style.prestartedLabel}" />
@@ -260,12 +260,12 @@
                         <g:FlowPanel addStyleNames="{style.sectionPanel}">
                             <e:EntityModelTextBoxEditor 
ui:field="memSizeEditor"/>
                             <e:EntityModelTextBoxEditor 
ui:field="totalvCPUsEditor" />
-                                               </g:FlowPanel>
-                                               <g:FlowPanel 
addStyleNames="{style.sectionPanel}">
-                                                       
<d:AdvancedParametersExpander ui:field="generalAdvancedParameterExpander"/>
-                                                       <g:FlowPanel 
ui:field="generalAdvancedParameterExpanderContent" 
addStyleNames="{style.generalExpanderContent}">
-                                                               
<e:ListModelListBoxEditor ui:field="corePerSocketEditor" />
-                                                               
<e:ListModelListBoxEditor ui:field="numOfSocketsEditor" />
+                                                       <g:FlowPanel 
addStyleNames="{style.sectionPanel}">
+                                                               
<d:AdvancedParametersExpander ui:field="generalAdvancedParameterExpander"/>
+                                                               <g:FlowPanel 
ui:field="generalAdvancedParameterExpanderContent" 
addStyleNames="{style.generalExpanderContent}">
+                                                                       
<e:ListModelListBoxEditor ui:field="corePerSocketEditor" />
+                                                                       
<e:ListModelListBoxEditor ui:field="numOfSocketsEditor" />
+                                                               </g:FlowPanel>
                                                        </g:FlowPanel>
                                                </g:FlowPanel>
                                                <g:FlowPanel 
addStyleNames="{style.sectionPanel}">
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 d6f8812..1b73ed1 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
@@ -774,27 +774,14 @@
         
getModel().getCoresPerSocket().setItems(filterPossibleValues(coresPerSocets, 
sockets));
         getModel().getNumOfSockets().setItems(filterPossibleValues(sockets, 
coresPerSocets));
 
-        if (totalCpuCores % coresPerSocket == 0) {
-            // the value selected in the coresPerSocket is compatible with the 
new totalCPUCores,
-            // so keep it and adjust the numOfSockets according to it
-            int newNumOfSockets = totalCpuCores / coresPerSocket;
-            if (newNumOfSockets <= maxNumOfSockets) {
-                getModel().getNumOfSockets().setSelectedItem(newNumOfSockets);
-                getModel().getCoresPerSocket().setSelectedItem(coresPerSocket);
-            } else {
-                // we need to compose it from more cores on the available 
sockets
-                composeCoresAndSocketsWhenDontFitInto(totalCpuCores);
-            }
+        // ignore the value already selected in the coresPerSocket
+        // and always try to set the max possible totalcpuCores
+        if (totalCpuCores <= maxNumOfSockets) {
+            getModel().getCoresPerSocket().setSelectedItem(1);
+            getModel().getNumOfSockets().setSelectedItem(totalCpuCores);
         } else {
-            // the value selected in coresPerSocket is not compatible with the 
new totalCPUCores,
-            // so erase it to 1 and select the numOfSockets to be the same as 
the totalCPUCores
-            if (totalCpuCores <= maxNumOfSockets) {
-                getModel().getCoresPerSocket().setSelectedItem(1);
-                getModel().getNumOfSockets().setSelectedItem(totalCpuCores);
-            } else {
-                // we need to compose it from more cores on the available 
sockets
-                composeCoresAndSocketsWhenDontFitInto(totalCpuCores);
-            }
+            // we need to compose it from more cores on the available sockets
+            composeCoresAndSocketsWhenDontFitInto(totalCpuCores);
         }
 
         boolean isNumOfVcpusCorrect = isNumOfSocketsCorrect(totalCpuCores);


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

Gerrit-MessageType: newchange
Gerrit-Change-Id: Ie642e76e74891ddf1f8c55e61dcfc9efa0aa363a
Gerrit-PatchSet: 1
Gerrit-Project: ovirt-engine
Gerrit-Branch: master
Gerrit-Owner: Tomas Jelinek <[email protected]>
_______________________________________________
Engine-patches mailing list
[email protected]
http://lists.ovirt.org/mailman/listinfo/engine-patches

Reply via email to