def CheckSiblingDevices(self, domid, dev): """ Check if all sibling devices of dev are owned by pciback or pci-stub """ if not self.vm.info.is_hvm(): return group_str = xc.get_device_group(domid, dev.domain, dev.bus, dev.slot, dev.func) if group_str == "": return #group string format xx:xx.x,xx:xx.x, for i in group_str.split(','): if i == '': continue pci_dev = parse_pci_name(i) pci_dev['domain'] = '%04x' % dev.domain try: sdev = PciDevice(pci_dev) except Exception, e: #no dom0 drivers bound to sdev continue if sdev.driver!='pciback' and sdev.driver!='pci-stub': raise VmError(("pci: PCI Backend and pci-stub don't "+ \ "own sibling device %s of device %s"\ )%(sdev.name, dev.name))
def CheckSiblingDevices(self, domid, dev): """ Check if all sibling devices of dev are owned by pciback """ if not self.vm.info.is_hvm(): return group_str = xc.get_device_group(domid, dev.domain, dev.bus, dev.slot, dev.func) if group_str == "": return #group string format xx:xx.x,xx:xx.x, devstr_len = group_str.find(',') for i in range(0, len(group_str), devstr_len + 1): (bus, slotfunc) = group_str[i:i + devstr_len].split(':') (slot, func) = slotfunc.split('.') b = parse_hex(bus) d = parse_hex(slot) f = parse_hex(func) try: sdev = PciDevice(dev.domain, b, d, f) except Exception, e: #no dom0 drivers bound to sdev continue if sdev.driver!='pciback': raise VmError(("pci: PCI Backend does not own\n "+ \ "sibling device %s of device %s\n"+ \ "See the pciback.hide kernel "+ \ "command-line parameter or\n"+ \ "bind your slot/device to the PCI backend using sysfs" \ )%(sdev.name, dev.name))
def CheckSiblingDevices(self, domid, dev): """ Check if all sibling devices of dev are owned by pciback or pci-stub """ if not self.vm.info.is_hvm(): return group_str = xc.get_device_group(domid, dev.domain, dev.bus, dev.slot, dev.func) if group_str == "": return #group string format xx:xx.x,xx:xx.x, for i in group_str.split(','): if i == '': continue pci_dev = parse_pci_name(i) pci_dev['domain'] = '%04x' % dev.domain try: sdev = PciDevice(pci_dev) except Exception, e: #no dom0 drivers bound to sdev continue if sdev.driver != 'pciback' and sdev.driver != 'pci-stub': raise VmError(("pci: PCI Backend and pci-stub don't "+ \ "own sibling device %s of device %s"\ )%(sdev.name, dev.name))
def CheckSiblingDevices(self, domid, dev): """ Check if all sibling devices of dev are owned by pciback """ if not self.vm.info.is_hvm(): return group_str = xc.get_device_group(domid, dev.domain, dev.bus, dev.slot, dev.func) if group_str == "": return #group string format xx:xx.x,xx:xx.x, devstr_len = group_str.find(',') for i in range(0, len(group_str), devstr_len + 1): (bus, slotfunc) = group_str[i:i + devstr_len].split(':') (slot, func) = slotfunc.split('.') b = parse_hex(bus) d = parse_hex(slot) f = parse_hex(func) try: sdev = PciDevice(dev.domain, b, d, f) except Exception, e: #no dom0 drivers bound to sdev continue if sdev.driver != 'pciback': raise VmError(("pci: PCI Backend does not own\n "+ \ "sibling device %s of device %s\n"+ \ "See the pciback.hide kernel "+ \ "command-line parameter or\n"+ \ "bind your slot/device to the PCI backend using sysfs" \ )%(sdev.name, dev.name))