[PATCH 5/5] qemu: reject parallel ports for pseries machines

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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@xxxxxxxxxx>
---
 src/qemu/qemu_domain.c                                 |  2 +-
 .../qemuxml2argv-pseries-no-parallel.xml               | 18 ++++++++++++++++++
 tests/qemuxml2argvtest.c                               |  2 ++
 3 files changed, 21 insertions(+), 1 deletion(-)
 create mode 100644 tests/qemuxml2argvdata/qemuxml2argv-pseries-no-parallel.xml

diff --git a/src/qemu/qemu_domain.c b/src/qemu/qemu_domain.c
index 6f1b453b2..799d89865 100644
--- a/src/qemu/qemu_domain.c
+++ b/src/qemu/qemu_domain.c
@@ -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
index 000000000..d7efaa72f
--- /dev/null
+++ b/tests/qemuxml2argvdata/qemuxml2argv-pseries-no-parallel.xml
@@ -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>
diff --git a/tests/qemuxml2argvtest.c b/tests/qemuxml2argvtest.c
index e9748bf1a..345745841 100644
--- a/tests/qemuxml2argvtest.c
+++ b/tests/qemuxml2argvtest.c
@@ -1757,6 +1757,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,
-- 
2.13.5

--
libvir-list mailing list
libvir-list@xxxxxxxxxx
https://www.redhat.com/mailman/listinfo/libvir-list



[Index of Archives]     [Virt Tools]     [Libvirt Users]     [Lib OS Info]     [Fedora Users]     [Fedora Desktop]     [Fedora SELinux]     [Big List of Linux Books]     [Yosemite News]     [KDE Users]     [Fedora Tools]
  Powered by Linux