]> git.ipfire.org Git - thirdparty/libvirt.git/commit
qemuSnapshotRevertActive: Remove transient domain on failure
authorPeter Krempa <pkrempa@redhat.com>
Thu, 15 May 2025 06:21:49 +0000 (08:21 +0200)
committerPeter Krempa <pkrempa@redhat.com>
Fri, 16 May 2025 12:48:20 +0000 (14:48 +0200)
commit542f1378bfa6ef08b1aa7d1075ee24e5fb6854a4
treefd7075042b368c110eb1e2884450f08bfc664339
parentf06805a97921faa2085cb1a218cb887182e38232
qemuSnapshotRevertActive: Remove transient domain on failure

Code paths which deal with stopping of the qemu process need extra
handling for transient definitions as they need to be removed from the
domain list when we'd be leaving them inactive.

In case of snapshot code it's on failure to revert a snapshot as we stop
the qemu process but the failure to revert may mean that the new process
will not be started.

I've observed this when I was fixing the recent bug in snapshot
reversion which left the domain in unusable state after failure to
revert:

 $ virsh list foo
 error: Requested operation is not valid: domain is not running

 $ virsh undefine foo
 error: Requested operation is not valid: cannot undefine transient domain

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
src/qemu/qemu_snapshot.c