Skip to contentSkip to conversation

xend: passthrough: report attach errors from device model

PATCH Superseded Simon Horman 1 participant 2 messages Jun 1, 2009

v1 of 2 Superseded Latest is v2 →

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 xend: passthrough: report attach errors from device model

Cc Masaki Kanno <[email protected]>
Cc Edwin Zhai <[email protected]>
tools/python/xen/xend/XendDomainInfo.py +8 -0
Index: xen-unstable.hg/tools/python/xen/xend/XendDomainInfo.py
===================================================================
@@ -755,6 +755,14 @@ class XendDomainInfo:
 
             vslot = xstransact.Read("/local/domain/0/device-model/%i/parameter"
                                     % self.getDomid())
+	    try:
+	        vslot_int = int(vslot, 16)
+	    except ValueError:
+	        raise VmError(("Cannot pass-through PCI function '%s'. " +
+		               "Device model reported an error: %s") %
+			      (bdf_str, vslot))
+            log.debug("XendDomainInfo.hvm_pci_device_insert_dev: vslot: %s"
+                      % vslot)
         else:
             vslot = new_dev['requested_vslot']
#1 lore raw

Sorry, I hit the send button a little to fast. This patch contains tabs for indentation and a spurious debugging message. Quite an achievement for such a small change.

I will repost shortly.