[Pkg-libvirt-commits] [SCM] VirtManager Debian packaging branch, master, updated. debian/0.8.4-4-3-g2b7fc80

Laurent Léonard laurent at open-minds.org
Thu Jul 8 10:49:02 UTC 2010


The following commit has been merged in the master branch:
commit 799f23db7d46a3003ffea1dddac88a6e23ed2aca
Author: Laurent Léonard <laurent at open-minds.org>
Date:   Thu Jul 8 12:35:34 2010 +0200

    create: Skip post-install restart if user destroys VM

diff --git a/debian/patches/0004-create-Skip-post-install-restart-if-user-destroys-VM.patch b/debian/patches/0004-create-Skip-post-install-restart-if-user-destroys-VM.patch
new file mode 100644
index 0000000..a9d3282
--- /dev/null
+++ b/debian/patches/0004-create-Skip-post-install-restart-if-user-destroys-VM.patch
@@ -0,0 +1,88 @@
+From: Cole Robinson <crobinso at redhat.com>
+Date: Thu, 13 May 2010 11:21:01 -0400
+Subject: [PATCH] create: Skip post-install restart if user destroys VM
+
+Origin: upstream, http://hg.fedorahosted.org/hg/virt-manager/rev/d8c0607c68dc
+---
+ src/virtManager/create.py |    6 ++++++
+ src/virtManager/domain.py |   12 ++++++++++++
+ 2 files changed, 18 insertions(+), 0 deletions(-)
+
+diff --git a/src/virtManager/create.py b/src/virtManager/create.py
+index e4f39eb..dbacc3a 100644
+--- a/src/virtManager/create.py
++++ b/src/virtManager/create.py
+@@ -1603,10 +1603,16 @@ class vmmCreate(gobject.GObject):
+                     # out handler, removing the virtinst_guest which
+                     # will force one final restart.
+                     virtinst_guest.continue_install()
++
+                     util.connect_opt_out(vm, "status-changed",
+                                          self.check_install_status, None)
+                     return True
+ 
++            if vm.get_install_abort():
++                logging.debug("User manually shutdown VM, not restarting "
++                              "guest after install.")
++                return True
++
+             logging.debug("Install should be completed, starting VM.")
+             vm.startup()
+         except Exception, e:
+diff --git a/src/virtManager/domain.py b/src/virtManager/domain.py
+index 7ea8cdc..2d287f6 100644
+--- a/src/virtManager/domain.py
++++ b/src/virtManager/domain.py
+@@ -75,6 +75,7 @@ class vmmDomainBase(vmmLibvirtObject):
+         self._backend = backend
+         self.uuid = uuid
+ 
++        self._install_abort = False
+         self._startup_vcpus = None
+ 
+         self._network_traffic = None
+@@ -120,6 +121,13 @@ class vmmDomainBase(vmmLibvirtObject):
+     def get_autostart(self):
+         raise NotImplementedError()
+ 
++    # If manual shutdown or destroy specified, make sure we don't continue
++    # install process
++    def set_install_abort(self, val):
++        self._install_abort = bool(val)
++    def get_install_abort(self):
++        return bool(self._install_abort)
++
+     # Device/XML altering API
+     def set_autostart(self, val):
+         raise NotImplementedError()
+@@ -1274,11 +1282,13 @@ class vmmDomain(vmmDomainBase):
+                                                     reboot_listener, self)
+ 
+     def shutdown(self):
++        self.set_install_abort(True)
+         self._unregister_reboot_listener()
+         self._backend.shutdown()
+         self._update_status()
+ 
+     def reboot(self):
++        self.set_install_abort(True)
+         self._backend.reboot(0)
+         self._update_status()
+ 
+@@ -1298,6 +1308,7 @@ class vmmDomain(vmmDomainBase):
+         self._update_status()
+ 
+     def save(self, filename, background=True):
++        self.set_install_abort(True)
+         if background:
+             conn = util.dup_conn(self.config, self.connection)
+             vm = conn.lookupByID(self.get_id())
+@@ -1308,6 +1319,7 @@ class vmmDomain(vmmDomainBase):
+         self._update_status()
+ 
+     def destroy(self):
++        self.set_install_abort(True)
+         self._unregister_reboot_listener()
+         self._backend.destroy()
+         self._update_status()
+-- 
diff --git a/debian/patches/series b/debian/patches/series
index 3bdee46..cc6cfae 100644
--- a/debian/patches/series
+++ b/debian/patches/series
@@ -1,3 +1,4 @@
 0001-use-usr-share-gconf-for-schema-data.patch
 0002-console-Don-t-throw-traceback-if-we-can-t-read-error.patch
 0003-Update-french-translation.patch
+0004-create-Skip-post-install-restart-if-user-destroys-VM.patch

-- 
VirtManager Debian packaging



More information about the Pkg-libvirt-commits mailing list