def teardown_device(dom, log): name, type_ = _get_device_name_type(dom) if name is None: log.debug("Unknown kind of host device: %s", xmlutils.tostring(dom, pretty=True)) elif type_ == 'mdev': despawn_mdev(name) else: pci_reattach = type_ == 'pci' log.info('Reattaching device %s to the host.' % (name,)) reattach_detachable(name, pci_reattach=pci_reattach) log.info('Device %s reattached to the host.' % (name,))
def teardown(self): if self.is_hostdevice: self.log.info('Reattaching device %s to host.' % self.hostdev) try: pci_path = hostdev.name_to_pci_path(self.hostdev) with net_api.wait_for_pci_link_up( pci_path, PCI_LINK_UP_TIMEOUT ): # TODO: avoid reattach when Engine can tell free VFs # otherwise reattach_detachable(self.hostdev) except NoIOMMUSupportException: self.log.exception('Could not reattach device %s back to host ' 'due to missing IOMMU support.', self.hostdev)
def teardown(self): if self.is_hostdevice: self.log.info('Reattaching device %s to host.' % self.hostdev) try: # TODO: avoid reattach when Engine can tell free VFs otherwise reattach_detachable(self.hostdev) except NoIOMMUSupportException: self.log.exception( 'Could not reattach device %s back to host ' 'due to missing IOMMU support.', self.hostdev) if self._is_vhostuser: bridge_info = supervdsm.getProxy().ovs_bridge(self.network) if bridge_info: port = self._get_vhostuser_port_name() supervdsm.getProxy().remove_ovs_port(bridge_info['name'], port)
def teardown(self): if self.is_hostdevice: self.log.info('Reattaching device %s to host.' % self.hostdev) try: pci_path = hostdev.name_to_pci_path(self.hostdev) with net_api.wait_for_pci_link_up( pci_path, PCI_LINK_UP_TIMEOUT ): # TODO: avoid reattach when Engine can tell free VFs # otherwise reattach_detachable(self.hostdev) except NoIOMMUSupportException: self.log.exception('Could not reattach device %s back to host ' 'due to missing IOMMU support.', self.hostdev) if self._is_vhostuser: bridge_info = supervdsm.getProxy().ovs_bridge(self.network) if bridge_info: port = self._get_vhostuser_port_name() supervdsm.getProxy().remove_ovs_port(bridge_info['name'], port)
def teardown(self): reattach_detachable(self.device, pci_reattach=False)
def teardown(self): reattach_detachable(self.device)
def teardown(self): reattach_detachable(self.device, pci_reattach=False)
def teardown(self): reattach_detachable(self.device)