[libvirt] [PATCHv2 13/16] storage: use cache to walk backing chain
Eric Blake
eblake at redhat.com
Wed Oct 17 20:32:37 UTC 2012
On 10/16/2012 03:16 PM, Eric Blake wrote:
>>> + if (disk->format > 0)
>>> + format = disk->format;
>>> + else if (ctl->allowDiskFormatProbing)
>>> + format = VIR_STORAGE_FILE_AUTO;
>>> + else
>>> + format = VIR_STORAGE_FILE_RAW;
>>
>> It seems like I've seen this same bit of code a few times now...
>>
>>> +
>>> + /* XXX - if we knew the qemu user:group here we could send it in
>>> + * so that the open could be re-tried as that user:group.
>>> + */
>>> + disk->chain = virStorageFileGetMetadata(disk->src, format, -1, -1,
>>> + ctl->allowDiskFormatProbing,
>>> + NULL);
>>> +
>
> True - I'll experiment with a followup patch that moves the format
> selection of the initial layer into virStorageFileGetMetadata; if it
> works, expect another patch to be added in v3 (and if not, we'll just
> live with the duplication).
Turns out there were exactly two callers, both introduced in this
series, so my v3 will refactor the redundant code into
virStorageFileGetMetadata.
--
Eric Blake eblake at redhat.com +1-919-301-3266
Libvirt virtualization library http://libvirt.org
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 617 bytes
Desc: OpenPGP digital signature
URL: <http://listman.redhat.com/archives/libvir-list/attachments/20121017/fda77da1/attachment-0001.sig>
More information about the libvir-list
mailing list