[libvirt] [PATCH 5/3] storage: always probe type with buffer
Eric Blake
eblake at redhat.com
Tue Nov 5 23:49:32 UTC 2013
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 at redhat.com>
> ---
>
>
> - 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
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 621 bytes
Desc: OpenPGP digital signature
URL: <http://listman.redhat.com/archives/libvir-list/attachments/20131105/f0d8604f/attachment-0001.sig>
More information about the libvir-list
mailing list