Blob Blame History Raw
From: Cole Robinson <crobinso@redhat.com>
Date: Tue, 9 Jun 2015 11:41:39 -0400
Subject: [PATCH virt-manager] connection: catch more errors in filter_nodedevs
 (bug 1225771)

https://bugzilla.redhat.com/show_bug.cgi?id=1225771 Has an example of
libvirt failing to generate nodedev XML, so handle that too.

(cherry picked from commit 77423e7a8d2061f06f9f7d0b7a791821a134c8f7)
---
 virtManager/connection.py | 8 +++++---
 1 file changed, 5 insertions(+), 3 deletions(-)

diff --git a/virtManager/connection.py b/virtManager/connection.py
index d40ace2..3ca13cc 100644
--- a/virtManager/connection.py
+++ b/virtManager/connection.py
@@ -594,9 +594,11 @@ class vmmConnection(vmmGObject):
             try:
                 xmlobj = dev.get_xmlobj()
             except libvirt.libvirtError, e:
-                if e.get_error_code() == libvirt.VIR_ERR_NO_NODE_DEVICE:
-                    continue
-                raise
+                # Libvirt nodedev XML fetching can be busted
+                # https://bugzilla.redhat.com/show_bug.cgi?id=1225771
+                if e.get_error_code() != libvirt.VIR_ERR_NO_NODE_DEVICE:
+                    logging.debug("Error fetching nodedev XML", exc_info=True)
+                continue
 
             if devtype and xmlobj.device_type != devtype:
                 continue