예제 #1
0
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,))
예제 #2
0
 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)
예제 #3
0
파일: network.py 프로젝트: wuyeliang/vdsm
    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)
예제 #4
0
    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)
예제 #5
0
 def teardown(self):
     reattach_detachable(self.device, pci_reattach=False)
예제 #6
0
 def teardown(self):
     reattach_detachable(self.device)
예제 #7
0
파일: hostdevice.py 프로젝트: nirs/vdsm
 def teardown(self):
     reattach_detachable(self.device, pci_reattach=False)
예제 #8
0
파일: hostdevice.py 프로젝트: nirs/vdsm
 def teardown(self):
     reattach_detachable(self.device)