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.
This commit is contained in:
John Ferlan 2017-12-08 14:03:54 -05:00
parent b61ae99b6d
commit cd8df1e6de
2 changed files with 5 additions and 8 deletions

View File

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

View File

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