dev = PciDevice(pci_dev) except Exception, e: raise VmError("pci: failed to locate device and "+ "parse its resources - "+str(e)) if dev.driver!='pciback' and dev.driver!='pci-stub': raise VmError(("pci: PCI Backend and pci-stub don't own device "+ \ "%s") %(dev.name)) # Need to do FLR here before deassign device in order to terminate # DMA transaction, etc dev.do_FLR(self.vm.info.is_hvm(), xoptions.get_pci_dev_assign_strict_check()) if not self.vm.info.is_stubdom() : bdf = xc.deassign_device(fe_domid, pci_dict_to_xc_str(pci_dev)) pci_str = pci_dict_to_bdf_str(pci_dev) if bdf > 0: raise VmError("Failed to deassign device from IOMMU (%s)" % pci_str) log.debug("pci: Deassign device %s" % pci_str) for (start, size) in dev.ioports: log.debug('pci: disabling ioport 0x%x/0x%x'%(start,size)) rc = xc.domain_ioport_permission(domid = fe_domid, first_port = start, nr_ports = size, allow_access = False) if rc<0: raise VmError(('pci: failed to configure I/O ports on device '+ '%s - errno=%d')%(dev.name,rc)) for (start, size) in dev.iomem: # Convert start/size from bytes to page frame sizes
dev = PciDevice(domain, bus, slot, func) except Exception, e: raise VmError("pci: failed to locate device and "+ "parse it's resources - "+str(e)) if dev.driver!='pciback': raise VmError(("pci: PCI Backend does not own device "+ \ "%s\n"+ \ "See the pciback.hide kernel "+ \ "command-line parameter or\n"+ \ "bind your slot/device to the PCI backend using sysfs" \ )%(dev.name)) if not self.vm.info.is_hvm(): pci_str = "0x%x, 0x%x, 0x%x, 0x%x" % (domain, bus, slot, func) bdf = xc.deassign_device(fe_domid, pci_str) if bdf > 0: raise VmError("Failed to deassign device from IOMMU (%x:%x.%x)" % (bus, slot, func)) log.debug("pci: deassign device %x:%x.%x" % (bus, slot, func)) for (start, size) in dev.ioports: log.debug('pci: disabling ioport 0x%x/0x%x'%(start,size)) rc = xc.domain_ioport_permission(domid = fe_domid, first_port = start, nr_ports = size, allow_access = False) if rc<0: raise VmError(('pci: failed to configure I/O ports on device '+ '%s - errno=%d')%(dev.name,rc)) for (start, size) in dev.iomem: # Convert start/size from bytes to page frame sizes
dev = PciDevice(pci_dev) except Exception, e: raise VmError("pci: failed to locate device and " + "parse its resources - " + str(e)) if dev.driver != 'pciback' and dev.driver != 'pci-stub': raise VmError(("pci: PCI Backend and pci-stub don't own device "+ \ "%s") %(dev.name)) # Need to do FLR here before deassign device in order to terminate # DMA transaction, etc dev.do_FLR(self.vm.info.is_hvm(), xoptions.get_pci_dev_assign_strict_check()) if not self.vm.info.is_stubdom(): bdf = xc.deassign_device(fe_domid, pci_dict_to_xc_str(pci_dev)) pci_str = pci_dict_to_bdf_str(pci_dev) if bdf > 0: raise VmError("Failed to deassign device from IOMMU (%s)" % pci_str) log.debug("pci: Deassign device %s" % pci_str) for (start, size) in dev.ioports: log.debug('pci: disabling ioport 0x%x/0x%x' % (start, size)) rc = xc.domain_ioport_permission(domid=fe_domid, first_port=start, nr_ports=size, allow_access=False) if rc < 0: raise VmError( ('pci: failed to configure I/O ports on device ' +
dev = PciDevice(domain, bus, slot, func) except Exception, e: raise VmError("pci: failed to locate device and " + "parse it's resources - " + str(e)) if dev.driver != 'pciback': raise VmError(("pci: PCI Backend does not own device "+ \ "%s\n"+ \ "See the pciback.hide kernel "+ \ "command-line parameter or\n"+ \ "bind your slot/device to the PCI backend using sysfs" \ )%(dev.name)) if not self.vm.info.is_hvm(): pci_str = "0x%x, 0x%x, 0x%x, 0x%x" % (domain, bus, slot, func) bdf = xc.deassign_device(fe_domid, pci_str) if bdf > 0: raise VmError( "Failed to deassign device from IOMMU (%x:%x.%x)" % (bus, slot, func)) log.debug("pci: deassign device %x:%x.%x" % (bus, slot, func)) for (start, size) in dev.ioports: log.debug('pci: disabling ioport 0x%x/0x%x' % (start, size)) rc = xc.domain_ioport_permission(domid=fe_domid, first_port=start, nr_ports=size, allow_access=False) if rc < 0: raise VmError( ('pci: failed to configure I/O ports on device ' +