From cf4acafe8b03595163e0e06f1e906f9a46d852fd Mon Sep 17 00:00:00 2001 From: Pino Toscano Date: Thu, 7 Sep 2017 14:19:40 +0200 Subject: [PATCH] qemu: reject parallel ports for pseries machines 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 --- 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 927e8c2e05..e09d848db6 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 0000000000..d7efaa72f2 --- /dev/null +++ b/tests/qemuxml2argvdata/qemuxml2argv-pseries-no-parallel.xml @@ -0,0 +1,18 @@ + + QEMUGuest1 + 1ccfd97d-5eb4-478a-bbe6-88d254c16db7 + 524288 + 1 + + hvm + + + + /usr/bin/qemu-system-ppc64 + +
+ + + + + diff --git a/tests/qemuxml2argvtest.c b/tests/qemuxml2argvtest.c index 2f7e4ec6f5..70be0c32d0 100644 --- a/tests/qemuxml2argvtest.c +++ b/tests/qemuxml2argvtest.c @@ -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,