On 05/22/2014 07:47 AM, Peter Krempa wrote: > When walking the backing chain we previously set the storage type to > _FILE and let the virStorageFileGetMetadataFromFDInternal update it to > the correct type later on. > > This patch moves the actual storage type determination to the place > where we parse the backing store name so that the code can later be > switched to use virStorageFileReadHeader() directly. > --- > src/storage/storage_driver.c | 11 +++++++++++ > 1 file changed, 11 insertions(+) >
> @@ -3173,6 +3174,16 @@ virStorageFileGetMetadataRecurse(virStorageSourcePtr
> src,
> ret = 0;
> goto cleanup;
> }
> +
> + /* update the type for local storage */
> + if (stat(backingStore->path, &st) == 0) {
Does this add additional stat() calls to the loop, which could be
optimized by including a struct stat in virStorageSource and reusing
that data when already obtained earlier? At any rate, cleaning that up
to minimize stat calls should be a separate patch, so this one is fine.
ACK.
--
Eric Blake eblake redhat com +1-919-301-3266
Libvirt virtualization library http://libvirt.org
signature.asc
Description: OpenPGP digital signature
-- libvir-list mailing list [email protected] https://www.redhat.com/mailman/listinfo/libvir-list
