virQEMUCaps *qemuCaps)
{
g_autoptr(virJSONValue) props = NULL;
+ g_autoptr(virJSONValue) iothreadsMapping = NULL;
g_autofree char *iothread = NULL;
const char *driver = NULL;
qemuCaps)))
return NULL;
+ if (def->iothreads &&
+ !(iothreadsMapping = qemuBuildIothreadMappingProps(def->iothreads)))
+ return NULL;
+
if (def->iothread > 0)
iothread = g_strdup_printf("iothread%u", def->iothread);
"S:iothread", iothread,
"s:id", def->info.alias,
"p:num_queues", def->queues,
+ "A:iothread-vq-mapping", &iothreadsMapping,
"p:cmd_per_lun", def->cmd_per_lun,
"p:max_sectors", def->max_sectors,
"T:ioeventfd", def->ioeventfd,
*/
static int
qemuValidateCheckSCSIControllerIOThreads(const virDomainControllerDef *controller,
- const virDomainDef *def)
+ const virDomainDef *def,
+ virQEMUCaps *qemuCaps)
{
- if (!controller->iothread)
+ if (controller->iothread == 0 && !controller->iothreads)
return 0;
if (controller->info.type != VIR_DOMAIN_DEVICE_ADDRESS_TYPE_NONE &&
return -1;
}
- /* Can we find the controller iothread in the iothreadid list? */
- if (!virDomainIOThreadIDFind(def, controller->iothread)) {
+ if (controller->iothreads) {
+ if (!virQEMUCapsGet(qemuCaps, QEMU_CAPS_VIRTIO_SCSI_IOTHREAD_MAPPING)) {
+ virReportError(VIR_ERR_CONFIG_UNSUPPORTED, "%s",
+ _("IOThread mapping for virtio-scsi controllers is not available with this QEMU binary"));
+ return -1;
+ }
+
+ if (qemuDomainValidateIothreadMapping(def, controller->iothreads,
+ controller->queues) < 0)
+ return -1;
+ }
+
+ if (controller->iothread > 0 &&
+ !virDomainIOThreadIDFind(def, controller->iothread)) {
virReportError(VIR_ERR_CONFIG_UNSUPPORTED,
_("controller iothread '%1$u' not defined in iothreadid"),
controller->iothread);
static int
qemuValidateDomainDeviceDefControllerSCSI(const virDomainControllerDef *controller,
- const virDomainDef *def)
+ const virDomainDef *def,
+ virQEMUCaps *qemuCaps)
{
switch ((virDomainControllerModelSCSI) controller->model) {
case VIR_DOMAIN_CONTROLLER_MODEL_SCSI_VIRTIO_SCSI:
case VIR_DOMAIN_CONTROLLER_MODEL_SCSI_VIRTIO_TRANSITIONAL:
case VIR_DOMAIN_CONTROLLER_MODEL_SCSI_VIRTIO_NON_TRANSITIONAL:
- if (qemuValidateCheckSCSIControllerIOThreads(controller, def) < 0)
+ if (qemuValidateCheckSCSIControllerIOThreads(controller, def,
+ qemuCaps) < 0)
return -1;
break;
break;
case VIR_DOMAIN_CONTROLLER_TYPE_SCSI:
- ret = qemuValidateDomainDeviceDefControllerSCSI(controller, def);
+ ret = qemuValidateDomainDeviceDefControllerSCSI(controller, def,
+ qemuCaps);
break;
case VIR_DOMAIN_CONTROLLER_TYPE_PCI: