Skip to contentSkip to conversation

xend: passthrough: report attach errors from device model

PATCH New Simon Horman 1 participant 1 message Jun 1, 2009

lore
Share & tools
lore
#0 lore raw

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

Cc Masaki Kanno <[email protected]>
Cc Edwin Zhai <[email protected]>

---
Changes
- Use spaces for indentation
- Removed spurious debug message

tools/python/xen/xend/XendDomainInfo.py +6 -0
Index: xen-unstable.hg/tools/python/xen/xend/XendDomainInfo.py
===================================================================
@@ -755,6 +755,12 @@ 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))
         else:
             vslot = new_dev['requested_vslot']