Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Warn if qemu-img is missing the rebase command

  • Loading branch information...
commit dca6dc9563b9455de398d4c9c86d7a65d5919049 1 parent d985c31
@priteau priteau authored
Showing with 11 additions and 0 deletions.
  1. +11 −0 control/src/python/workspacecontrol/defaults/ImageEditing.py
View
11 control/src/python/workspacecontrol/defaults/ImageEditing.py
@@ -468,6 +468,17 @@ def _commit_cow_file(self, image_local_path, cow_path):
self.c.log.info("committing copy-on-write changes of '%s' into '%s'" % (cow_path, image_local_path))
try:
+ cmd = "%s | grep rebase" % self.qemu_img_path
+ if self.c.dryrun:
+ self.c.log.debug("dryrun, command is: %s" % cmd)
+ else:
+ (ret, output) = getstatusoutput(cmd)
+ if ret:
+ errmsg = "%s is missing the rebase command required for unpropagation of copy-on-write images. " % self.qemu_img_path
+ errmsg += "QEMU 0.13 or later is needed."
+ self.c.log.error(errmsg)
+ raise UnexpectedError(errmsg)
+
cmd = "%s rebase -f qcow2 -u -b %s %s" % (self.qemu_img_path, image_local_path, cow_path)
if self.c.dryrun:
self.c.log.debug("dryrun, command is: %s" % cmd)
Please sign in to comment.
Something went wrong with that request. Please try again.