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: pci: fix extract_the_exact_pci_name

To: xen-changelog@xxxxxxxxxxxxxxxxxxx
Subject: [Xen-changelog] [xen-unstable] xend: pci: fix extract_the_exact_pci_names()
From: Xen patchbot-unstable <patchbot-unstable@xxxxxxxxxxxxxxxxxxx>
Date: Mon, 08 Jun 2009 07:55:15 -0700
Delivery-date: Mon, 08 Jun 2009 07:55:25 -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 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

<Prev in Thread] Current Thread [Next in Thread>
  • [Xen-changelog] [xen-unstable] xend: pci: fix extract_the_exact_pci_names(), Xen patchbot-unstable <=