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-3.4-testing] xend: pci: fix extract_the_exact_pci_n

To: xen-changelog@xxxxxxxxxxxxxxxxxxx
Subject: [Xen-changelog] [xen-3.4-testing] xend: pci: fix extract_the_exact_pci_names()
From: "Xen patchbot-3.4-testing" <patchbot-3.4-testing@xxxxxxxxxxxxxxxxxxx>
Date: Mon, 08 Jun 2009 04:35:13 -0700
Delivery-date: Thu, 11 Jun 2009 08:08:01 -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 1244460328 -3600
# Node ID 5e80a3ab4e1ec33992fe98789705395a1378041b
# Parent  a24e16539384c3de8c614d3212e4b58e4e28a3a5
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>
xen-unstable changeset:   19739:4448fae52553
xen-unstable date:        Mon Jun 08 12:24:14 2009 +0100
---
 tools/python/xen/util/pci.py |   11 +++++++++--
 1 files changed, 9 insertions(+), 2 deletions(-)

diff -r a24e16539384 -r 5e80a3ab4e1e tools/python/xen/util/pci.py
--- a/tools/python/xen/util/pci.py      Fri Jun 05 09:44:05 2009 +0100
+++ b/tools/python/xen/util/pci.py      Mon Jun 08 12:25:28 2009 +0100
@@ -142,7 +142,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:
@@ -484,7 +491,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-3.4-testing] xend: pci: fix extract_the_exact_pci_names(), Xen patchbot-3.4-testing <=