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: Fix the detection of the upmost bri

To: xen-changelog@xxxxxxxxxxxxxxxxxxx
Subject: [Xen-changelog] [xen-unstable] xend: Fix the detection of the upmost bridge in the python function find_parent().
From: Xen patchbot-unstable <patchbot-unstable@xxxxxxxxxxxxxxxxxxx>
Date: Fri, 10 Oct 2008 20:00:19 -0700
Delivery-date: Fri, 10 Oct 2008 20:01:13 -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 1223629408 -3600
# Node ID a9be7b357b0bedc4b6292a6beae826caac5f07e7
# Parent  3c0862d49df7ae38cdafce520d81cf1f1c23c600
xend: Fix the detection of the upmost bridge in the python function 
find_parent().

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

diff -r 3c0862d49df7 -r a9be7b357b0b tools/python/xen/util/pci.py
--- a/tools/python/xen/util/pci.py      Fri Oct 10 10:01:10 2008 +0100
+++ b/tools/python/xen/util/pci.py      Fri Oct 10 10:03:28 2008 +0100
@@ -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

_______________________________________________
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: Fix the detection of the upmost bridge in the python function find_parent()., Xen patchbot-unstable <=