Sandro Bonazzola has uploaded a new change for review.

Change subject: packaging: setup: use arch limit for shmmax
......................................................................

packaging: setup: use arch limit for shmmax

If not already set, set shmmax to arch limit.

Change-Id: Idbc9b651d2f9e47e58c75b44bd84418990f59d60
Bug-Url: https://bugzilla.redhat.com/1039616
Signed-off-by: Sandro Bonazzola <sbona...@redhat.com>
---
M packaging/setup/ovirt_engine_setup/constants.py
1 file changed, 18 insertions(+), 1 deletion(-)


  git pull ssh://gerrit.ovirt.org:29418/ovirt-engine refs/changes/41/23641/1

diff --git a/packaging/setup/ovirt_engine_setup/constants.py 
b/packaging/setup/ovirt_engine_setup/constants.py
index 9b45c65..13d1f16 100644
--- a/packaging/setup/ovirt_engine_setup/constants.py
+++ b/packaging/setup/ovirt_engine_setup/constants.py
@@ -21,6 +21,7 @@
 
 import os
 import sys
+import platform
 import gettext
 _ = lambda m: gettext.dgettext(message=m, domain='ovirt-engine-setup')
 
@@ -61,6 +62,22 @@
                 summary_condition=summary_condition,
             )
     return decorator
+
+
+class SHMMax(object):
+    ARCH_LIMITS = {
+        'x86_64': 68719476736,
+        'i686': 4294967295,
+        'ppc64':  137438953472,
+        'default': 4294967295,
+    }
+
+    @staticmethod
+    def get_limit():
+        arch = platform.machine()
+        if not arch in SHMMax.ARCH_LIMITS:
+            arch = 'default'
+        return SHMMax.ARCH_LIMITS[arch]
 
 
 @util.export
@@ -440,7 +457,7 @@
     DEFAULT_SYSTEM_GROUP_ENGINE = 'ovirt'
     DEFAULT_SYSTEM_USER_POSTGRES = 'postgres'
 
-    DEFAULT_SYSTEM_SHMMAX = 41943040
+    DEFAULT_SYSTEM_SHMMAX = SHMMax.get_limit()
 
     DEFAULT_SYSTEM_MEMCHECK_MINIMUM_MB = 4096
     DEFAULT_SYSTEM_MEMCHECK_RECOMMENDED_MB = 16384


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

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

Reply via email to