[Kimchi-devel] [PATCH V2] [Kimchi] Added s390x architecture support in osinfo params.
Aline Manera
alinefm at linux.vnet.ibm.com
Tue Aug 30 14:36:12 UTC 2016
On 08/10/2016 03:48 AM, archus at linux.vnet.ibm.com wrote:
> 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 | 19 ++++++++++++++-----
> 1 file changed, 14 insertions(+), 5 deletions(-)
>
> diff --git a/osinfo.py b/osinfo.py
> index a3c2b0e..6b81422 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,12 @@ 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')}}
>
Why do we have 2 dicts for old and modern, if only the old dict is in use?
> custom_specs = {'fedora': {'22': {'x86': dict(video_model='qxl')}}}
> @@ -218,8 +225,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'])
More information about the Kimchi-devel
mailing list