[libvirt] [PATCHv2] util: storage: Invert the way recursive metadata retrieval works

Peter Krempa pkrempa at redhat.com
Thu Apr 24 12:34:27 UTC 2014


On 04/24/14 14:19, Eric Blake wrote:
> 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
> 

Pushed; Thanks.

Peter

-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 901 bytes
Desc: OpenPGP digital signature
URL: <http://listman.redhat.com/archives/libvir-list/attachments/20140424/c3019604/attachment-0001.sig>


More information about the libvir-list mailing list