mirror of
https://gitlab.com/libvirt/libvirt.git
synced 2025-02-02 01:45:17 +00:00
qemu: Skip pre-creation of NVMe disks
Upon migration with disks, libvirt determines if each disk exists on the destination and tries to pre-create missing ones. Well, NVMe disks can't be pre-created, but they can be checked for presence. Resolves: https://bugzilla.redhat.com/show_bug.cgi?id=1823639 Signed-off-by: Michal Privoznik <mprivozn@redhat.com> Reviewed-by: Ján Tomko <jtomko@redhat.com>
This commit is contained in:
parent
146b3ed2bc
commit
a5a297f387
@ -315,6 +315,7 @@ qemuMigrationDstPrecreateStorage(virDomainObjPtr vm,
|
|||||||
for (i = 0; i < nbd->ndisks; i++) {
|
for (i = 0; i < nbd->ndisks; i++) {
|
||||||
virDomainDiskDefPtr disk;
|
virDomainDiskDefPtr disk;
|
||||||
const char *diskSrcPath;
|
const char *diskSrcPath;
|
||||||
|
g_autofree char *nvmePath = NULL;
|
||||||
|
|
||||||
VIR_DEBUG("Looking up disk target '%s' (capacity=%llu)",
|
VIR_DEBUG("Looking up disk target '%s' (capacity=%llu)",
|
||||||
nbd->disks[i].target, nbd->disks[i].capacity);
|
nbd->disks[i].target, nbd->disks[i].capacity);
|
||||||
@ -326,7 +327,12 @@ qemuMigrationDstPrecreateStorage(virDomainObjPtr vm,
|
|||||||
goto cleanup;
|
goto cleanup;
|
||||||
}
|
}
|
||||||
|
|
||||||
diskSrcPath = virDomainDiskGetSource(disk);
|
if (disk->src->type == VIR_STORAGE_TYPE_NVME) {
|
||||||
|
virPCIDeviceAddressGetSysfsFile(&disk->src->nvme->pciAddr, &nvmePath);
|
||||||
|
diskSrcPath = nvmePath;
|
||||||
|
} else {
|
||||||
|
diskSrcPath = virDomainDiskGetSource(disk);
|
||||||
|
}
|
||||||
|
|
||||||
/* Skip disks we don't want to migrate and already existing disks. */
|
/* Skip disks we don't want to migrate and already existing disks. */
|
||||||
if (!qemuMigrationAnyCopyDisk(disk, nmigrate_disks, migrate_disks) ||
|
if (!qemuMigrationAnyCopyDisk(disk, nmigrate_disks, migrate_disks) ||
|
||||||
|
Loading…
x
Reference in New Issue
Block a user