diff -r 63a86863aa3f tools/python/xen/xend/server/pciif.py --- a/tools/python/xen/xend/server/pciif.py Tue May 9 12:39:16 2006 +++ b/tools/python/xen/xend/server/pciif.py Tue May 9 13:58:01 2006 @@ -31,6 +31,7 @@ from xen.util.pci import PciDevice import resource +import re xc = xen.lowlevel.xc.xc() @@ -106,6 +107,30 @@ return (0, back, {}) + def configuration(self, devid): + """@see DevController.configuration""" + + result = DevController.configuration(self, devid) + + (num_devs) = self.readBackend(devid, 'num_devs') + + for i in range(int(num_devs)): + (dev_config) = self.readBackend(devid, 'dev-%d'%(i)) + + pci_match = re.match(r"((?P[0-9a-fA-F]{1,4})[:,])?" + \ + r"(?P[0-9a-fA-F]{1,2})[:,]" + \ + r"(?P[0-9a-fA-F]{1,2})[.,]" + \ + r"(?P[0-9a-fA-F]{1,2})", dev_config) + if pci_match!=None: + pci_dev_info = pci_match.groupdict('0') + result.append( ['dev', \ + ['domain', '0x'+pci_dev_info['domain']], \ + ['bus', '0x'+pci_dev_info['bus']], \ + ['slot', '0x'+pci_dev_info['slot']], \ + ['func', '0x'+pci_dev_info['func']]]) + + return result + def setupDevice(self, domain, bus, slot, func): """ Attach I/O resources for device to frontend domain """