ia64/xen-unstable

changeset 19760:4bc1347b9b86

xend: pass-through: Use PCIDevice as the parameter for the constructor for PCIQuirk

Signed-off-by: Simon Horman <horms@verge.net.au>
author Keir Fraser <keir.fraser@citrix.com>
date Tue Jun 16 11:39:02 2009 +0100 (2009-06-16)
parents 11c3f4e786b3
children b52a91a45c65
files tools/python/xen/xend/server/pciif.py tools/python/xen/xend/server/pciquirk.py
line diff
     1.1 --- a/tools/python/xen/xend/server/pciif.py	Tue Jun 16 11:38:33 2009 +0100
     1.2 +++ b/tools/python/xen/xend/server/pciif.py	Tue Jun 16 11:39:02 2009 +0100
     1.3 @@ -301,8 +301,7 @@ class PciController(DevController):
     1.4          # if arch.type != "ia64":
     1.5          #    dev.do_FLR()
     1.6  
     1.7 -        PCIQuirk(dev.vendor, dev.device, dev.subvendor, dev.subdevice, domain, 
     1.8 -                bus, slot, func)
     1.9 +        PCIQuirk(dev)
    1.10  
    1.11          if not self.vm.info.is_hvm():
    1.12              # Setup IOMMU device assignment
     2.1 --- a/tools/python/xen/xend/server/pciquirk.py	Tue Jun 16 11:38:33 2009 +0100
     2.2 +++ b/tools/python/xen/xend/server/pciquirk.py	Tue Jun 16 11:39:02 2009 +0100
     2.3 @@ -11,18 +11,19 @@ PERMISSIVE_CONFIG_FILE = auxbin.xen_conf
     2.4  PERMISSIVE_SYSFS_NODE = "/sys/bus/pci/drivers/pciback/permissive"
     2.5  
     2.6  class PCIQuirk:
     2.7 -    def __init__( self, vendor, device, subvendor, subdevice, domain, bus, slot, func):
     2.8 -        self.vendor = vendor
     2.9 -        self.device = device
    2.10 -        self.subvendor = subvendor
    2.11 -        self.subdevice = subdevice
    2.12 -        self.domain = domain
    2.13 -        self.bus = bus
    2.14 -        self.slot = slot
    2.15 -        self.func = func
    2.16 +    def __init__(self, dev):
    2.17 +        self.vendor = dev.vendor
    2.18 +        self.device = dev.device
    2.19 +        self.subvendor = dev.subvendor
    2.20 +        self.subdevice = dev.subdevice
    2.21 +        self.domain = dev.domain
    2.22 +        self.bus = dev.bus
    2.23 +        self.slot = dev.slot
    2.24 +        self.func = dev.func
    2.25  
    2.26 -        self.devid = "%04x:%04x:%04x:%04x" % (vendor, device, subvendor, subdevice)
    2.27 -        self.pciid = "%04x:%02x:%02x.%01x" % (domain, bus, slot, func)
    2.28 +        self.devid = "%04x:%04x:%04x:%04x" % (self.vendor, self.device,
    2.29 +                                              self.subvendor, self.subdevice)
    2.30 +        self.pciid = dev.name
    2.31          self.quirks = self.__getQuirksByID()
    2.32  
    2.33          self.__sendQuirks()