File 53b728c6-connection-handle-unsupported-KeepAlive.patch of Package virt-manager

Subject: connection: Handle unsupport KeepAlive (like test URIs)
From: Cole Robinson crobinso@redhat.com Fri Jul 4 17:43:24 2014 -0400
Date: Fri Jul 4 18:20:54 2014 -0400:
Git: aa823b5b58d689e2a69a9822fd462a1333d8d415


Index: virt-manager-1.0.1/virtManager/connection.py
===================================================================
--- virt-manager-1.0.1.orig/virtManager/connection.py
+++ virt-manager-1.0.1/virtManager/connection.py
@@ -1112,7 +1112,16 @@ class vmmConnection(vmmGObject):
                 logging.debug("%s capabilities:\n%s",
                               self.get_uri(), self.caps.xml)
                 self._add_conn_events()
-                self._backend.setKeepAlive(20, 1)
+
+                try:
+                    self._backend.setKeepAlive(20, 1)
+                except Exception, e:
+                    if (type(e) is not AttributeError and
+                        not util.is_error_nosupport(e)):
+                        raise
+                    logging.debug("Connection doesn't support KeepAlive, "
+                        "skipping")
+
                 self.schedule_priority_tick(stats_update=True,
                                             pollvm=True, pollnet=True,
                                             pollpool=True, polliface=True,
openSUSE Build Service is sponsored by