Skip to contentSkip to conversation

qcow2: Change default for new images to compat=1.1

PATCH Superseded Kevin Wolf 4 participants 5 messages Aug 19, 2013 – Aug 27, 2013 Block layer

v1 of 2 Superseded Latest is v2 →

lore
Share & tools
lore

Kevin Wolf

author
#0 lore raw

PATCH 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 has 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 | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
block/qcow2.c +1 -1
index 3376901..42ea7ec 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) {
Signature · 1 line
1.8.1.4
Reviewed-by on v1 1/1
#1 lore raw
Quoted 1 line · Kevin Wolf

By the time that qemu 1.7 will be released, enough time will has passed

s/has/have/

Quoted 3 lines

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.

In particular, compat=1.1 images include:
* Feature bit fields which make the format more easily extensible
* Zero clusters for data cluster preallocation, discard, efficient zero block migration, or block-backup
* Lazy refcounts

Stefan

Reviewed-by on v1 1/1
#2 lore raw
In reply to Kevin Wolf
Quoted 11 lines · Kevin Wolf

By the time that qemu 1.7 will be released, enough time will has 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 | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

Libvirt is currently being patched to explicitly request older formats when needed; that should land in libvirt before qmeu 1.7, so from that point of view, I have no objection to this.

Signature · 2 lines
Eric Blake   eblake redhat com    +1-919-301-3266
Libvirt virtualization library http://libvirt.org
#3 lore raw
In reply to Kevin Wolf
Quoted 18 lines · Kevin Wolf

By the time that qemu 1.7 will be released, enough time will has 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 | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
block/qcow2.c +0 -0
index 3376901..42ea7ec 100644

block/qcow2.c static int qcow2_create(const char *filename, QEMUOptionParameter *options) · line 1408

Quoted 8 lines
block/qcow2.c +1 -1
@@ -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) {

This does not affect qemu-img (or bdrv_img_create), as it gets overwritten with 2 when BLOCK_OPT_COMPAT_LEVEL is present in options, but the value is NULL.

Should this go into qcow2_create_options[] as well?

Jan

author
#4 lore raw

Am 23.08.2013 um 13:05 hat Ján Tomko geschrieben:

Quoted 24 lines · Kevin Wolf
Quoted 23 lines

By the time that qemu 1.7 will be released, enough time will has 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 | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
block/qcow2.c +1 -1
index 3376901..42ea7ec 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;
 
Quoted 6 lines

block/qcow2.c static int qcow2_create(const char *filename, QEMUOptionParameter *options) · line 1408

Quoted 3 lines
block/qcow2.c +0 -0
     /* Read out options */
     while (options && options->name) {

This does not affect qemu-img (or bdrv_img_create), as it gets overwritten with 2 when BLOCK_OPT_COMPAT_LEVEL is present in options, but the value is NULL.

Whoops... Thanks for catching this, I'll send a v2.

Quoted 1 line

Should this go into qcow2_create_options[] as well?

Not sure what you want to change in the options array? It doesn't seem to denote a default.

Kevin