]> xenbits.xensource.com Git - libvirt.git/commitdiff
qemu: reject parallel ports for pseries machines
authorPino Toscano <ptoscano@redhat.com>
Thu, 7 Sep 2017 12:19:40 +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 that machine type.

Partially-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-pseries-no-parallel.xml [new file with mode: 0644]
tests/qemuxml2argvtest.c

index 927e8c2e056b95a7dfb9a3beb9606a6da2e0aa18..e09d848db69eca234c9a622e54524e154f0c0a7d 100644 (file)
@@ -3298,7 +3298,7 @@ qemuDomainChrDefValidate(const virDomainChrDef *dev,
         return -1;
 
     if (dev->deviceType == VIR_DOMAIN_CHR_DEVICE_TYPE_PARALLEL &&
-        ARCH_IS_S390(def->os.arch)) {
+        (ARCH_IS_S390(def->os.arch) || qemuDomainIsPSeries(def))) {
             virReportError(VIR_ERR_CONFIG_UNSUPPORTED, "%s",
                            _("parallel ports are not supported"));
             return -1;
diff --git a/tests/qemuxml2argvdata/qemuxml2argv-pseries-no-parallel.xml b/tests/qemuxml2argvdata/qemuxml2argv-pseries-no-parallel.xml
new file mode 100644 (file)
index 0000000..d7efaa7
--- /dev/null
@@ -0,0 +1,18 @@
+<domain type='qemu'>
+  <name>QEMUGuest1</name>
+  <uuid>1ccfd97d-5eb4-478a-bbe6-88d254c16db7</uuid>
+  <memory unit='KiB'>524288</memory>
+  <vcpu placement='static'>1</vcpu>
+  <os>
+    <type arch='ppc64' machine='pseries'>hvm</type>
+  </os>
+  <clock offset='utc'/>
+  <devices>
+    <emulator>/usr/bin/qemu-system-ppc64</emulator>
+    <console type='pty'>
+      <address type="spapr-vio"/>
+    </console>
+    <parallel type='pty'/>
+    <memballoon model="none"/>
+  </devices>
+</domain>
index 2f7e4ec6f5aa9a4b363d00d22ef4f66abfe30f2b..70be0c32d05e3b0917bb7fc4f2ea2da031e69657 100644 (file)
@@ -1762,6 +1762,8 @@ mymain(void)
             QEMU_CAPS_NODEFCONFIG);
     DO_TEST("pseries-cpu-exact",
             QEMU_CAPS_NODEFCONFIG);
+    DO_TEST_PARSE_ERROR("pseries-no-parallel",
+            QEMU_CAPS_NODEFCONFIG);
 
     qemuTestSetHostArch(driver.caps, VIR_ARCH_PPC64);
     DO_TEST("pseries-cpu-compat", QEMU_CAPS_KVM,