diff --git a/src/qemu/qemu_hotplug.c b/src/qemu/qemu_hotplug.c index f11d75584426a5e48bf516d1132736803202f65a..649c884445dafbbb8cb7a6f6eb6f618dd4a9f355 100644 --- a/src/qemu/qemu_hotplug.c +++ b/src/qemu/qemu_hotplug.c @@ -1509,6 +1509,7 @@ qemuDomainAttachHostScsiDevice(virQEMUDriverPtr driver, { int ret = -1; qemuDomainObjPrivatePtr priv = vm->privateData; + virDomainControllerDefPtr cont = NULL; char *devstr = NULL; char *drvstr = NULL; bool teardowncgroup = false; @@ -1521,6 +1522,10 @@ qemuDomainAttachHostScsiDevice(virQEMUDriverPtr driver, return -1; } + cont = qemuDomainFindOrCreateSCSIDiskController(driver, vm, hostdev->info->addr.drive.controller); + if (!cont) + return -1; + if (qemuPrepareHostdevSCSIDevices(driver, vm->def->name, &hostdev, 1)) { virReportError(VIR_ERR_INTERNAL_ERROR,