]> xenbits.xensource.com Git - libvirt.git/commitdiff
qemu: reject parallel ports for s390 archs
authorPino Toscano <ptoscano@redhat.com>
Thu, 7 Sep 2017 12:19:39 +0000 (14:19 +0200)
committerMichal Privoznik <mprivozn@redhat.com>
Thu, 21 Sep 2017 11:05:14 +0000 (13:05 +0200)
They are simply not supported on those architectures.

Resolves: https://bugzilla.redhat.com/show_bug.cgi?id=1487499

Signed-off-by: Pino Toscano <ptoscano@redhat.com>
src/qemu/qemu_domain.c
tests/qemuxml2argvdata/qemuxml2argv-s390-no-parallel.xml [new file with mode: 0644]
tests/qemuxml2argvtest.c

index c9522e870e5e2a6989c426448e86209ad9f12b43..927e8c2e056b95a7dfb9a3beb9606a6da2e0aa18 100644 (file)
@@ -3292,11 +3292,18 @@ qemuDomainChrSourceDefValidate(const virDomainChrSourceDef *def)
 
 static int
 qemuDomainChrDefValidate(const virDomainChrDef *dev,
-                         const virDomainDef *def ATTRIBUTE_UNUSED)
+                         const virDomainDef *def)
 {
     if (qemuDomainChrSourceDefValidate(dev->source) < 0)
         return -1;
 
+    if (dev->deviceType == VIR_DOMAIN_CHR_DEVICE_TYPE_PARALLEL &&
+        ARCH_IS_S390(def->os.arch)) {
+            virReportError(VIR_ERR_CONFIG_UNSUPPORTED, "%s",
+                           _("parallel ports are not supported"));
+            return -1;
+    }
+
     return 0;
 }
 
diff --git a/tests/qemuxml2argvdata/qemuxml2argv-s390-no-parallel.xml b/tests/qemuxml2argvdata/qemuxml2argv-s390-no-parallel.xml
new file mode 100644 (file)
index 0000000..5e6a23f
--- /dev/null
@@ -0,0 +1,22 @@
+<domain type='qemu'>
+  <name>QEMUGuest1</name>
+  <uuid>c7a5fdbd-edaf-9455-926a-d65c16db1809</uuid>
+  <memory unit='KiB'>219100</memory>
+  <currentMemory unit='KiB'>219100</currentMemory>
+  <vcpu placement='static'>1</vcpu>
+  <os>
+    <type arch="s390x" machine="s390-ccw-virtio">hvm</type>
+    <boot dev='hd'/>
+  </os>
+  <clock offset='utc'/>
+  <devices>
+    <emulator>/usr/bin/qemu-system-s390x</emulator>
+    <disk type='block' device='disk'>
+      <driver name='qemu' type='raw'/>
+      <source dev='/dev/HostVG/QEMUGuest1'/>
+      <target dev='hda' bus='virtio'/>
+    </disk>
+    <parallel type='pty'/>
+    <memballoon model='none'/>
+  </devices>
+</domain>
index c85f3a3cdb974c6cb523ab526d027c047349a01f..2f7e4ec6f5aa9a4b363d00d22ef4f66abfe30f2b 100644 (file)
@@ -1952,6 +1952,10 @@ mymain(void)
             QEMU_CAPS_NODEFCONFIG,
             QEMU_CAPS_VIRTIO_CCW,
             QEMU_CAPS_VIRTIO_S390);
+    DO_TEST_PARSE_ERROR("s390-no-parallel",
+            QEMU_CAPS_NODEFCONFIG,
+            QEMU_CAPS_VIRTIO_CCW,
+            QEMU_CAPS_VIRTIO_S390);
 
     DO_TEST("ppc-dtb",
             QEMU_CAPS_KVM,