ia64/xen-unstable

changeset 19345:a55a98b36a2a

xend: Use parse_hex() in XendPPCI.py

Signed-off-by: Yosuke Iwamatsu <y-iwamatsu@ab.jp.nec.com>
author Keir Fraser <keir.fraser@citrix.com>
date Thu Mar 12 11:33:35 2009 +0000 (2009-03-12)
parents 0b5b67eba5ba
children 3e98bc2b6911
files tools/python/xen/xend/XendPPCI.py
line diff
     1.1 --- a/tools/python/xen/xend/XendPPCI.py	Thu Mar 12 11:33:06 2009 +0000
     1.2 +++ b/tools/python/xen/xend/XendPPCI.py	Thu Mar 12 11:33:35 2009 +0000
     1.3 @@ -20,6 +20,8 @@ from xen.xend.XendBase import XendBase
     1.4  from xen.xend.XendBase import XendAPIStore
     1.5  from xen.xend import uuid as genuuid
     1.6  
     1.7 +from xen.util.pci import parse_hex
     1.8 +
     1.9  class XendPPCI(XendBase):
    1.10      """Representation of a physical PCI device."""
    1.11  
    1.12 @@ -72,10 +74,10 @@ class XendPPCI(XendBase):
    1.13   
    1.14      def get_by_sbdf(self, domain, bus, slot, func):
    1.15          for ppci in XendAPIStore.get_all("PPCI"):
    1.16 -            if ppci.get_domain() == int(domain, 16) and \
    1.17 -               ppci.get_bus() == int(bus, 16) and \
    1.18 -               ppci.get_slot() == int(slot, 16) and \
    1.19 -               ppci.get_func() == int(func, 16):
    1.20 +            if ppci.get_domain() == parse_hex(domain) and \
    1.21 +               ppci.get_bus() == parse_hex(bus) and \
    1.22 +               ppci.get_slot() == parse_hex(slot) and \
    1.23 +               ppci.get_func() == parse_hex(func):
    1.24                  return ppci.get_uuid()
    1.25          return None
    1.26