sinnykumari / rpms / oz

Forked from rpms/oz 4 years ago
Clone
Sinny Kumari 99a0455
diff --git a/oz/Guest.py b/oz/Guest.py
Sinny Kumari 99a0455
index 048c307..e86a39c 100644
Sinny Kumari 99a0455
--- a/oz/Guest.py
Sinny Kumari 99a0455
+++ b/oz/Guest.py
Sinny Kumari 99a0455
@@ -131,7 +131,7 @@ class Guest(object):
Sinny Kumari 99a0455
         # for backwards compatibility
Sinny Kumari 99a0455
         self.name = self.tdl.name
Sinny Kumari 99a0455
 
Sinny Kumari 99a0455
-        if not self.tdl.arch in ["i386", "x86_64", "ppc64", "ppc64le", "aarch64", "armv7l"]:
Sinny Kumari 99a0455
+        if not self.tdl.arch in ["i386", "x86_64", "ppc64", "ppc64le", "aarch64", "armv7l", "s390x"]:
Sinny Kumari 99a0455
             raise oz.OzException.OzException("Unsupported guest arch " + self.tdl.arch)
Sinny Kumari 99a0455
 
Sinny Kumari 99a0455
         if os.uname()[4] in ["i386", "i586", "i686"] and self.tdl.arch == "x86_64":
Sinny Kumari 99a0455
@@ -419,7 +419,11 @@ class Guest(object):
Sinny Kumari 99a0455
         oz.ozutil.lxml_subelement(serial, "source", None,
Sinny Kumari 99a0455
                                   {'mode':'bind', 'host':'127.0.0.1', 'service':str(self.listen_port)})
Sinny Kumari 99a0455
         oz.ozutil.lxml_subelement(serial, "protocol", None, {'type':'raw'})
Sinny Kumari 99a0455
-        oz.ozutil.lxml_subelement(serial, "target", None, {'port':'1'})
Sinny Kumari 99a0455
+        target = oz.ozutil.lxml_subelement(serial, "target", None, {'port':'1'})
Sinny Kumari 99a0455
+        if self.tdl.arch == 's390x':
Sinny Kumari 99a0455
+            # use a different console, as sclp can be used as most once
Sinny Kumari 99a0455
+            target.set('type', 'sclp-serial')
Sinny Kumari 99a0455
+            oz.ozutil.lxml_subelement(target, "model", None, {'name':'sclplmconsole'})
Sinny Kumari 99a0455
 
Sinny Kumari 99a0455
     def _generate_virtio_channel(self, devices, name):
Sinny Kumari 99a0455
         virtio = oz.ozutil.lxml_subelement(devices, "channel", None, {'type': 'tcp'})
Sinny Kumari 99a0455
@@ -484,8 +488,8 @@ class Guest(object):
Sinny Kumari 99a0455
         # devices
Sinny Kumari 99a0455
         devices = oz.ozutil.lxml_subelement(domain, "devices")
Sinny Kumari 99a0455
         # graphics
Sinny Kumari 99a0455
-        if not self.tdl.arch in ["aarch64", "armv7l"]:
Sinny Kumari 99a0455
-            # qemu for arm/aarch64 does not support a graphical console - amazingly
Sinny Kumari 99a0455
+        if not self.tdl.arch in ["aarch64", "armv7l", "s390x"]:
Sinny Kumari 99a0455
+            # qemu for arm/aarch64/s390x does not support a graphical console - amazingly
Sinny Kumari 99a0455
             oz.ozutil.lxml_subelement(devices, "graphics", None, {'port':'-1', 'type':'vnc'})
Sinny Kumari 99a0455
         # network
Sinny Kumari 99a0455
         interface = oz.ozutil.lxml_subelement(devices, "interface", None, {'type':'bridge'})
Sinny Kumari 99a0455
diff --git a/oz/TDL.py b/oz/TDL.py
Sinny Kumari 99a0455
index 5f3f22b..f18c698 100644
Sinny Kumari 99a0455
--- a/oz/TDL.py
Sinny Kumari 99a0455
+++ b/oz/TDL.py
Sinny Kumari 99a0455
@@ -206,8 +206,8 @@ class TDL(object):
Sinny Kumari 99a0455
 
Sinny Kumari 99a0455
         self.arch = _xml_get_value(self.doc, '/template/os/arch',
Sinny Kumari 99a0455
                                    'OS architecture')
Sinny Kumari 99a0455
-        if self.arch not in ["i386", "x86_64", "ppc64", "ppc64le", "aarch64", "armv7l"]:
Sinny Kumari 99a0455
-            raise oz.OzException.OzException("Architecture must be one of 'i386, x86_64, ppc64, ppc64le, armv7l, or aarch64'")
Sinny Kumari 99a0455
+        if self.arch not in ["i386", "x86_64", "ppc64", "ppc64le", "aarch64", "armv7l", "s390x"]:
Sinny Kumari 99a0455
+            raise oz.OzException.OzException("Architecture must be one of 'i386, x86_64, ppc64, ppc64le, armv7l, aarch64, or s390x'")
Sinny Kumari 99a0455
 
Sinny Kumari 99a0455
         self.key = _xml_get_value(self.doc, '/template/os/key', 'OS key',
Sinny Kumari 99a0455
                                   optional=True)
Sinny Kumari 99a0455
diff --git a/oz/tdl.rng b/oz/tdl.rng
Sinny Kumari 99a0455
index 500c0ed..dc29c9a 100644
Sinny Kumari 99a0455
--- a/oz/tdl.rng
Sinny Kumari 99a0455
+++ b/oz/tdl.rng
Sinny Kumari 99a0455
@@ -34,6 +34,7 @@
Sinny Kumari 99a0455
                 <value>ppc64le</value>
Sinny Kumari 99a0455
                 <value>aarch64</value>
Sinny Kumari 99a0455
                 <value>armv7l</value>
Sinny Kumari 99a0455
+                <value>s390x</value>
Sinny Kumari 99a0455
               </choice>
Sinny Kumari 99a0455
             </element>
Sinny Kumari 99a0455
             <optional>