Nir Soffer has uploaded a new change for review.

Change subject: qemuimg: Make QCOW2_COMPAT configurable
......................................................................

qemuimg: Make QCOW2_COMPAT configurable

It's worth to make QCOW2 compatibility version configurable. It would
allow to early adopt compat=1.1 in el7 environments.

Change-Id: I5272171a4b4931698911ab251e3a34c286908be4
Bug-Url: https://bugzilla.redhat.com/1317850
Signed-off-by: Pavel Gashev <[email protected]>
---
M lib/vdsm/config.py.in
M lib/vdsm/qemuimg.py
2 files changed, 10 insertions(+), 8 deletions(-)


  git pull ssh://gerrit.ovirt.org:29418/vdsm refs/changes/59/54759/1

diff --git a/lib/vdsm/config.py.in b/lib/vdsm/config.py.in
index 96b0351..c255c37 100644
--- a/lib/vdsm/config.py.in
+++ b/lib/vdsm/config.py.in
@@ -234,6 +234,13 @@
         ('migration_create_timeout', '600',
             'Time in seconds defining how long we are going to wait for '
             'create migration response.'),
+
+        ('qcow2_compat', '0.10',
+            'Recent qemu-img supports two incompatible qcow2 versions. '
+            'We use 0.10 format by default so hosts with older qemu '
+            'can consume images created by newer versions. '
+            'See https://bugzilla.redhat.com/1139707'),
+
     ]),
 
     # Section: [rpc]
diff --git a/lib/vdsm/qemuimg.py b/lib/vdsm/qemuimg.py
index 4a75428..2ff294a 100644
--- a/lib/vdsm/qemuimg.py
+++ b/lib/vdsm/qemuimg.py
@@ -30,6 +30,7 @@
 from . import utils
 from . import cmdutils
 from . import commands
+from . config import config
 
 _qemuimg = utils.CommandPath("qemu-img",
                              "/usr/bin/qemu-img",)  # Fedora, EL6
@@ -43,12 +44,6 @@
     QED = "qed"
     RAW = "raw"
     VMDK = "vmdk"
-
-
-# Recent qemu-img supports two incompatible qcow2 versions. We use 0.10 format
-# so hosts with older qemu can consume images created by newer versions.
-# See https://bugzilla.redhat.com/1139707
-QCOW2_COMPAT = '0.10'
 
 __iregex = {
     'format': re.compile("^file format: (?P<value>\w+)$"),
@@ -129,7 +124,7 @@
     if format:
         cmd.extend(("-f", format))
         if format == FORMAT.QCOW2 and _supports_qcow2_compat('create'):
-            cmd.extend(('-o', 'compat=' + QCOW2_COMPAT))
+            cmd.extend(('-o', 'compat=' + config.get('vars', 'qcow2_compat')))
 
     if backing:
         if not os.path.isabs(backing):
@@ -194,7 +189,7 @@
     if dstFormat:
         cmd.extend(("-O", dstFormat))
         if dstFormat == FORMAT.QCOW2 and _supports_qcow2_compat('convert'):
-            options.append('compat=' + QCOW2_COMPAT)
+            options.append('compat=' + config.get('vars', 'qcow2_compat'))
 
     if backing:
         if not os.path.isabs(backing):


-- 
To view, visit https://gerrit.ovirt.org/54759
To unsubscribe, visit https://gerrit.ovirt.org/settings

Gerrit-MessageType: newchange
Gerrit-Change-Id: I5272171a4b4931698911ab251e3a34c286908be4
Gerrit-PatchSet: 1
Gerrit-Project: vdsm
Gerrit-Branch: master
Gerrit-Owner: Nir Soffer <[email protected]>
_______________________________________________
vdsm-patches mailing list
[email protected]
https://lists.fedorahosted.org/mailman/listinfo/vdsm-patches

Reply via email to