]> git.ipfire.org Git - thirdparty/libvirt.git/commit
qemuBlockJobProcessEventConcludedBackup: Notify the backup job later
authorPeter Krempa <pkrempa@redhat.com>
Thu, 13 Nov 2025 16:15:57 +0000 (17:15 +0100)
committerPeter Krempa <pkrempa@redhat.com>
Mon, 24 Nov 2025 15:40:24 +0000 (16:40 +0100)
commit8e5b0cd450dc36bd31bfc3a56c571e783558376c
tree606011224ed0bb2124ea855d4603fe8c49654c8f
parent0fe378f1b1921f65e44422a018a9115b42e4f75b
qemuBlockJobProcessEventConcludedBackup: Notify the backup job later

Move the notification to the backup job after finishing the cleanup of
the current block job the backup operation consists of.

Currently the termination of the blockjob would e.g. delete the scratch
files before they are detached from qemu.

In later patches the termination of the backup job may cause the qemu
process to be killed (if the guest OS shut down but the qemu process
was being kept alive to finish the backup) which would cause errors in
the monitor commands for dismissing the block job.

Since the NBD server still needs to be terminated first as otherwise
the scratch files can't be unplugged from qemu we need to split the
operation into two. First the NBD server is terminated, then the
current block job is finalized and then the backup job is notified.

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