|
Doc Text:
|
Cause:
When starting a virtual machine or changing security labels on files in general, libvirt records the original owner of the file in XATTRs. When restoring the label back (e.g. on domain shutdown), the XATTRs are used to recall the original owner (instead of defaulting to root:root). This also means that when a file has XATTRs set, it is in use by some domain. To avoid changing the seclabel (and cutting the qemu off), libvirt mandates the same label to be used. For instance, when two domains want to use the same disk at once (e.g. an installation medium), they have to use the same label to avoid disabling access to each other.
But, when it comes to backing chains, libvirt remembers the owner only for the topmost parent of the chain. The rest has no XATTRs set. However, when doing block commit, our security drivers ignored this fact and set XATTRs on all images they changed seclabels on. Worse, when finishing the job and restoring the labels, XATTRs were not cleared out.
Consequence:
XATTRs were set even if they shouldn't have been - resulting in libvirt thinking an image is already in use, even when it clearly was not.
Fix:
Libvirt tells security code what images are the topmost images and thus effectively suppresses remembering for images below.
Result:
Blockcommit works again. Yay!
|