From: Simon Horman Subject: [patch 1/9] xend: pass-through: report attach errors from device model Date: Thu, 04 Jun 2009 13:21:16 +1000 Message-ID: <20090604032229.650502100@vergenet.net> References: <20090604032115.934982694@vergenet.net> Return-path: Content-Disposition: inline; filename=dm-attach-error.patch List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Sender: xen-devel-bounces@lists.xensource.com Errors-To: xen-devel-bounces@lists.xensource.com To: xen-devel@lists.xensource.com Cc: Masaki Kanno , Edwin Zhai , Dexuan Cui List-Id: xen-devel@lists.xenproject.org Cc: Masaki Kanno Cc: Edwin Zhai Signed-off-by: Simon Horman --- Changes - Use spaces for indentation - Removed spurious debug message Index: xen-unstable.hg/tools/python/xen/xend/XendDomainInfo.py =================================================================== --- xen-unstable.hg.orig/tools/python/xen/xend/XendDomainInfo.py 2009-06-04 12:45:56.000000000 +1000 +++ xen-unstable.hg/tools/python/xen/xend/XendDomainInfo.py 2009-06-04 12:45:58.000000000 +1000 @@ -752,6 +752,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['vslot'] --