]> xenbits.xensource.com Git - libvirt.git/commit
conf: Sanitize handling of <auth> and <encryption> placement for disks
authorPeter Krempa <pkrempa@redhat.com>
Thu, 7 May 2020 12:00:28 +0000 (14:00 +0200)
committerPeter Krempa <pkrempa@redhat.com>
Tue, 12 May 2020 04:55:00 +0000 (06:55 +0200)
commit6bde2a1e20ae38d46fe020c4c9e984cf986fda6f
tree412044fe5a78998a6e19784cc77c4f3e270d59eb
parent5d72c3ce281870192a0d2ea56763c2bd7bb35f36
conf: Sanitize handling of <auth> and <encryption> placement for disks

Modern way to store <auth> and <encryption> of a <disk> is under
<source>. This was added to mirror how <backingStore> handles these and
in fact they are relevant to the source rather than to any other part of
the disk. Historically we allowed them to be directly under <disk> and
we need to keep compatibility.

This wasn't a problem until introduction of -blockdev in qemu using of
<auth> or <encryption> plainly wouldn't work with backing chains.

Now that it works in backing chains and can be moved back and forth
using snapshots/block-commit we need to ensure that the original
placement is properly kept even if the source changes.

To achieve the above semantics we need to store the preferred placement
with the disk definition rather than the storage source definitions and
also ensure that the modern way is chosen when the VM started with
<source/encryption> only in the backing store.

https://bugzilla.redhat.com/show_bug.cgi?id=1822878

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
src/conf/backup_conf.c
src/conf/domain_conf.c
src/conf/domain_conf.h
src/conf/snapshot_conf.c
src/qemu/qemu_domain.c
src/util/virstoragefile.c
src/util/virstoragefile.h
tests/qemublocktest.c
tests/virstoragetest.c