From: John Ferlan Date: Fri, 8 Dec 2017 19:03:54 +0000 (-0500) Subject: qemu: Add check for iothread attribute in validate controller X-Git-Tag: v4.1.0-rc1~201 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=cd8df1e6dee640dd4b35de3ba4c1d597deb06f44;p=thirdparty%2Flibvirt.git qemu: Add check for iothread attribute in validate controller Let's make sure that non SCSI virtio-scsi isn't used for any type other than a virtio-scsi controller. --- diff --git a/src/qemu/qemu_command.c b/src/qemu/qemu_command.c index 8227b9a652..8d7e4daa86 100644 --- a/src/qemu/qemu_command.c +++ b/src/qemu/qemu_command.c @@ -2598,14 +2598,6 @@ qemuCheckSCSIControllerIOThreads(const virDomainDef *domainDef, if (!def->iothread) return true; - if (def->model != VIR_DOMAIN_CONTROLLER_MODEL_SCSI_VIRTIO_SCSI) { - virReportError(VIR_ERR_CONFIG_UNSUPPORTED, - _("IOThreads only supported for virtio-scsi " - "controllers model is '%s'"), - virDomainControllerModelSCSITypeToString(def->model)); - return false; - } - if (def->info.type != VIR_DOMAIN_DEVICE_ADDRESS_TYPE_PCI && def->info.type != VIR_DOMAIN_DEVICE_ADDRESS_TYPE_CCW) { virReportError(VIR_ERR_CONFIG_UNSUPPORTED, "%s", diff --git a/src/qemu/qemu_domain.c b/src/qemu/qemu_domain.c index 152718c0d7..0a9f920319 100644 --- a/src/qemu/qemu_domain.c +++ b/src/qemu/qemu_domain.c @@ -3947,6 +3947,11 @@ qemuDomainDeviceDefValidateControllerAttributes(const virDomainControllerDef *co _("'ioeventfd' is only supported by virtio-scsi controller")); return -1; } + if (controller->iothread) { + virReportError(VIR_ERR_CONFIG_UNSUPPORTED, "%s", + _("'iothread' is only supported for virtio-scsi controller")); + return -1; + } } return 0;