diff --git a/src/qemu/qemu_hotplug.c b/src/qemu/qemu_hotplug.c index f2c29859f9570dea784b184047c489dcb20f5fca..d3b7b45019b5f7252acccfd57863401f408a4a6d 100644 --- a/src/qemu/qemu_hotplug.c +++ b/src/qemu/qemu_hotplug.c @@ -595,6 +595,9 @@ qemuDomainChangeEjectableMedia(virQEMUDriverPtr driver, if (qemuHotplugPrepareDiskAccess(driver, vm, disk, newsrc, false) < 0) goto cleanup; + if (qemuHotplugAttachManagedPR(driver, vm, newsrc, QEMU_ASYNC_JOB_NONE) < 0) + goto cleanup; + rc = qemuDomainChangeMediaLegacy(driver, vm, disk, newsrc, force); virDomainAuditDisk(vm, disk->src, newsrc, "update", rc >= 0); @@ -610,6 +613,9 @@ qemuDomainChangeEjectableMedia(virQEMUDriverPtr driver, virStorageSourceFree(disk->src); VIR_STEAL_PTR(disk->src, newsrc); + + ignore_value(qemuHotplugRemoveManagedPR(driver, vm, QEMU_ASYNC_JOB_NONE)); + ret = 0; cleanup: