qemu: reject parallel ports for s390 archs

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>
This commit is contained in:
Pino Toscano 2017-09-07 14:19:39 +02:00 committed by Michal Privoznik
parent 2c79a2b26c
commit 02b1908de6
3 changed files with 34 additions and 1 deletions

View File

@ -3292,11 +3292,18 @@ qemuDomainChrSourceDefValidate(const virDomainChrSourceDef *def)
static int static int
qemuDomainChrDefValidate(const virDomainChrDef *dev, qemuDomainChrDefValidate(const virDomainChrDef *dev,
const virDomainDef *def ATTRIBUTE_UNUSED) const virDomainDef *def)
{ {
if (qemuDomainChrSourceDefValidate(dev->source) < 0) if (qemuDomainChrSourceDefValidate(dev->source) < 0)
return -1; 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; return 0;
} }

View File

@ -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>

View File

@ -1952,6 +1952,10 @@ mymain(void)
QEMU_CAPS_NODEFCONFIG, QEMU_CAPS_NODEFCONFIG,
QEMU_CAPS_VIRTIO_CCW, QEMU_CAPS_VIRTIO_CCW,
QEMU_CAPS_VIRTIO_S390); 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", DO_TEST("ppc-dtb",
QEMU_CAPS_KVM, QEMU_CAPS_KVM,