#1 Include upstream patches to add s390x support
Closed 6 years ago by clalance. Opened 6 years ago by sinnykumari.
rpms/ sinnykumari/oz master  into  master

@@ -0,0 +1,64 @@ 

+ diff --git a/oz/Guest.py b/oz/Guest.py

+ index 048c307..e86a39c 100644

+ --- a/oz/Guest.py

+ +++ b/oz/Guest.py

+ @@ -131,7 +131,7 @@ class Guest(object):

+          # for backwards compatibility

+          self.name = self.tdl.name

+  

+ -        if not self.tdl.arch in ["i386", "x86_64", "ppc64", "ppc64le", "aarch64", "armv7l"]:

+ +        if not self.tdl.arch in ["i386", "x86_64", "ppc64", "ppc64le", "aarch64", "armv7l", "s390x"]:

+              raise oz.OzException.OzException("Unsupported guest arch " + self.tdl.arch)

+  

+          if os.uname()[4] in ["i386", "i586", "i686"] and self.tdl.arch == "x86_64":

+ @@ -419,7 +419,11 @@ class Guest(object):

+          oz.ozutil.lxml_subelement(serial, "source", None,

+                                    {'mode':'bind', 'host':'127.0.0.1', 'service':str(self.listen_port)})

+          oz.ozutil.lxml_subelement(serial, "protocol", None, {'type':'raw'})

+ -        oz.ozutil.lxml_subelement(serial, "target", None, {'port':'1'})

+ +        target = oz.ozutil.lxml_subelement(serial, "target", None, {'port':'1'})

+ +        if self.tdl.arch == 's390x':

+ +            # use a different console, as sclp can be used as most once

+ +            target.set('type', 'sclp-serial')

+ +            oz.ozutil.lxml_subelement(target, "model", None, {'name':'sclplmconsole'})

+  

+      def _generate_virtio_channel(self, devices, name):

+          virtio = oz.ozutil.lxml_subelement(devices, "channel", None, {'type': 'tcp'})

+ @@ -484,8 +488,8 @@ class Guest(object):

+          # devices

+          devices = oz.ozutil.lxml_subelement(domain, "devices")

+          # graphics

+ -        if not self.tdl.arch in ["aarch64", "armv7l"]:

+ -            # qemu for arm/aarch64 does not support a graphical console - amazingly

+ +        if not self.tdl.arch in ["aarch64", "armv7l", "s390x"]:

+ +            # qemu for arm/aarch64/s390x does not support a graphical console - amazingly

+              oz.ozutil.lxml_subelement(devices, "graphics", None, {'port':'-1', 'type':'vnc'})

+          # network

+          interface = oz.ozutil.lxml_subelement(devices, "interface", None, {'type':'bridge'})

+ diff --git a/oz/TDL.py b/oz/TDL.py

+ index 5f3f22b..f18c698 100644

+ --- a/oz/TDL.py

+ +++ b/oz/TDL.py

+ @@ -206,8 +206,8 @@ class TDL(object):

+  

+          self.arch = _xml_get_value(self.doc, '/template/os/arch',

+                                     'OS architecture')

+ -        if self.arch not in ["i386", "x86_64", "ppc64", "ppc64le", "aarch64", "armv7l"]:

+ -            raise oz.OzException.OzException("Architecture must be one of 'i386, x86_64, ppc64, ppc64le, armv7l, or aarch64'")

+ +        if self.arch not in ["i386", "x86_64", "ppc64", "ppc64le", "aarch64", "armv7l", "s390x"]:

+ +            raise oz.OzException.OzException("Architecture must be one of 'i386, x86_64, ppc64, ppc64le, armv7l, aarch64, or s390x'")

+  

+          self.key = _xml_get_value(self.doc, '/template/os/key', 'OS key',

+                                    optional=True)

+ diff --git a/oz/tdl.rng b/oz/tdl.rng

+ index 500c0ed..dc29c9a 100644

+ --- a/oz/tdl.rng

+ +++ b/oz/tdl.rng

+ @@ -34,6 +34,7 @@

+                  <value>ppc64le</value>

+                  <value>aarch64</value>

+                  <value>armv7l</value>

+ +                <value>s390x</value>

+                </choice>

+              </element>

+              <optional>

file modified
+6 -2
@@ -1,11 +1,12 @@ 

  Summary: Library and utilities for automated guest OS installs

  Name: oz

  Version: 0.16.0

- Release: 2%{?dist}

+ Release: 3%{?dist}

  License: LGPLv2

  Group: Development/Libraries

  URL: http://github.com/clalancette/oz

  Source0: https://github.com/clalancette/%{name}/files/1209916/%{name}-%{version}.tar.gz

+ Patch0: oz-s390x-support.patch

  BuildArch: noarch

  Requires: python >= 2.5

  Requires: python-libguestfs >= 1.18
@@ -32,7 +33,7 @@ 

  installations, with minimal input from the user.

  

  %prep

- %setup -q

+ %autosetup -p1

  

  %build

  python setup.py build
@@ -80,6 +81,9 @@ 

  %{_mandir}/man1/*

  

  %changelog

+ * Fri Feb 09 2018 Sinny Kumari <sinny@redhat.com> - 0.16.0-3

+ - Resolves #1535043 - patches to include s390x support

+ 

  * Thu Feb 08 2018 Fedora Release Engineering <releng@fedoraproject.org> - 0.16.0-2

  - Rebuilt for https://fedoraproject.org/wiki/Fedora_28_Mass_Rebuild

  

rebased onto 99a0455

6 years ago

@sinnykumari Thanks for the PR. I've ended up doing the same thing in a slightly different way. Namely, I did a separate patch for each upstream patch. I think that will make it a bit easier to track in the future. In any case, this is now built into rawhide, so please give that a test and let me know how it goes. If you have problems, feel free to re-open this PR or open a new one. Thanks!

Pull-Request has been closed by clalance

6 years ago