From bbfcaef1158509e39714a0ae923dc1eb6aef3383 Mon Sep 17 00:00:00 2001 From: Nikos Skalkotos Date: Thu, 1 Aug 2013 12:56:08 +0300 Subject: [PATCH] Workaraound the old behaviour of kill_subprocess Before libguestfs 1.18.4 you cannot shutdown the backend and then relaunch it --- image_creator/image.py | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/image_creator/image.py b/image_creator/image.py index 282789d..8a111a1 100644 --- a/image_creator/image.py +++ b/image_creator/image.py @@ -93,6 +93,12 @@ class Image(object): self.out.warn("Guestfs is already enabled") return + # Before version 1.18.4 the behaviour of kill_subprocess was different + # and you need to reset the guestfs handler to relaunch a previously + # shut down qemu backend + if check_guestfs_version(self.g, 1, 18, 4) < 0: + self.g = guestfs.GuestFS() + self.g.add_drive_opts(self.device, readonly=0, format="raw") # Before version 1.17.14 the recovery process, which is a fork of the @@ -119,6 +125,10 @@ class Image(object): # self.g.delete_event_callback(eh) # self.progressbar.success('done') # self.progressbar = None + + if check_guestfs_version(self.g, 1, 18, 4) < 0: + self.g.inspect_os() # some calls need this + self.out.success('done') def disable_guestfs(self): -- 1.7.10.4