
On 04/23/2014 03:19 PM, Peter Krempa wrote:
To avoid having the root of a backing chain present twice in the list we need to invert the working of virStorageFileGetMetadataRecurse.
Until now the recursive worker created a new backing chain element from the name and other information passed as arguments. This required us to pass the data of the parent in a deconstructed way and the worker created a new entry for the parent.
This patch converts this function so that it just fills in metadata about the parent and creates a backing chain element from those. This removes the duplication of the first element.
To avoid breaking the test suite, virstoragetest now calls a wrapper that creates the parent structure explicitly and pre-fills it with the test data with same function signature as previously used. --- src/conf/domain_conf.c | 5 +- src/qemu/qemu_domain.c | 12 ++- src/qemu/qemu_driver.c | 6 +- src/security/virt-aa-helper.c | 7 +- src/util/virstoragefile.c | 193 ++++++++++++++++++++++-------------------- src/util/virstoragefile.h | 7 +- tests/virstoragetest.c | 55 ++++++++++-- 7 files changed, 162 insertions(+), 123 deletions(-)
+ + if (virStorageFileGetMetadataRecurse(backingStore, + backingStore->path, + uid, gid, allow_probe, + cycle) < 0) { + /* if we fail somewhere midway, just accept the and return a
s/the // ACK -- Eric Blake eblake redhat com +1-919-301-3266 Libvirt virtualization library http://libvirt.org