storage: allow metadata preallocation when creating qcow2 images

Add VIR_STORAGE_VOL_CREATE_PREALLOC_METADATA flag to virStorageVolCreateXML
and virStorageVolCreateXMLFrom. This flag requests metadata
preallocation when creating/cloning qcow2 images, resulting in creating
a sparse file with qcow2 metadata. It has only slightly larger disk usage
compared to new image with no allocation, but offers higher performance.
This commit is contained in:
Ján Tomko
2012-12-05 11:48:07 +01:00
committed by Michal Privoznik
parent b718ded39a
commit 1c9a2fb1ae
6 changed files with 64 additions and 27 deletions

View File

@@ -13382,11 +13382,16 @@ virStorageVolGetKey(virStorageVolPtr vol)
* virStorageVolCreateXML:
* @pool: pointer to storage pool
* @xmlDesc: description of volume to create
* @flags: extra flags; not used yet, so callers should always pass 0
* @flags: bitwise-OR of virStorageVolCreateFlags
*
* Create a storage volume within a pool based
* on an XML description. Not all pools support
* creation of volumes
* creation of volumes.
*
* Since 1.0.1 VIR_STORAGE_VOL_CREATE_PREALLOC_METADATA
* in flags can be used to get higher performance with
* qcow2 image files which don't support full preallocation,
* by creating a sparse image file with metadata.
*
* Returns the storage volume, or NULL on error
*/
@@ -13433,13 +13438,18 @@ error:
* @pool: pointer to parent pool for the new volume
* @xmlDesc: description of volume to create
* @clonevol: storage volume to use as input
* @flags: extra flags; not used yet, so callers should always pass 0
* @flags: bitwise-OR of virStorageVolCreateFlags
*
* Create a storage volume in the parent pool, using the
* 'clonevol' volume as input. Information for the new
* volume (name, perms) are passed via a typical volume
* XML description.
*
* Since 1.0.1 VIR_STORAGE_VOL_CREATE_PREALLOC_METADATA
* in flags can be used to get higher performance with
* qcow2 image files which don't support full preallocation,
* by creating a sparse image file with metadata.
*
* Returns the storage volume, or NULL on error
*/
virStorageVolPtr