Skip to contentSkip to conversation

qcow2: Change default for new images to compat=1.1

PATCH New Kevin Wolf 1 participant 1 message Aug 27, 2013 Block layer

lore
Share & tools
lore

Kevin Wolf

author
#0 lore raw

PATCH v2 1/1 qcow2: Change default for new images to compat=1.1

By the time that qemu 1.7 will be released, enough time will have passed since qemu 1.1, which is the first version to understand version 3 images, that changing the default shouldn't hurt many people any more and the benefits of using the new format outweigh the pain.

qemu-iotests already runs with compat=1.1 by default.

---
 block/qcow2.c | 6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)
block/qcow2.c +4 -2
index 3376901..6ab3341 100644
@@ -1402,7 +1402,7 @@ static int qcow2_create(const char *filename, QEMUOptionParameter *options)
     int flags = 0;
     size_t cluster_size = DEFAULT_CLUSTER_SIZE;
     int prealloc = 0;
-    int version = 2;
+    int version = 3;
 
     /* Read out options */
     while (options && options->name) {
@@ -1429,7 +1429,9 @@ static int qcow2_create(const char *filename, QEMUOptionParameter *options)
                 return -EINVAL;
             }
         } else if (!strcmp(options->name, BLOCK_OPT_COMPAT_LEVEL)) {
-            if (!options->value.s || !strcmp(options->value.s, "0.10")) {
+            if (!options->value.s) {
+                /* keep the default */
+            } else if (!strcmp(options->value.s, "0.10")) {
                 version = 2;
             } else if (!strcmp(options->value.s, "1.1")) {
                 version = 3;
Signature · 1 line
1.8.1.4