Change in vdsm[master]: qemuimg: Move private functions to end of module
nsoffer at redhat.com
nsoffer at redhat.com
Thu Sep 25 12:30:33 UTC 2014
Nir Soffer has uploaded a new change for review.
Change subject: qemuimg: Move private functions to end of module
......................................................................
qemuimg: Move private functions to end of module
_supports_qcow_compat() is a private helper and should be after public
functions.
Change-Id: I060d3bb817ee543dabaf401756a909984cca9f8e
Signed-off-by: Nir Soffer <nsoffer at redhat.com>
---
M lib/vdsm/qemuimg.py
1 file changed, 25 insertions(+), 25 deletions(-)
git pull ssh://gerrit.ovirt.org:29418/vdsm refs/changes/66/33366/1
diff --git a/lib/vdsm/qemuimg.py b/lib/vdsm/qemuimg.py
index 07c91e7..1d9632b 100644
--- a/lib/vdsm/qemuimg.py
+++ b/lib/vdsm/qemuimg.py
@@ -137,31 +137,6 @@
raise QImgError(rc, out, err)
-def _supports_qcow2_compat(command):
- """
- qemu-img "create:, "convert", and "ammend" commands support a "compat"
- option in recent versions. This will run the specified command using the
- "-o ?" option to find if "compat" option is available.
-
- Raises KeyError if called with another command.
-
- TODO: Remove this when qemu versions providing the "compat" option are
- available on all platforms.
- """
- flag = {"create": "-f", "convert": "-O", "ammend": "-f"}[command]
- cmd = [_qemuimg.cmd, command, flag, FORMAT.QCOW2, "-o", "?", "/dev/null"]
-
- rc, out, err = utils.execCmd(cmd, raw=True)
-
- if rc != 0:
- raise QImgError(rc, out, err)
-
- # Supported options:
- # compat Compatibility level (0.10 or 1.1)
-
- return '\ncompat ' in out
-
-
def check(image, format=None):
cmd = [_qemuimg.cmd, "check"]
@@ -244,3 +219,28 @@
if rc != 0:
raise QImgError(rc, out, err)
+
+
+def _supports_qcow2_compat(command):
+ """
+ qemu-img "create:, "convert", and "ammend" commands support a "compat"
+ option in recent versions. This will run the specified command using the
+ "-o ?" option to find if "compat" option is available.
+
+ Raises KeyError if called with another command.
+
+ TODO: Remove this when qemu versions providing the "compat" option are
+ available on all platforms.
+ """
+ flag = {"create": "-f", "convert": "-O", "ammend": "-f"}[command]
+ cmd = [_qemuimg.cmd, command, flag, FORMAT.QCOW2, "-o", "?", "/dev/null"]
+
+ rc, out, err = utils.execCmd(cmd, raw=True)
+
+ if rc != 0:
+ raise QImgError(rc, out, err)
+
+ # Supported options:
+ # compat Compatibility level (0.10 or 1.1)
+
+ return '\ncompat ' in out
--
To view, visit http://gerrit.ovirt.org/33366
To unsubscribe, visit http://gerrit.ovirt.org/settings
Gerrit-MessageType: newchange
Gerrit-Change-Id: I060d3bb817ee543dabaf401756a909984cca9f8e
Gerrit-PatchSet: 1
Gerrit-Project: vdsm
Gerrit-Branch: master
Gerrit-Owner: Nir Soffer <nsoffer at redhat.com>
More information about the vdsm-patches
mailing list