9ae3a8
From ddb1e6862dffe40bb2929d3a0e3eba198c54ee43 Mon Sep 17 00:00:00 2001
9ae3a8
From: Max Reitz <mreitz@redhat.com>
9ae3a8
Date: Mon, 10 Nov 2014 09:14:07 +0100
9ae3a8
Subject: [PATCH 30/41] qcow2: Add falloc and full preallocation option
9ae3a8
9ae3a8
Message-id: <1415610847-15383-5-git-send-email-mreitz@redhat.com>
9ae3a8
Patchwork-id: 62240
9ae3a8
O-Subject: [RHEL-7.1 qemu-kvm PATCH v2 4/4] qcow2: Add falloc and full preallocation option
9ae3a8
Bugzilla: 1087724
9ae3a8
RH-Acked-by: Laszlo Ersek <lersek@redhat.com>
9ae3a8
RH-Acked-by: Fam Zheng <famz@redhat.com>
9ae3a8
RH-Acked-by: Stefan Hajnoczi <stefanha@redhat.com>
9ae3a8
9ae3a8
From: Hu Tao <hutao@cn.fujitsu.com>
9ae3a8
9ae3a8
preallocation=falloc allocates disk space by posix_fallocate(),
9ae3a8
preallocation=full allocates disk space by writing zeros to disk.
9ae3a8
Both modes imply preallocation=metadata.
9ae3a8
9ae3a8
Signed-off-by: Hu Tao <hutao@cn.fujitsu.com>
9ae3a8
Reviewed-by: Max Reitz <mreitz@redhat.com>
9ae3a8
Signed-off-by: Kevin Wolf <kwolf@redhat.com>
9ae3a8
(cherry picked from commit 0e4271b711a8ea766d29824c844e268b91ac3ae5)
9ae3a8
Signed-off-by: Miroslav Rezanina <mrezanin@redhat.com>
9ae3a8
9ae3a8
Conflicts:
9ae3a8
	block/qcow2.c
9ae3a8
9ae3a8
QEMUOptionParameter has not been replaced with QemuOpts downstream,
9ae3a8
total_size is in sectors instead of bytes in downstream's
9ae3a8
qcow2_create2().
9ae3a8
9ae3a8
The use of QEMUOptionParameter makes it rather difficult to set an
9ae3a8
option in qcow2 for the underlying file to be created. Because qcow2
9ae3a8
already used to pass a functionally empty options array, I added an
9ae3a8
assertion for this to be true and created a new QEMUOptionParameter
9ae3a8
array in case there are actually options to be passed to the protocol
9ae3a8
driver (that is, for preallocation).
9ae3a8
9ae3a8
Signed-off-by: Max Reitz <mreitz@redhat.com>
9ae3a8
---
9ae3a8
 block/qcow2.c              | 81 +++++++++++++++++++++++++++++++++++++++-------
9ae3a8
 qemu-doc.texi              |  8 +++--
9ae3a8
 qemu-img.texi              |  8 +++--
9ae3a8
 tests/qemu-iotests/082.out | 54 +++++++++++++++----------------
9ae3a8
 4 files changed, 106 insertions(+), 45 deletions(-)
