]> xenbits.xensource.com Git - libvirt.git/commit
qemu: blockjob: Update 'mirror' of a copy job before removing images
authorPeter Krempa <pkrempa@redhat.com>
Fri, 27 Sep 2024 06:57:08 +0000 (08:57 +0200)
committerPeter Krempa <pkrempa@redhat.com>
Tue, 1 Oct 2024 10:54:40 +0000 (12:54 +0200)
commitb85b60d140df3ea893d75e4759426cceda22e0c4
treeb1eb883ae2404546571f606f3d2858a60a786f90
parentfc4d0e746182774f1774f15c653bfea337de6dd5
qemu: blockjob: Update 'mirror' of a copy job before removing images

When concluding a job with a 'mirror' we first unplugged the appropriate
no-longer used images from qemu and then updated the definition.

Normally this wouldn't be a problem because for any other thread this is
done under the VM lock thus atomic. Unfortunately though, the AppArmor
security backend is using a VM XML to pass data to the helper process
and the state of the definition at that point was unsuitable to format a
valid XML thus making 'virt-aa-helper' report parsing failure.

Since we're removing the images the proper state of the VM definition
indeed should not include the mirror element any more at the point when
the images are removed.

Closes: https://gitlab.com/libvirt/libvirt/-/issues/601
Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Pavel Hrdina <phrdina@redhat.com>
src/qemu/qemu_blockjob.c