WARNING - OLD ARCHIVES

This is an archived copy of the Xen.org mailing list, which we have preserved to ensure that existing links to archives are not broken. The live archive, which contains the latest emails, can be found at http://lists.xen.org/
   
 
 
Xen 
 
Home Products Support Community News
 
   
 

xen-changelog

[Xen-changelog] [xen-unstable] xend: pass-through: Use common parsing co

To: xen-changelog@xxxxxxxxxxxxxxxxxxx
Subject: [Xen-changelog] [xen-unstable] xend: pass-through: Use common parsing code in getDeviceConfiguration()
From: Xen patchbot-unstable <patchbot-unstable@xxxxxxxxxxxxxxxxxxx>
Date: Fri, 19 Jun 2009 00:56:15 -0700
Delivery-date: Fri, 19 Jun 2009 01:06:21 -0700
Envelope-to: www-data@xxxxxxxxxxxxxxxxxxx
List-help: <mailto:xen-changelog-request@lists.xensource.com?subject=help>
List-id: BK change log <xen-changelog.lists.xensource.com>
List-post: <mailto:xen-changelog@lists.xensource.com>
List-subscribe: <http://lists.xensource.com/mailman/listinfo/xen-changelog>, <mailto:xen-changelog-request@lists.xensource.com?subject=subscribe>
List-unsubscribe: <http://lists.xensource.com/mailman/listinfo/xen-changelog>, <mailto:xen-changelog-request@lists.xensource.com?subject=unsubscribe>
Reply-to: xen-devel@xxxxxxxxxxxxxxxxxxx
Sender: xen-changelog-bounces@xxxxxxxxxxxxxxxxxxx
# HG changeset patch
# User Keir Fraser <keir.fraser@xxxxxxxxxx>
# Date 1245220743 -3600
# Node ID 902df7680e2e311ba281a0ed6bf999ab525630a9
# Parent  85fdfb7da88cd22089fcf3f3218b1bc01a02dcc5
xend: pass-through: Use common parsing code in getDeviceConfiguration()

Signed-off-by: Simon Horman <horms@xxxxxxxxxxxx>
---
 tools/python/xen/xend/server/pciif.py |   37 +++++++++++-----------------------
 1 files changed, 12 insertions(+), 25 deletions(-)

diff -r 85fdfb7da88c -r 902df7680e2e tools/python/xen/xend/server/pciif.py
--- a/tools/python/xen/xend/server/pciif.py     Wed Jun 17 07:38:42 2009 +0100
+++ b/tools/python/xen/xend/server/pciif.py     Wed Jun 17 07:39:03 2009 +0100
@@ -170,31 +170,18 @@ class PciController(DevController):
         pci_devs = []
 
         for i in range(int(num_devs)):
-            dev_config = self.readBackend(devid, 'dev-%d' % i)
-
-            pci_match = re.match(r"((?P<domain>[0-9a-fA-F]{1,4})[:,])?" +
-                                 r"(?P<bus>[0-9a-fA-F]{1,2})[:,]" + 
-                                 r"(?P<slot>[0-9a-fA-F]{1,2})[.,]" + 
-                                 r"(?P<func>[0-7]{1,2})$", dev_config)
-            
-            if pci_match!=None:
-                pci_dev_info = pci_match.groupdict()
-                dev_dict = {'domain': '0x%(domain)s' % pci_dev_info,
-                                 'bus': '0x%(bus)s' % pci_dev_info,
-                                 'slot': '0x%(slot)s' % pci_dev_info,
-                                 'func': '0x%(func)s' % pci_dev_info}
-
-                # Per device uuid info
-                dev_dict['uuid'] = self.readBackend(devid, 'uuid-%d' % i)
-                dev_dict['vslot'] = '0x%s' % \
-                                    self.readBackend(devid, 'vslot-%d' % i)
-
-                #append opts info
-                opts = self.readBackend(devid, 'opts-%d' % i)
-                if opts is not None:
-                    dev_dict['opts'] = opts
-
-                pci_devs.append(dev_dict)
+            pci_dev = parse_pci_name(self.readBackend(devid, 'dev-%d' % i))
+
+            # Per device uuid info
+            pci_dev['uuid'] = self.readBackend(devid, 'uuid-%d' % i)
+            pci_dev['vslot'] = '0x%s' % self.readBackend(devid, 'vslot-%d' % i)
+
+            #append opts info
+            opts = self.readBackend(devid, 'opts-%d' % i)
+            if opts is not None:
+                pci_dev['opts'] = opts
+
+            pci_devs.append(pci_dev)
 
         result['devs'] = pci_devs
         result['uuid'] = self.readBackend(devid, 'uuid')

_______________________________________________
Xen-changelog mailing list
Xen-changelog@xxxxxxxxxxxxxxxxxxx
http://lists.xensource.com/xen-changelog

<Prev in Thread] Current Thread [Next in Thread>
  • [Xen-changelog] [xen-unstable] xend: pass-through: Use common parsing code in getDeviceConfiguration(), Xen patchbot-unstable <=