diff options
author | Ján Tomko <jtomko@redhat.com> | 2012-12-05 11:48:07 +0100 |
---|---|---|
committer | Michal Privoznik <mprivozn@redhat.com> | 2012-12-07 11:46:48 +0100 |
commit | 1c9a2fb1aef1729ac86cd6648b5c2b7584f5f698 (patch) | |
tree | cf45b50b46f346b0cf831118b8aa3a81afaf38a3 /src/libvirt.c | |
parent | b718ded39a6f5642a5b5c42134f6b1717ae25c49 (diff) | |
download | libvirt-1c9a2fb1aef1729ac86cd6648b5c2b7584f5f698.tar.gz |
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.
Diffstat (limited to 'src/libvirt.c')
-rw-r--r-- | src/libvirt.c | 16 |
1 files changed, 13 insertions, 3 deletions
diff --git a/src/libvirt.c b/src/libvirt.c index 4b7baab188..6a7a817f51 100644 --- a/src/libvirt.c +++ b/src/libvirt.c @@ -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 |