]> git.ipfire.org Git - thirdparty/libvirt.git/commit
virDomainDiskDefValidateSourceChainOne: Fix validation of 'data-file' nesting
authorPeter Krempa <pkrempa@redhat.com>
Fri, 28 Mar 2025 07:26:17 +0000 (08:26 +0100)
committerPeter Krempa <pkrempa@redhat.com>
Tue, 1 Apr 2025 14:16:05 +0000 (16:16 +0200)
commit93ecaec8454c9b8dade232f19641730000d91107
tree315991d55ff182fa9b80e1bb6eaf1053d3fbdc00
parent7d4de62cfa8c684b2d63a48c71f0ae009acddf62
virDomainDiskDefValidateSourceChainOne: Fix validation of 'data-file' nesting

As the 'dataStore' is internally represented as a virStorageSource
object it has provisions for nesting which is not supported.

When I've reviewed and modified the commit adding data file parsing
support I've added code that was supposed to reject any 'backingStore'
and 'dataStore' structures nested in a source of a 'dataStore'.

Unfortunately the check was broken as one of the terms checked the
presence of parent's 'backingStore' instead of the nesting.

Fix it and add tests.

Fixes: b3171cf8da3
Resolves: https://issues.redhat.com/browse/RHEL-85320
Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Jiri Denemark <jdenemar@redhat.com>
src/conf/domain_validate.c
tests/qemuxmlconfdata/disk-qcow2-datafile-store.x86_64-latest.args
tests/qemuxmlconfdata/disk-qcow2-datafile-store.x86_64-latest.xml
tests/qemuxmlconfdata/disk-qcow2-datafile-store.xml