Re: [PATCHv2 12/33] storage: Determine the local storage type right away

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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

Attachment: signature.asc
Description: OpenPGP digital signature

--
libvir-list mailing list
libvir-list@xxxxxxxxxx
https://www.redhat.com/mailman/listinfo/libvir-list

[Index of Archives]     [Virt Tools]     [Libvirt Users]     [Lib OS Info]     [Fedora Users]     [Fedora Desktop]     [Fedora SELinux]     [Big List of Linux Books]     [Yosemite News]     [KDE Users]     [Fedora Tools]