[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Xen-changelog] [xen-unstable] xend: pci: fix extract_the_exact_pci_names()



# HG changeset patch
# User Keir Fraser <keir.fraser@xxxxxxxxxx>
# Date 1244460254 -3600
# Node ID 4448fae5255330a0a6b9590f62509fb4185e50e2
# Parent  8dd5c3cae086fc9eeb066117fbe131d4d4718438
xend: pci: fix extract_the_exact_pci_names()

Changeset 19726: d8b7b51f482b neglects the case pci_names could be
types.ListType.

Signed-off-by: Dexuan Cui <dexuan.cui@xxxxxxxxx>
---
 tools/python/xen/util/pci.py |   11 +++++++++--
 1 files changed, 9 insertions(+), 2 deletions(-)

diff -r 8dd5c3cae086 -r 4448fae52553 tools/python/xen/util/pci.py
--- a/tools/python/xen/util/pci.py      Fri Jun 05 14:04:03 2009 +0100
+++ b/tools/python/xen/util/pci.py      Mon Jun 08 12:24:14 2009 +0100
@@ -155,7 +155,14 @@ def parse_pci_name(pci_name_string):
 
 def extract_the_exact_pci_names(pci_names):
     result = []
-    pci_names = pci_names.split()
+
+    if isinstance(pci_names, types.StringTypes):
+        pci_names = pci_names.split()
+    elif isinstance(pci_names, types.ListType):
+        pci_names = re.findall(PCI_DEV_REG_EXPRESS_STR, '%s' % pci_names)
+    else:
+         raise PciDeviceParseError('Invalid argument: %s' % pci_names)
+
     for pci in pci_names:
         # The length of DDDD:bb:dd.f is 12.
         if len(pci) !=  12:
@@ -503,7 +510,7 @@ class PciDevice:
             return [self.name]
 
         dev_list = dev.find_all_devices_behind_the_bridge(ignore_bridge)
-        dev_list = extract_the_exact_pci_names('%s' % dev_list)
+        dev_list = extract_the_exact_pci_names(dev_list)
         return dev_list
 
     def do_secondary_bus_reset(self, target_bus, devs):

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


 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.