virt-manager/530cfa5e-close-connection-on-tick-failure-fix.patch
Charles Arnold 674941bbf7 - Upstream bug fixes
53022930-lxc-connection-fix.patch
  530229cb-non-x86-kvm-creation-fix.patch
  53023f56-dont-alter-caps-machine-list-on-create.patch
  53030858-generate_target-fix.patch
  53037798-not-customizing-generate_target-fix.patch
  53047532-dont-get-duplicated-disks.patch
  53047595-calculate-disk-bus-properly.patch
  530987c4-disk-bus-calculation-fix.patch
  530c021c-attempt-empty-path-on-virDomainBlockStats.patch
  530cd6ab-log-broken-xml.patch
  530cf4de-allow-numbered-object-names.patch
  530cfa5e-close-connection-on-tick-failure-fix.patch

OBS-URL: https://build.opensuse.org/package/show/Virtualization/virt-manager?expand=0&rev=146
2014-02-28 14:58:33 +00:00

66 lines
2.4 KiB
Diff

Subject: engine: Fix closing connection when tick() fails (bz 1069351)
From: Cole Robinson crobinso@redhat.com Tue Feb 25 15:17:34 2014 -0500
Date: Tue Feb 25 15:17:34 2014 -0500:
Git: ce64d037bff56db994fedd065a9a34b8e827dda2
diff --git a/virtManager/engine.py b/virtManager/engine.py
index cef3d20..0e5e15d 100644
--- a/virtManager/engine.py
+++ b/virtManager/engine.py
@@ -344,30 +344,39 @@ class vmmEngine(vmmGObject):
return 1
def _tick_single_conn(self, conn, kwargs):
+ e = None
try:
conn.tick(**kwargs)
except KeyboardInterrupt:
raise
- except libvirt.libvirtError, e:
- from_remote = getattr(libvirt, "VIR_FROM_REMOTE", None)
- from_rpc = getattr(libvirt, "VIR_FROM_RPC", None)
- sys_error = getattr(libvirt, "VIR_ERR_SYSTEM_ERROR", None)
+ except Exception, e:
+ pass
+
+ if e is None:
+ return
+ from_remote = getattr(libvirt, "VIR_FROM_REMOTE", None)
+ from_rpc = getattr(libvirt, "VIR_FROM_RPC", None)
+ sys_error = getattr(libvirt, "VIR_ERR_SYSTEM_ERROR", None)
+
+ dom = -1
+ code = -1
+ if isinstance(e, libvirt.libvirtError):
dom = e.get_error_domain()
code = e.get_error_code()
- if (dom in [from_remote, from_rpc] and
- code in [sys_error]):
- logging.exception("Could not refresh connection %s",
- conn.get_uri())
- logging.debug("Closing connection since libvirtd "
- "appears to have stopped")
- else:
- error_msg = _("Error polling connection '%s': %s") \
- % (conn.get_uri(), e)
- self.idle_add(lambda: self.err.show_err(error_msg))
+ if (dom in [from_remote, from_rpc] and
+ code in [sys_error]):
+ logging.exception("Could not refresh connection %s",
+ conn.get_uri())
+ logging.debug("Closing connection since libvirtd "
+ "appears to have stopped")
+ else:
+ 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)
+ self.idle_add(conn.close)
def increment_window_counter(self, src):