Federico Simoncelli has uploaded a new change for review. Change subject: qemuimg: support relative backing file in create ......................................................................
qemuimg: support relative backing file in create Change-Id: I5321ca35edd25c5f4972b0ef151ede55907be7b7 Signed-off-by: Federico Simoncelli <[email protected]> --- M lib/vdsm/qemuimg.py 1 file changed, 5 insertions(+), 1 deletion(-) git pull ssh://gerrit.ovirt.org:29418/vdsm refs/changes/70/26870/1 diff --git a/lib/vdsm/qemuimg.py b/lib/vdsm/qemuimg.py index f7277a7..f0f2b35 100644 --- a/lib/vdsm/qemuimg.py +++ b/lib/vdsm/qemuimg.py @@ -18,6 +18,7 @@ # Refer to the README and COPYING files for full details of the license # +import os import re from . import utils @@ -90,11 +91,14 @@ def create(image, size=None, format=None, backing=None, backingFormat=None): cmd = [_qemuimg.cmd, "create"] + cwdPath = None if format: cmd.extend(("-f", format)) if backing: + if not os.path.isabs(backing): + cwdPath = os.path.dirname(image) cmd.extend(("-b", backing)) if backingFormat: @@ -105,7 +109,7 @@ if size: cmd.append(str(size)) - rc, out, err = utils.execCmd(cmd, deathSignal=signal.SIGKILL) + rc, out, err = utils.execCmd(cmd, cwd=cwdPath, deathSignal=signal.SIGKILL) if rc != 0: raise QImgError(rc, out, err) -- To view, visit http://gerrit.ovirt.org/26870 To unsubscribe, visit http://gerrit.ovirt.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I5321ca35edd25c5f4972b0ef151ede55907be7b7 Gerrit-PatchSet: 1 Gerrit-Project: vdsm Gerrit-Branch: master Gerrit-Owner: Federico Simoncelli <[email protected]> _______________________________________________ vdsm-patches mailing list [email protected] https://lists.fedorahosted.org/mailman/listinfo/vdsm-patches
