On 03/21/2018 12:37 PM, Kevin Wolf wrote:
What static=on really does is what we call metadata preallocation for
other block drivers. While we can still change the QMP interface, make
it more consistent by using 'preallocation' for VDI, too.

This doesn't implement any new functionality, so the only supported
preallocation modes are 'off' and 'metadata' for now.

Disagrees with:


Signed-off-by: Kevin Wolf <kw...@redhat.com>
---
  qapi/block-core.json |  7 +++----
  block/vdi.c          | 24 ++++++++++++++++++++++--
  2 files changed, 25 insertions(+), 6 deletions(-)

+# @preallocation    Preallocation mode for the new image (allowed values: off,
+#                   full; default: off)

this.


+    if (!vdi_opts->has_preallocation) {
+        vdi_opts->preallocation = PREALLOC_MODE_OFF;
+    }
+    switch (vdi_opts->preallocation) {
+    case PREALLOC_MODE_OFF:
+        image_type = VDI_TYPE_DYNAMIC;
+        break;
+    case PREALLOC_MODE_METADATA:
          image_type = VDI_TYPE_STATIC;
+        break;
+    default:
+        error_setg(errp, "Preallocation mode not supported for vdi");

but matches this. Fix your QMP documentation with s/full/metadata/ and you can have:

Reviewed-by: Eric Blake <ebl...@redhat.com>

--
Eric Blake, Principal Software Engineer
Red Hat, Inc.           +1-919-301-3266
Virtualization:  qemu.org | libvirt.org

Reply via email to