mirror of
https://github.com/xen-project/xen.git
synced 2026-10-29 18:50:05 +01:00
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@intel.com>
This commit is contained in:
1 parent
e54c12cdbd
commit
54c07de022
1 file changed
+9
-2
@@ -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):
|
||||
|
||||