xend: Fix the detection of the upmost bridge in the python function find_parent().

Signed-off-by: Dexuan Cui <dexuan.cui@intel.com>
This commit is contained in:
Keir Fraser committed 2008-10-10 10:03:28 +01:00
1 parent e07665a216
commit de07008fdd
1 file changed
+6 -7
+6 -7
View File
@@ -400,12 +400,8 @@ class PciDevice:
lst = target.split('/')
parent = lst[len(lst)-2]
if parent[0:3] == 'pci':
parent = parent[3:]
lst = parent.split(':')
dom = int(lst[0], 16)
bus = int(lst[1], 16)
dev = 0
func = 0
# We have reached the upmost one.
return None
else:
lst = parent.split(':')
dom = int(lst[0], 16)
@@ -424,7 +420,10 @@ class PciDevice:
(dom, b, d, f) = self.find_parent()
dev = dev_parent = PciDevice(dom, b, d, f)
while dev_parent.dev_type != DEV_TYPE_PCIe_BRIDGE:
(dom, b, d, f) = dev_parent.find_parent()
parent = dev_parent.find_parent()
if parent is None:
break
(dom, b, d, f) = parent
dev = dev_parent
dev_parent = PciDevice(dom, b, d, f)
return dev
Reference in new issue
Block a user
Blocking a user prevents them from interacting with repositories, such as opening or commenting on pull requests or issues. Learn more about blocking a user.