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: find_parent: should return str

To: xen-changelog@xxxxxxxxxxxxxxxxxxx
Subject: [Xen-changelog] [xen-unstable] xend: pci: find_parent: should return string rather than int
From: Xen patchbot-unstable <patchbot-unstable@xxxxxxxxxxxxxxxxxxx>
Date: Fri, 19 Jun 2009 00:56:30 -0700
Delivery-date: Fri, 19 Jun 2009 01:08:08 -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 1245316690 -3600
# Node ID cf6d3211ec5982a6669ebf56b664e932ba0a7a46
# Parent  2f9e1348aa98f7e0a3e08913a47a59a8261b9ba4
xend: pci: find_parent: should return string rather than int

Using changeset 19783: 61ec78692b13, device assignment can't work:
e.g., in find_the_uppermost_pci_bridge(),
 parent = dev_parent.find_parent()
...
 dev_parent = PciDevice(parent),
we can see parent['domain'] is int and in PciDevice's __init__,
int(dev['domain'], 16) would fail:
TypeError: int() can't convert non-string with explicit base

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

diff -r 2f9e1348aa98 -r cf6d3211ec59 tools/python/xen/util/pci.py
--- a/tools/python/xen/util/pci.py      Thu Jun 18 10:14:16 2009 +0100
+++ b/tools/python/xen/util/pci.py      Thu Jun 18 10:18:10 2009 +0100
@@ -547,12 +547,12 @@ class PciDevice:
             else:
                 dev = {}
                 lst = parent.split(':')
-                dev['domain'] = int(lst[0], 16)
-                dev['bus'] = int(lst[1], 16)
+                dev['domain'] = '%04x' % int(lst[0], 16)
+                dev['bus'] = '%02x' % int(lst[1], 16)
                 lst = lst[2]
                 lst = lst.split('.')
-                dev['slot'] = int(lst[0], 16)
-                dev['func'] = int(lst[1], 16)
+                dev['slot'] = '%02x' % int(lst[0], 16)
+                dev['func'] = '%x' % int(lst[1], 16)
             return dev
         except OSError, (errno, strerr):
             raise PciDeviceParseError('Can not locate the parent of %s',

_______________________________________________
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: find_parent: should return string rather than int, Xen patchbot-unstable <=