]> xenbits.xensource.com Git - libvirt.git/commit
storage: always probe type with buffer
authorEric Blake <eblake@redhat.com>
Tue, 5 Nov 2013 21:12:02 +0000 (14:12 -0700)
committerEric Blake <eblake@redhat.com>
Thu, 7 Nov 2013 00:31:51 +0000 (17:31 -0700)
commit348b4e254bea98c83107887c0cf64c6572063d64
tree80b6bb4437d65d0ee820355f4c43b787afa8460e
parent3ead2e7dedab7d9380496798ef0201be2b0047b5
storage: always probe type with buffer

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@redhat.com>
src/libvirt_private.syms
src/storage/storage_backend_fs.c
src/util/virstoragefile.c
src/util/virstoragefile.h