9ae3a8
9ae3a8
diff --git a/block/qcow2.c b/block/qcow2.c
9ae3a8
index 99c6b93..43e54d6 100644
9ae3a8
--- a/block/qcow2.c
9ae3a8
+++ b/block/qcow2.c
9ae3a8
@@ -1557,8 +1557,7 @@ static int preallocate(BlockDriverState *bs)
9ae3a8
 static int qcow2_create2(const char *filename, int64_t total_size,
9ae3a8
                          const char *backing_file, const char *backing_format,
9ae3a8
                          int flags, size_t cluster_size, PreallocMode prealloc,
9ae3a8
-                         QEMUOptionParameter *options, int version,
9ae3a8
-                         Error **errp)
9ae3a8
+                         int version, Error **errp)
9ae3a8
 {
9ae3a8
     /* Calculate cluster_bits */
9ae3a8
     int cluster_bits;
9ae3a8
@@ -1588,8 +1587,71 @@ static int qcow2_create2(const char *filename, int64_t total_size,
9ae3a8
     uint64_t* refcount_table;
9ae3a8
     Error *local_err = NULL;
9ae3a8
     int ret;
9ae3a8
+    QEMUOptionParameter *options = NULL;
9ae3a8
+    BlockDriver *file_drv;
9ae3a8
+
9ae3a8
+    if (prealloc == PREALLOC_MODE_FULL || prealloc == PREALLOC_MODE_FALLOC) {
9ae3a8
+        int64_t meta_size = 0;
9ae3a8
+        uint64_t nreftablee, nrefblocke, nl1e, nl2e;
9ae3a8
+        int64_t aligned_total_size = align_offset(total_size * BDRV_SECTOR_SIZE,
9ae3a8
+                                                  cluster_size);
9ae3a8
+
9ae3a8
+        /* header: 1 cluster */
9ae3a8
+        meta_size += cluster_size;
9ae3a8
+
9ae3a8
+        /* total size of L2 tables */
9ae3a8
+        nl2e = aligned_total_size / cluster_size;
9ae3a8
+        nl2e = align_offset(nl2e, cluster_size / sizeof(uint64_t));
9ae3a8
+        meta_size += nl2e * sizeof(uint64_t);
9ae3a8
+
9ae3a8
+        /* total size of L1 tables */
9ae3a8
+        nl1e = nl2e * sizeof(uint64_t) / cluster_size;
9ae3a8
+        nl1e = align_offset(nl1e, cluster_size / sizeof(uint64_t));
9ae3a8
+        meta_size += nl1e * sizeof(uint64_t);
9ae3a8
+
9ae3a8
+        /* total size of refcount blocks
9ae3a8
+         *
9ae3a8
+         * note: every host cluster is reference-counted, including metadata
9ae3a8
+         * (even refcount blocks are recursively included).
9ae3a8
+         * Let:
9ae3a8
+         *   a = total_size * BDRV_SECTOR_SIZE (this is the guest disk size)
9ae3a8
+         *   m = meta size not including refcount blocks and refcount tables
9ae3a8
+         *   c = cluster size
9ae3a8
+         *   y1 = number of refcount blocks entries
9ae3a8
+         *   y2 = meta size including everything
9ae3a8
+         * then,
9ae3a8
+         *   y1 = (y2 + a)/c
9ae3a8
+         *   y2 = y1 * sizeof(u16) + y1 * sizeof(u16) * sizeof(u64) / c + m
9ae3a8
+         * we can get y1:
9ae3a8
+         *   y1 = (a + m) / (c - sizeof(u16) - sizeof(u16) * sizeof(u64) / c)
9ae3a8
+         */
9ae3a8
+        nrefblocke = (aligned_total_size + meta_size + cluster_size) /
9ae3a8
+            (cluster_size - sizeof(uint16_t) -
9ae3a8
+             1.0 * sizeof(uint16_t) * sizeof(uint64_t) / cluster_size);
9ae3a8
+        nrefblocke = align_offset(nrefblocke, cluster_size / sizeof(uint16_t));
9ae3a8
+        meta_size += nrefblocke * sizeof(uint16_t);
9ae3a8
+
9ae3a8
+        /* total size of refcount tables */
9ae3a8
+        nreftablee = nrefblocke * sizeof(uint16_t) / cluster_size;
9ae3a8
+        nreftablee = align_offset(nreftablee, cluster_size / sizeof(uint64_t));
9ae3a8
+        meta_size += nreftablee * sizeof(uint64_t);
9ae3a8
+
9ae3a8
+        file_drv = bdrv_find_protocol(filename, true);
9ae3a8
+        if (file_drv == NULL) {
9ae3a8
+            error_setg(errp, "Could not find protocol for file '%s'", filename);
9ae3a8
+            return -ENOENT;
9ae3a8
+        }
9ae3a8
+
9ae3a8
+        options = append_option_parameters(options, file_drv->create_options);
9ae3a8
+
9ae3a8
+        set_option_parameter_int(options, BLOCK_OPT_SIZE,
9ae3a8
+                                 aligned_total_size + meta_size);
9ae3a8
+        set_option_parameter(options, BLOCK_OPT_PREALLOC,
9ae3a8
+                             PreallocMode_lookup[prealloc]);
9ae3a8
+    }
9ae3a8
 
9ae3a8
     ret = bdrv_create_file(filename, options, &local_err);
9ae3a8
+    free_option_parameters(options);
9ae3a8
     if (ret < 0) {
9ae3a8
         error_propagate(errp, local_err);
9ae3a8
         return ret;
9ae3a8
@@ -1691,7 +1753,7 @@ static int qcow2_create2(const char *filename, int64_t total_size,
9ae3a8
     }
9ae3a8
 
9ae3a8
     /* And if we're supposed to preallocate metadata, do that now */
9ae3a8
-    if (prealloc == PREALLOC_MODE_METADATA) {
9ae3a8
+    if (prealloc != PREALLOC_MODE_OFF) {
9ae3a8
         BDRVQcowState *s = bs->opaque;
9ae3a8
         qemu_co_mutex_lock(&s->lock);
9ae3a8
         ret = preallocate(bs);
9ae3a8
@@ -1761,13 +1823,6 @@ static int qcow2_create(const char *filename, QEMUOptionParameter *options,
9ae3a8
         options++;
9ae3a8
     }
9ae3a8
 
9ae3a8
-    if (prealloc != PREALLOC_MODE_OFF &&
9ae3a8
-        prealloc != PREALLOC_MODE_METADATA) {
9ae3a8
-        error_setg(errp, "Unsupported preallocate mode: %s",
9ae3a8
-                   PreallocMode_lookup[prealloc]);
9ae3a8
-        return -EINVAL;
9ae3a8
-    }
9ae3a8
-
9ae3a8
     if (backing_file && prealloc != PREALLOC_MODE_OFF) {
9ae3a8
         error_setg(errp, "Backing file and preallocation cannot be used at "
9ae3a8
                    "the same time");
9ae3a8
@@ -1780,8 +1835,9 @@ static int qcow2_create(const char *filename, QEMUOptionParameter *options,
9ae3a8
         return -EINVAL;
9ae3a8
     }
9ae3a8
 
9ae3a8
+    assert(!options || !options->name);
9ae3a8
     ret = qcow2_create2(filename, sectors, backing_file, backing_fmt, flags,
9ae3a8
-                        cluster_size, prealloc, options, version, &local_err);
9ae3a8
+                        cluster_size, prealloc, version, &local_err);
9ae3a8
     if (error_is_set(&local_err)) {
9ae3a8
         error_propagate(errp, local_err);
9ae3a8
     }
9ae3a8
@@ -2315,7 +2371,8 @@ static QEMUOptionParameter qcow2_create_options[] = {
9ae3a8
     {
9ae3a8
         .name = BLOCK_OPT_PREALLOC,
9ae3a8
         .type = OPT_STRING,
9ae3a8
-        .help = "Preallocation mode (allowed values: off, metadata)"
9ae3a8
+        .help = "Preallocation mode (allowed values: off, metadata, "
9ae3a8
+                "falloc, full)"
9ae3a8
     },
9ae3a8
     {
9ae3a8
         .name = BLOCK_OPT_LAZY_REFCOUNTS,
9ae3a8
diff --git a/qemu-doc.texi b/qemu-doc.texi
9ae3a8
index dc5b49e..0f7e5f8 100644
9ae3a8
--- a/qemu-doc.texi
9ae3a8
+++ b/qemu-doc.texi
9ae3a8
@@ -567,9 +567,11 @@ sizes can improve the image file size whereas larger cluster sizes generally
9ae3a8
 provide better performance.
9ae3a8
 
9ae3a8
 @item preallocation
9ae3a8
-Preallocation mode (allowed values: off, metadata). An image with preallocated
9ae3a8
-metadata is initially larger but can improve performance when the image needs
9ae3a8
-to grow.
9ae3a8
+Preallocation mode (allowed values: @code{off}, @code{metadata}, @code{falloc},
9ae3a8
+@code{full}). An image with preallocated metadata is initially larger but can
9ae3a8
+improve performance when the image needs to grow. @code{falloc} and @code{full}
9ae3a8
+preallocations are like the same options of @code{raw} format, but sets up
9ae3a8
+metadata also.
9ae3a8
 
9ae3a8
 @item lazy_refcounts
9ae3a8
 If this option is set to @code{on}, reference count updates are postponed with
9ae3a8
diff --git a/qemu-img.texi b/qemu-img.texi
9ae3a8
index 80d3261..e943856 100644
9ae3a8
--- a/qemu-img.texi
9ae3a8
+++ b/qemu-img.texi
9ae3a8
@@ -432,9 +432,11 @@ sizes can improve the image file size whereas larger cluster sizes generally
9ae3a8
 provide better performance.
9ae3a8
 
9ae3a8
 @item preallocation
9ae3a8
-Preallocation mode (allowed values: off, metadata). An image with preallocated
9ae3a8
-metadata is initially larger but can improve performance when the image needs
9ae3a8
-to grow.
9ae3a8
+Preallocation mode (allowed values: @code{off}, @code{metadata}, @code{falloc},
9ae3a8
+@code{full}). An image with preallocated metadata is initially larger but can
9ae3a8
+improve performance when the image needs to grow. @code{falloc} and @code{full}
9ae3a8
+preallocations are like the same options of @code{raw} format, but sets up
9ae3a8
+metadata also.
9ae3a8
 
9ae3a8
 @item lazy_refcounts
9ae3a8
 If this option is set to @code{on}, reference count updates are postponed with
9ae3a8
diff --git a/tests/qemu-iotests/082.out b/tests/qemu-iotests/082.out
9ae3a8
index d71610b..8abfde7 100644
9ae3a8
--- a/tests/qemu-iotests/082.out
9ae3a8
+++ b/tests/qemu-iotests/082.out
9ae3a8
@@ -64,7 +64,7 @@ backing_file     File name of a base image
9ae3a8
 backing_fmt      Image format of the base image
9ae3a8
 encryption       Encrypt the image
9ae3a8
 cluster_size     qcow2 cluster size
9ae3a8
-preallocation    Preallocation mode (allowed values: off, metadata)
9ae3a8
+preallocation    Preallocation mode (allowed values: off, metadata, falloc, full)
9ae3a8
 lazy_refcounts   Postpone refcount updates
9ae3a8
 
9ae3a8
 Testing: create -f qcow2 -o ? TEST_DIR/t.qcow2 128M
9ae3a8
@@ -75,7 +75,7 @@ backing_file     File name of a base image
9ae3a8
 backing_fmt      Image format of the base image
9ae3a8
 encryption       Encrypt the image
9ae3a8
 cluster_size     qcow2 cluster size
9ae3a8
-preallocation    Preallocation mode (allowed values: off, metadata)
9ae3a8
+preallocation    Preallocation mode (allowed values: off, metadata, falloc, full)
9ae3a8
 lazy_refcounts   Postpone refcount updates
9ae3a8
 
9ae3a8
 Testing: create -f qcow2 -o cluster_size=4k,help TEST_DIR/t.qcow2 128M
9ae3a8
@@ -86,7 +86,7 @@ backing_file     File name of a base image
9ae3a8
 backing_fmt      Image format of the base image
9ae3a8
 encryption       Encrypt the image
9ae3a8
 cluster_size     qcow2 cluster size
9ae3a8
-preallocation    Preallocation mode (allowed values: off, metadata)
9ae3a8
+preallocation    Preallocation mode (allowed values: off, metadata, falloc, full)
9ae3a8
 lazy_refcounts   Postpone refcount updates
9ae3a8
 
9ae3a8
 Testing: create -f qcow2 -o cluster_size=4k,? TEST_DIR/t.qcow2 128M
9ae3a8
@@ -97,7 +97,7 @@ backing_file     File name of a base image
9ae3a8
 backing_fmt      Image format of the base image
9ae3a8
 encryption       Encrypt the image
9ae3a8
 cluster_size     qcow2 cluster size
9ae3a8
-preallocation    Preallocation mode (allowed values: off, metadata)
9ae3a8
+preallocation    Preallocation mode (allowed values: off, metadata, falloc, full)
9ae3a8
 lazy_refcounts   Postpone refcount updates
9ae3a8
 
9ae3a8
 Testing: create -f qcow2 -o help,cluster_size=4k TEST_DIR/t.qcow2 128M
9ae3a8
@@ -108,7 +108,7 @@ backing_file     File name of a base image
9ae3a8
 backing_fmt      Image format of the base image
9ae3a8
 encryption       Encrypt the image
9ae3a8
 cluster_size     qcow2 cluster size
9ae3a8
-preallocation    Preallocation mode (allowed values: off, metadata)
9ae3a8
+preallocation    Preallocation mode (allowed values: off, metadata, falloc, full)
9ae3a8
 lazy_refcounts   Postpone refcount updates
9ae3a8
 
9ae3a8
 Testing: create -f qcow2 -o ?,cluster_size=4k TEST_DIR/t.qcow2 128M
9ae3a8
@@ -119,7 +119,7 @@ backing_file     File name of a base image
9ae3a8
 backing_fmt      Image format of the base image
9ae3a8
 encryption       Encrypt the image
9ae3a8
 cluster_size     qcow2 cluster size
9ae3a8
-preallocation    Preallocation mode (allowed values: off, metadata)
9ae3a8
+preallocation    Preallocation mode (allowed values: off, metadata, falloc, full)
9ae3a8
 lazy_refcounts   Postpone refcount updates
9ae3a8
 
9ae3a8
 Testing: create -f qcow2 -o cluster_size=4k -o help TEST_DIR/t.qcow2 128M
9ae3a8
@@ -130,7 +130,7 @@ backing_file     File name of a base image
9ae3a8
 backing_fmt      Image format of the base image
9ae3a8
 encryption       Encrypt the image
9ae3a8
 cluster_size     qcow2 cluster size
9ae3a8
-preallocation    Preallocation mode (allowed values: off, metadata)
9ae3a8
+preallocation    Preallocation mode (allowed values: off, metadata, falloc, full)
9ae3a8
 lazy_refcounts   Postpone refcount updates
9ae3a8
 
9ae3a8
 Testing: create -f qcow2 -o cluster_size=4k -o ? TEST_DIR/t.qcow2 128M
9ae3a8
@@ -141,7 +141,7 @@ backing_file     File name of a base image
9ae3a8
 backing_fmt      Image format of the base image
9ae3a8
 encryption       Encrypt the image
9ae3a8
 cluster_size     qcow2 cluster size
9ae3a8
-preallocation    Preallocation mode (allowed values: off, metadata)
9ae3a8
+preallocation    Preallocation mode (allowed values: off, metadata, falloc, full)
9ae3a8
 lazy_refcounts   Postpone refcount updates
9ae3a8
 
9ae3a8
 Testing: create -f qcow2 -o backing_file=TEST_DIR/t.qcow2,,help TEST_DIR/t.qcow2 128M
9ae3a8
@@ -167,7 +167,7 @@ backing_file     File name of a base image
9ae3a8
 backing_fmt      Image format of the base image
9ae3a8
 encryption       Encrypt the image
9ae3a8
 cluster_size     qcow2 cluster size
9ae3a8
-preallocation    Preallocation mode (allowed values: off, metadata)
9ae3a8
+preallocation    Preallocation mode (allowed values: off, metadata, falloc, full)
9ae3a8
 lazy_refcounts   Postpone refcount updates
9ae3a8
 
9ae3a8
 Testing: create -o help
9ae3a8
@@ -245,7 +245,7 @@ backing_file     File name of a base image
9ae3a8
 backing_fmt      Image format of the base image
9ae3a8
 encryption       Encrypt the image
9ae3a8
 cluster_size     qcow2 cluster size
9ae3a8
-preallocation    Preallocation mode (allowed values: off, metadata)
9ae3a8
+preallocation    Preallocation mode (allowed values: off, metadata, falloc, full)
9ae3a8
 lazy_refcounts   Postpone refcount updates
9ae3a8
 
9ae3a8
 Testing: convert -O qcow2 -o ? TEST_DIR/t.qcow2 TEST_DIR/t.qcow2.base
9ae3a8
@@ -256,7 +256,7 @@ backing_file     File name of a base image
9ae3a8
 backing_fmt      Image format of the base image
9ae3a8
 encryption       Encrypt the image
9ae3a8
 cluster_size     qcow2 cluster size
9ae3a8
-preallocation    Preallocation mode (allowed values: off, metadata)
9ae3a8
+preallocation    Preallocation mode (allowed values: off, metadata, falloc, full)
9ae3a8
 lazy_refcounts   Postpone refcount updates
9ae3a8
 
9ae3a8
 Testing: convert -O qcow2 -o cluster_size=4k,help TEST_DIR/t.qcow2 TEST_DIR/t.qcow2.base
9ae3a8
@@ -267,7 +267,7 @@ backing_file     File name of a base image
9ae3a8
 backing_fmt      Image format of the base image
9ae3a8
 encryption       Encrypt the image
9ae3a8
 cluster_size     qcow2 cluster size
9ae3a8
-preallocation    Preallocation mode (allowed values: off, metadata)
9ae3a8
+preallocation    Preallocation mode (allowed values: off, metadata, falloc, full)
9ae3a8
 lazy_refcounts   Postpone refcount updates
9ae3a8
 
9ae3a8
 Testing: convert -O qcow2 -o cluster_size=4k,? TEST_DIR/t.qcow2 TEST_DIR/t.qcow2.base
9ae3a8
@@ -278,7 +278,7 @@ backing_file     File name of a base image
9ae3a8
 backing_fmt      Image format of the base image
9ae3a8
 encryption       Encrypt the image
9ae3a8
 cluster_size     qcow2 cluster size
9ae3a8
-preallocation    Preallocation mode (allowed values: off, metadata)
9ae3a8
+preallocation    Preallocation mode (allowed values: off, metadata, falloc, full)
9ae3a8
 lazy_refcounts   Postpone refcount updates
9ae3a8
 
9ae3a8
 Testing: convert -O qcow2 -o help,cluster_size=4k TEST_DIR/t.qcow2 TEST_DIR/t.qcow2.base
9ae3a8
@@ -289,7 +289,7 @@ backing_file     File name of a base image
9ae3a8
 backing_fmt      Image format of the base image
9ae3a8
 encryption       Encrypt the image
9ae3a8
 cluster_size     qcow2 cluster size
9ae3a8
-preallocation    Preallocation mode (allowed values: off, metadata)
9ae3a8
+preallocation    Preallocation mode (allowed values: off, metadata, falloc, full)
9ae3a8
 lazy_refcounts   Postpone refcount updates
9ae3a8
 
9ae3a8
 Testing: convert -O qcow2 -o ?,cluster_size=4k TEST_DIR/t.qcow2 TEST_DIR/t.qcow2.base
9ae3a8
@@ -300,7 +300,7 @@ backing_file     File name of a base image
9ae3a8
 backing_fmt      Image format of the base image
9ae3a8
 encryption       Encrypt the image
9ae3a8
 cluster_size     qcow2 cluster size
9ae3a8
-preallocation    Preallocation mode (allowed values: off, metadata)
9ae3a8
+preallocation    Preallocation mode (allowed values: off, metadata, falloc, full)
9ae3a8
 lazy_refcounts   Postpone refcount updates
9ae3a8
 
9ae3a8
 Testing: convert -O qcow2 -o cluster_size=4k -o help TEST_DIR/t.qcow2 TEST_DIR/t.qcow2.base
9ae3a8
@@ -311,7 +311,7 @@ backing_file     File name of a base image
9ae3a8
 backing_fmt      Image format of the base image
9ae3a8
 encryption       Encrypt the image
9ae3a8
 cluster_size     qcow2 cluster size
9ae3a8
-preallocation    Preallocation mode (allowed values: off, metadata)
9ae3a8
+preallocation    Preallocation mode (allowed values: off, metadata, falloc, full)
9ae3a8
 lazy_refcounts   Postpone refcount updates
9ae3a8
 
9ae3a8
 Testing: convert -O qcow2 -o cluster_size=4k -o ? TEST_DIR/t.qcow2 TEST_DIR/t.qcow2.base
9ae3a8
@@ -322,7 +322,7 @@ backing_file     File name of a base image
9ae3a8
 backing_fmt      Image format of the base image
9ae3a8
 encryption       Encrypt the image
9ae3a8
 cluster_size     qcow2 cluster size
9ae3a8
-preallocation    Preallocation mode (allowed values: off, metadata)
9ae3a8
+preallocation    Preallocation mode (allowed values: off, metadata, falloc, full)
9ae3a8
 lazy_refcounts   Postpone refcount updates
9ae3a8
 
9ae3a8
 Testing: convert -O qcow2 -o backing_file=TEST_DIR/t.qcow2,,help TEST_DIR/t.qcow2 TEST_DIR/t.qcow2.base
9ae3a8
@@ -348,7 +348,7 @@ backing_file     File name of a base image
9ae3a8
 backing_fmt      Image format of the base image
9ae3a8
 encryption       Encrypt the image
9ae3a8
 cluster_size     qcow2 cluster size
9ae3a8
-preallocation    Preallocation mode (allowed values: off, metadata)
9ae3a8
+preallocation    Preallocation mode (allowed values: off, metadata, falloc, full)
9ae3a8
 lazy_refcounts   Postpone refcount updates
9ae3a8
 
9ae3a8
 Testing: convert -o help
9ae3a8
@@ -415,7 +415,7 @@ backing_file     File name of a base image
9ae3a8
 backing_fmt      Image format of the base image
9ae3a8
 encryption       Encrypt the image
9ae3a8
 cluster_size     qcow2 cluster size
9ae3a8
-preallocation    Preallocation mode (allowed values: off, metadata)
9ae3a8
+preallocation    Preallocation mode (allowed values: off, metadata, falloc, full)
9ae3a8
 lazy_refcounts   Postpone refcount updates
9ae3a8
 
9ae3a8
 Testing: amend -f qcow2 -o ? TEST_DIR/t.qcow2
9ae3a8
@@ -426,7 +426,7 @@ backing_file     File name of a base image
9ae3a8
 backing_fmt      Image format of the base image
9ae3a8
 encryption       Encrypt the image
9ae3a8
 cluster_size     qcow2 cluster size
9ae3a8
-preallocation    Preallocation mode (allowed values: off, metadata)
9ae3a8
+preallocation    Preallocation mode (allowed values: off, metadata, falloc, full)
9ae3a8
 lazy_refcounts   Postpone refcount updates
9ae3a8
 
9ae3a8
 Testing: amend -f qcow2 -o cluster_size=4k,help TEST_DIR/t.qcow2
9ae3a8
@@ -437,7 +437,7 @@ backing_file     File name of a base image
9ae3a8
 backing_fmt      Image format of the base image
9ae3a8
 encryption       Encrypt the image
9ae3a8
 cluster_size     qcow2 cluster size
9ae3a8
-preallocation    Preallocation mode (allowed values: off, metadata)
9ae3a8
+preallocation    Preallocation mode (allowed values: off, metadata, falloc, full)
9ae3a8
 lazy_refcounts   Postpone refcount updates
9ae3a8
 
9ae3a8
 Testing: amend -f qcow2 -o cluster_size=4k,? TEST_DIR/t.qcow2
9ae3a8
@@ -448,7 +448,7 @@ backing_file     File name of a base image
9ae3a8
 backing_fmt      Image format of the base image
9ae3a8
 encryption       Encrypt the image
9ae3a8
 cluster_size     qcow2 cluster size
9ae3a8
-preallocation    Preallocation mode (allowed values: off, metadata)
9ae3a8
+preallocation    Preallocation mode (allowed values: off, metadata, falloc, full)
9ae3a8
 lazy_refcounts   Postpone refcount updates
9ae3a8
 
9ae3a8
 Testing: amend -f qcow2 -o help,cluster_size=4k TEST_DIR/t.qcow2
9ae3a8
@@ -459,7 +459,7 @@ backing_file     File name of a base image
9ae3a8
 backing_fmt      Image format of the base image
9ae3a8
 encryption       Encrypt the image
9ae3a8
 cluster_size     qcow2 cluster size
9ae3a8
-preallocation    Preallocation mode (allowed values: off, metadata)
9ae3a8
+preallocation    Preallocation mode (allowed values: off, metadata, falloc, full)
9ae3a8
 lazy_refcounts   Postpone refcount updates
9ae3a8
 
9ae3a8
 Testing: amend -f qcow2 -o ?,cluster_size=4k TEST_DIR/t.qcow2
9ae3a8
@@ -470,7 +470,7 @@ backing_file     File name of a base image
9ae3a8
 backing_fmt      Image format of the base image
9ae3a8
 encryption       Encrypt the image
9ae3a8
 cluster_size     qcow2 cluster size
9ae3a8
-preallocation    Preallocation mode (allowed values: off, metadata)
9ae3a8
+preallocation    Preallocation mode (allowed values: off, metadata, falloc, full)
9ae3a8
 lazy_refcounts   Postpone refcount updates
9ae3a8
 
9ae3a8
 Testing: amend -f qcow2 -o cluster_size=4k -o help TEST_DIR/t.qcow2
9ae3a8
@@ -481,7 +481,7 @@ backing_file     File name of a base image
9ae3a8
 backing_fmt      Image format of the base image
9ae3a8
 encryption       Encrypt the image
9ae3a8
 cluster_size     qcow2 cluster size
9ae3a8
-preallocation    Preallocation mode (allowed values: off, metadata)
9ae3a8
+preallocation    Preallocation mode (allowed values: off, metadata, falloc, full)
9ae3a8
 lazy_refcounts   Postpone refcount updates
9ae3a8
 
9ae3a8
 Testing: amend -f qcow2 -o cluster_size=4k -o ? TEST_DIR/t.qcow2
9ae3a8
@@ -492,7 +492,7 @@ backing_file     File name of a base image
9ae3a8
 backing_fmt      Image format of the base image
9ae3a8
 encryption       Encrypt the image
9ae3a8
 cluster_size     qcow2 cluster size
9ae3a8
-preallocation    Preallocation mode (allowed values: off, metadata)
9ae3a8
+preallocation    Preallocation mode (allowed values: off, metadata, falloc, full)
9ae3a8
 lazy_refcounts   Postpone refcount updates
9ae3a8
 
9ae3a8
 Testing: amend -f qcow2 -o backing_file=TEST_DIR/t.qcow2,,help TEST_DIR/t.qcow2
9ae3a8
@@ -520,7 +520,7 @@ backing_file     File name of a base image
9ae3a8
 backing_fmt      Image format of the base image
9ae3a8
 encryption       Encrypt the image
9ae3a8
 cluster_size     qcow2 cluster size
9ae3a8
-preallocation    Preallocation mode (allowed values: off, metadata)
9ae3a8
+preallocation    Preallocation mode (allowed values: off, metadata, falloc, full)
9ae3a8
 lazy_refcounts   Postpone refcount updates
9ae3a8
 
9ae3a8
 Testing: convert -o help
9ae3a8
-- 
9ae3a8
1.8.3.1
9ae3a8