diff --git a/src/qemu/qemu_hotplug.c b/src/qemu/qemu_hotplug.c index 58cb0539e15a5fc3b6f9b06588eca45c3c353b4a..965b051fd71bc019b0724b30289dc6b83d761177 100644 --- a/src/qemu/qemu_hotplug.c +++ b/src/qemu/qemu_hotplug.c @@ -2446,8 +2446,15 @@ qemuDomainAttachMediatedDevice(virQEMUDriverPtr driver, virDomainDeviceDef dev = { VIR_DOMAIN_DEVICE_HOSTDEV, { .hostdev = hostdev } }; - if (qemuDomainEnsurePCIAddress(vm, &dev, driver) < 0) - return -1; + switch (hostdev->source.subsys.u.mdev.model) { + case VIR_MDEV_MODEL_TYPE_VFIO_PCI: + if (qemuDomainEnsurePCIAddress(vm, &dev, driver) < 0) + return -1; + break; + case VIR_MDEV_MODEL_TYPE_VFIO_CCW: + case VIR_MDEV_MODEL_TYPE_LAST: + break; + } if (qemuHostdevPrepareMediatedDevices(driver, vm->def->name,