]> git.ipfire.org Git - thirdparty/libvirt.git/commit
qemu_snapshot: use virDomainDiskByName while updating domain def
authorPavel Hrdina <phrdina@redhat.com>
Mon, 6 Mar 2023 14:23:57 +0000 (15:23 +0100)
committerPavel Hrdina <phrdina@redhat.com>
Tue, 22 Aug 2023 14:06:10 +0000 (16:06 +0200)
commitdb9e253fc4fcd7a309030a524a2b90e3e0b76a5e
tree10f67b10f1af64cf1a82377008fcbef6097da67d
parent4edd9e297a98f6fc4c35a6c563bcd98938bc9470
qemu_snapshot: use virDomainDiskByName while updating domain def

When creating external snapshot this function is called only when the VM
is not running so there is only one definition to care about. However,
it will be used by external snapshot revert code for active and inactive
definition and they may be different if a disk was (un)plugged only for
the active or inactive definition.

The current code would crash so use virDomainDiskByName() to get the
correct disk from the domain definition based on the disk name and make
sure it exists.

Signed-off-by: Pavel Hrdina <phrdina@redhat.com>
Reviewed-by: Peter Krempa <pkrempa@redhat.com>
src/qemu/qemu_snapshot.c