[virt-tools-list] [PATCH 3/3] Fix a segfault when the connection is dropped

Giuseppe Scrivano gscrivano at gnu.org
Mon Mar 11 08:21:48 UTC 2013


The error dialog window was created on the "tick" thread, causing a
crash in GTK.  Fix it by moving its invocation to the main thread.
---
 src/virtManager/engine.py |    6 ++++--
 todo.txt                  |    1 -
 2 files changed, 4 insertions(+), 3 deletions(-)

diff --git a/src/virtManager/engine.py b/src/virtManager/engine.py
index cbed3dd..70912bd 100644
--- a/src/virtManager/engine.py
+++ b/src/virtManager/engine.py
@@ -255,6 +255,7 @@ class vmmEngine(vmmGObject):
 
     def tick(self):
         if not self.config.support_threading:
+
             return self._tick()
 
         if self._tick_thread and self._tick_thread.isAlive():
@@ -290,8 +291,9 @@ class vmmEngine(vmmGObject):
                     logging.debug("Closing connection since libvirtd "
                                   "appears to have stopped")
                 else:
-                    self.err.show_err(_("Error polling connection '%s': %s") %
-                                      (conn.get_uri(), e))
+                    error_msg = _("Error polling connection '%s': %s") \
+                        % (conn.get_uri(), e)
+                    self.idle_add(lambda: self.err.show_err(error_msg))
 
                 self.idle_add(conn.close)
 
diff --git a/todo.txt b/todo.txt
index 9f0e37d..e377bc9 100644
--- a/todo.txt
+++ b/todo.txt
@@ -26,7 +26,6 @@ website: wiki-ify the whole thing, drop static content, move site styling into v
   Misc issues
   ===========
 
-If libvirt connection is dropped, app segfaults
 segfault if open test:///default, then try and open testdriver that libvirt can't parse XML
 
 
-- 
1.7.10.4




More information about the virt-tools-list mailing list