From: Simon Horman Subject: [patch] xend: passthrough: report attach errors from device model Date: Mon, 1 Jun 2009 12:40:08 +1000 Message-ID: <20090601024007.GA14530@verge.net.au> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Return-path: Content-Disposition: inline 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 List-Id: xen-devel@lists.xenproject.org Cc: Masaki Kanno Cc: Edwin Zhai Signed-off-by: Simon Horman Index: xen-unstable.hg/tools/python/xen/xend/XendDomainInfo.py =================================================================== --- xen-unstable.hg.orig/tools/python/xen/xend/XendDomainInfo.py 2009-06-01 11:57:04.000000000 +1000 +++ xen-unstable.hg/tools/python/xen/xend/XendDomainInfo.py 2009-06-01 12:37:05.000000000 +1000 @@ -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']