[Kimchi-devel] [PATCH] [Kimchi 1/3] Added s390x architecture support in osinfo params.

archus at linux.vnet.ibm.com archus at linux.vnet.ibm.com
Tue Aug 9 12:53:01 UTC 2016


From: Archana Singh <archus at linux.vnet.ibm.com>

1) Added s390x in SUPPORTED_ARCHS.
2) Added memory devices slot limits for s390x.
3) Added template_spec for s390x.
4) Added arch check to add old template spec in params
and no need to do modern_version_bases check as for
s390x as template specs are same for all version.

Signed-off-by: Archana Singh <archus at linux.vnet.ibm.com>
---
 osinfo.py | 18 +++++++++++++-----
 1 file changed, 13 insertions(+), 5 deletions(-)

diff --git a/osinfo.py b/osinfo.py
index a3c2b0e..fcdb0fe 100644
--- a/osinfo.py
+++ b/osinfo.py
@@ -31,7 +31,8 @@ from wok.plugins.kimchi.config import kimchiPaths
 
 SUPPORTED_ARCHS = {'x86': ('i386', 'i686', 'x86_64'),
                    'power': ('ppc', 'ppc64'),
-                   'ppc64le': ('ppc64le')}
+                   'ppc64le': ('ppc64le'),
+                   's390x': ('s390x')}
 
 
 # Memory devices slot limits by architecture
@@ -39,7 +40,8 @@ MEM_DEV_SLOTS = {'ppc64': 256,
                  'ppc64le': 256,
                  'x86_64': 256,
                  'i686': 256,
-                 'i386': 256}
+                 'i386': 256,
+                 's390x': 256}
 
 
 template_specs = {'x86': {'old': dict(disk_bus='ide',
@@ -71,7 +73,11 @@ template_specs = {'x86': {'old': dict(disk_bus='ide',
                                              kbd_bus='usb',
                                              kbd_type="keyboard",
                                              mouse_bus='usb',
-                                             tablet_bus='usb')}}
+                                             tablet_bus='usb')},
+                  's390x': {'old': dict(disk_bus='virtio',
+                                        nic_model='virtio', cdrom_bus='scsi'),
+                            'modern': dict(disk_bus='virtio',
+                                           nic_model='virtio', cdrom_bus='scsi')}}
 
 
 custom_specs = {'fedora': {'22': {'x86': dict(video_model='qxl')}}}
@@ -218,8 +224,10 @@ def lookup(distro, version):
     # set up arch to ppc64 instead of ppc64le due to libvirt compatibility
     if params["arch"] == "ppc64le":
         params["arch"] = "ppc64"
-
-    if distro in modern_version_bases[arch]:
+    # On s390x, template spec does not change based on version.
+    if params["arch"] == "s390x":
+       params.update(template_specs[arch]['old'])
+    elif distro in modern_version_bases[arch]:
         if LooseVersion(version) >= LooseVersion(
                 modern_version_bases[arch][distro]):
             params.update(template_specs[arch]['modern'])
-- 
2.7.4




More information about the Kimchi-devel mailing list