Re: [PATCH 5/3] storage: always probe type with buffer

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

 



On 11/05/2013 02:32 PM, Eric Blake wrote:
> This gets rid of another stat() per volume, as well as cutting
> bytes read in half, when populating the volumes of a directory
> pool during a pool refresh.  Not to mention that it provides an
> interface that can let gluster pools also probe file types.
> 
> * src/util/virstoragefile.h (virStorageFileProbeFormatFromFD):
> Delete.
> (virStorageFileProbeFormatFromBuf): New prototype.
> (VIR_STORAGE_MAX_HEADER): New constant, based on...
> * src/util/virstoragefile.c (STORAGE_MAX_HEAD): ...old name.
> (vmdk4GetBackingStore, virStorageFileGetMetadataInternal)
> (virStorageFileProbeFormat): Adjust clients.
> (virStorageFileProbeFormatFromFD): Delete.
> (virStorageFileProbeFormatFromBuf): Export.
> * src/storage/storage_backend_fs.c (virStorageBackendProbeTarget):
> Adjust client.
> * src/libvirt_private.syms (virstoragefile.h): Adjust exports.
> 
> Signed-off-by: Eric Blake <eblake@xxxxxxxxxx>
> ---
> 

> 
> -    virStorageFileFreeMetadata(meta);
> -
> -    return ret;
> +    goto cleanup;
> 
>  error:
>      VIR_FORCE_CLOSE(fd);
> 
>  cleanup:
>      virStorageFileFreeMetadata(meta);
> +    VIR_FREE(header);

Up to here is fine...

> +    virStorageFileFreeMetadata(meta);

...but I have no idea what I was thinking with this line of the patch :)
 I've already deleted it in my local tree, to avoid double frees.

-- 
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]