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-devel

[Xen-devel] xend: pass-through: Use parse_pci_name() in find_parent()

To: xen-devel@xxxxxxxxxxxxxxxxxxx
Subject: [Xen-devel] xend: pass-through: Use parse_pci_name() in find_parent()
From: Simon Horman <horms@xxxxxxxxxxxx>
Date: Mon, 27 Jul 2009 11:43:47 +1000
Delivery-date: Sun, 26 Jul 2009 18:44:09 -0700
Envelope-to: www-data@xxxxxxxxxxxxxxxxxxx
List-help: <mailto:xen-devel-request@lists.xensource.com?subject=help>
List-id: Xen developer discussion <xen-devel.lists.xensource.com>
List-post: <mailto:xen-devel@lists.xensource.com>
List-subscribe: <http://lists.xensource.com/mailman/listinfo/xen-devel>, <mailto:xen-devel-request@lists.xensource.com?subject=subscribe>
List-unsubscribe: <http://lists.xensource.com/mailman/listinfo/xen-devel>, <mailto:xen-devel-request@lists.xensource.com?subject=unsubscribe>
Sender: xen-devel-bounces@xxxxxxxxxxxxxxxxxxx
User-agent: Mutt/1.5.18 (2008-05-17)
Signed-off-by: Simon Horman <horms@xxxxxxxxxxxx>

Index: xen-3.4-testing-pass-through-multi-function/tools/python/xen/util/pci.py
===================================================================
--- 
xen-3.4-testing-pass-through-multi-function.orig/tools/python/xen/util/pci.py   
    2009-07-24 11:47:15.000000000 +1000
+++ xen-3.4-testing-pass-through-multi-function/tools/python/xen/util/pci.py    
2009-07-24 11:47:32.000000000 +1000
@@ -633,16 +633,7 @@ class PciDevice:
             if parent[0:3] == 'pci':
                 # We have reached the upmost one.
                 return None
-            else:
-                dev = {}
-                lst = parent.split(':')
-                dev['domain'] = '%04x' % int(lst[0], 16)
-                dev['bus'] = '%02x' % int(lst[1], 16)
-                lst = lst[2]
-                lst = lst.split('.')
-                dev['slot'] = '%02x' % int(lst[0], 16)
-                dev['func'] = '%x' % int(lst[1], 16)
-            return dev
+            return parse_pci_name(parent)
         except OSError, (errno, strerr):
             raise PciDeviceParseError('Can not locate the parent of %s',
                 self.name)

_______________________________________________
Xen-devel mailing list
Xen-devel@xxxxxxxxxxxxxxxxxxx
http://lists.xensource.com/xen-devel

<Prev in Thread] Current Thread [Next in Thread>
  • [Xen-devel] xend: pass-through: Use parse_pci_name() in find_parent(), Simon Horman <=