]> git.ipfire.org Git - thirdparty/libvirt.git/commit
conf: earlier allocation during backing chain crawl
authorEric Blake <eblake@redhat.com>
Tue, 8 Apr 2014 21:20:36 +0000 (15:20 -0600)
committerEric Blake <eblake@redhat.com>
Wed, 9 Apr 2014 13:01:26 +0000 (07:01 -0600)
commit43f85b995b19092e802bba497cf838d35e6a88f2
tree3fb6452e2c8b0f7f5e668ffb0053ac37afb771d3
parent79f11b35c77b3c286c84312dc9737c2ccbf67ed5
conf: earlier allocation during backing chain crawl

Right now, we are allocating virStorageFileMetadata near the bottom
of the callchain, only after we have identified that we are visiting
a file (and not a network resource).  I'm hoping to eventually
support parsing the backing chain from XML, where the backing chain
crawl then validates what was parsed rather than allocating a fresh
structure.  Likewise, I'm working towards a setup where we have a
backing element even for networks.  Both of these use cases are
easier to code if the allocation is hoisted earlier.

* src/util/virstoragefile.c (virStorageFileGetMetadataInternal)
(virStorageFileGetMetadataFromFDInternal): Change signature.
(virStorageFileGetMetadataFromBuf)
(virStorageFileGetMetadataRecurse, virStorageFileGetMetadata):
Update callers.

Signed-off-by: Eric Blake <eblake@redhat.com>
src/util/virstoragefile.c