]> git.ipfire.org Git - thirdparty/libvirt.git/commit
qemuMigrationDstPrecreateStorage: Fix and clarify logic
authorPeter Krempa <pkrempa@redhat.com>
Wed, 6 Dec 2023 13:47:01 +0000 (14:47 +0100)
committerPeter Krempa <pkrempa@redhat.com>
Wed, 13 Dec 2023 19:15:49 +0000 (20:15 +0100)
commit7c1244f3a564243b00e12e22003bcc5425daefa1
tree64ec68ee356e0e123a0d291d80180ce8fb16af09
parent98644869669274b6d7858a2327076c38ae9dcb9f
qemuMigrationDstPrecreateStorage: Fix and clarify logic

While it's intended that qemuMigrationDstPrecreateDisk is called with
any kind of the disk, the logic in qemuMigrationDstPrecreateStorage
which checks the existence of the image wouldn't properly handle e.g.
network backed disks, where it would attempt to use virFileExists() on
the disk's 'src->path'.

Fix the logic by first skipping disks not meant for migration, then do
the existence check only when 'disk->src' is local storage.

Since qemuMigrationDstPrecreateDisk has a debug statement there's no
need to have an extra one right before calling into it.

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
src/qemu/qemu_migration.c