diff --git a/src/qemu/qemu_hotplug.c b/src/qemu/qemu_hotplug.c index 8c14540275..54b5a2c2c9 100644 --- a/src/qemu/qemu_hotplug.c +++ b/src/qemu/qemu_hotplug.c @@ -921,9 +921,6 @@ qemuDomainAttachDeviceDiskLiveInternal(virQEMUDriver *driver, if (virDomainDiskTranslateSourcePool(disk) < 0) goto cleanup; - if (qemuDomainDetermineDiskChain(driver, vm, disk, NULL) < 0) - goto cleanup; - for (i = 0; i < vm->def->ndisks; i++) { if (virDomainDiskDefCheckDuplicateInfo(vm->def->disks[i], disk) < 0) goto cleanup; @@ -1007,6 +1004,9 @@ qemuDomainAttachDeviceDiskLiveInternal(virQEMUDriver *driver, if (qemuDomainPrepareDiskSource(disk, priv, cfg) < 0) goto cleanup; + if (qemuDomainDetermineDiskChain(driver, vm, disk, NULL) < 0) + goto cleanup; + if (qemuHotplugAttachManagedPR(vm, disk->src, VIR_ASYNC_JOB_NONE) < 0) goto cleanup;