Martin Beták has uploaded a new change for review.

Change subject: webadmin: Correct 64-bit VM memory limit validation
......................................................................

webadmin: Correct 64-bit VM memory limit validation

The UnitVmModel.UpdateMaximalVmMemSize method wasn't called on
Cluster_SelectedItemChanged, so the validation used the initial value of
262144 MB which is obsolete.

Also changed the default value for ConfigValues.VM64BitMaxMemorySizeInMB from
262144 to more up-to-date 524288 (supported since 3.0).

Change-Id: I16562b554a133e9c753a859d6f3f5a348eaa72cc
Bug-Url: https://bugzilla.redhat.com/show_bug.cgi?id=954021
Signed-off-by: Martin Betak <mbe...@redhat.com>
---
M 
backend/manager/modules/common/src/main/java/org/ovirt/engine/core/common/config/ConfigValues.java
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/vms/UnitVmModel.java
3 files changed, 6 insertions(+), 3 deletions(-)


  git pull ssh://gerrit.ovirt.org:29418/ovirt-engine refs/changes/64/14164/1

diff --git 
a/backend/manager/modules/common/src/main/java/org/ovirt/engine/core/common/config/ConfigValues.java
 
b/backend/manager/modules/common/src/main/java/org/ovirt/engine/core/common/config/ConfigValues.java
index 3422353..8bbf9df 100644
--- 
a/backend/manager/modules/common/src/main/java/org/ovirt/engine/core/common/config/ConfigValues.java
+++ 
b/backend/manager/modules/common/src/main/java/org/ovirt/engine/core/common/config/ConfigValues.java
@@ -532,7 +532,7 @@
     VM32BitMaxMemorySizeInMB(211),
     @Reloadable
     @TypeConverterAttribute(Integer.class)
-    @DefaultValueAttribute("262144")
+    @DefaultValueAttribute("524288")
     VM64BitMaxMemorySizeInMB(212),
     @Reloadable
     @TypeConverterAttribute(Integer.class)
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 de8bf4d..2dcf3c7 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
@@ -495,7 +495,8 @@
             @Override
             public Object Convert(Object source, AsyncQuery _asyncQuery)
             {
-                return source != null ? ((Integer) source).intValue() : 262144;
+                // we should detect missing config values instead of putting 
in obsolete hardcoded values
+                return source != null ? ((Integer) source).intValue() : -1;
             }
         };
         GetConfigurationValueParameters tempVar =
diff --git 
a/frontend/webadmin/modules/uicommonweb/src/main/java/org/ovirt/engine/ui/uicommonweb/models/vms/UnitVmModel.java
 
b/frontend/webadmin/modules/uicommonweb/src/main/java/org/ovirt/engine/ui/uicommonweb/models/vms/UnitVmModel.java
index 6bbc219..cd3cca9 100644
--- 
a/frontend/webadmin/modules/uicommonweb/src/main/java/org/ovirt/engine/ui/uicommonweb/models/vms/UnitVmModel.java
+++ 
b/frontend/webadmin/modules/uicommonweb/src/main/java/org/ovirt/engine/ui/uicommonweb/models/vms/UnitVmModel.java
@@ -1016,7 +1016,7 @@
         _maxMemSize32 = value;
     }
 
-    private int _maxMemSize64 = 262144;
+    private int _maxMemSize64 = 524288;
 
     public int get_MaxMemSize64()
     {
@@ -1593,6 +1593,8 @@
     private void Cluster_SelectedItemChanged(Object sender, EventArgs args)
     {
         behavior.Cluster_SelectedItemChanged();
+
+        UpdateMaximalVmMemSize();
     }
 
     private void TimeZone_SelectedItemChanged(Object sender, EventArgs args)


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

Gerrit-MessageType: newchange
Gerrit-Change-Id: I16562b554a133e9c753a859d6f3f5a348eaa72cc
Gerrit-PatchSet: 1
Gerrit-Project: ovirt-engine
Gerrit-Branch: master
Gerrit-Owner: Martin Beták <mbe...@redhat.com>
_______________________________________________
Engine-patches mailing list
Engine-patches@ovirt.org
http://lists.ovirt.org/mailman/listinfo/engine-patches

Reply via email to