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] [PATCH] xend: Use parse_hex() in XendPPCI.py

To: xen-devel@xxxxxxxxxxxxxxxxxxx
Subject: [Xen-devel] [PATCH] xend: Use parse_hex() in XendPPCI.py
From: Yosuke Iwamatsu <y-iwamatsu@xxxxxxxxxxxxx>
Date: Thu, 12 Mar 2009 20:27:29 +0900
Delivery-date: Thu, 12 Mar 2009 04:29:02 -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: Thunderbird 2.0.0.19 (Windows/20081209)
Signed-off-by: Yosuke Iwamatsu <y-iwamatsu@xxxxxxxxxxxxx>

diff -r dd489125a2e7 tools/python/xen/xend/XendPPCI.py
--- a/tools/python/xen/xend/XendPPCI.py Fri Mar 06 19:18:39 2009 +0000
+++ b/tools/python/xen/xend/XendPPCI.py Mon Mar 09 20:03:19 2009 +0900
@@ -19,6 +19,8 @@
 from xen.xend.XendBase import XendBase
 from xen.xend.XendBase import XendAPIStore
 from xen.xend import uuid as genuuid
+
+from xen.util.pci import parse_hex
 
 class XendPPCI(XendBase):
     """Representation of a physical PCI device."""
@@ -72,10 +74,10 @@
  
     def get_by_sbdf(self, domain, bus, slot, func):
         for ppci in XendAPIStore.get_all("PPCI"):
-            if ppci.get_domain() == int(domain, 16) and \
-               ppci.get_bus() == int(bus, 16) and \
-               ppci.get_slot() == int(slot, 16) and \
-               ppci.get_func() == int(func, 16):
+            if ppci.get_domain() == parse_hex(domain) and \
+               ppci.get_bus() == parse_hex(bus) and \
+               ppci.get_slot() == parse_hex(slot) and \
+               ppci.get_func() == parse_hex(func):
                 return ppci.get_uuid()
         return None
 



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

<Prev in Thread] Current Thread [Next in Thread>
  • [Xen-devel] [PATCH] xend: Use parse_hex() in XendPPCI.py, Yosuke Iwamatsu <=