]> xenbits.xensource.com Git - libvirt.git/commit
storage: list more file types
authorEric Blake <eblake@redhat.com>
Fri, 28 Sep 2012 17:11:07 +0000 (11:11 -0600)
committerEric Blake <eblake@redhat.com>
Fri, 19 Oct 2012 23:35:09 +0000 (17:35 -0600)
commitf772b3d91fd842641a92c3816809ef671434cc84
tree352be0fcbdd9f2a2732b1f666101210642e228c8
parent7b21981cdb4f5d6c492edb2face8a8159dcc212e
storage: list more file types

When an image has no backing file, using VIR_STORAGE_FILE_AUTO
for its type is a bit confusing.  Additionally, a future patch
would like to reserve a default value for the case of no file
type specified in the XML, but different from the current use
of -1 to imply probing, since probing is not always safe.

Also, a couple of file types were missing compared to supported
code: libxl supports 'vhd', and qemu supports 'fat' for directories
passed through as a file system.

* src/util/storage_file.h (virStorageFileFormat): Add
VIR_STORAGE_FILE_NONE, VIR_STORAGE_FILE_FAT, VIR_STORAGE_FILE_VHD.
* src/util/storage_file.c (virStorageFileMatchesVersion): Match
documentation when version probing not supported.
(cowGetBackingStore, qcowXGetBackingStore, qcow1GetBackingStore)
(qcow2GetBackingStoreFormat, qedGetBackingStore)
(virStorageFileGetMetadataFromBuf)
(virStorageFileGetMetadataFromFD): Take NONE into account.
* src/conf/domain_conf.c (virDomainDiskDefForeachPath): Likewise.
* src/qemu/qemu_driver.c (qemuDomainGetBlockInfo): Likewise.
* src/conf/storage_conf.c (virStorageVolumeFormatFromString): New
function.
(poolTypeInfo): Use it.
src/conf/domain_conf.c
src/conf/storage_conf.c
src/qemu/qemu_driver.c
src/util/storage_file.c
src/util/storage_file.h