Beispiel #1
0
    def test_persist_config(self, mock_rconfig):
        sriov.persist_numvfs(PCI1, NUMVFS)

        mock_rconfig.return_value.set_device.assert_called_once_with(
            PCI1, {'sriov': {
                'numvfs': NUMVFS
            }})
        mock_rconfig.return_value.save.assert_called_once()
Beispiel #2
0
def change_numvfs(numvfs, devname):
    """Change number of virtual functions of a device.

    The persistence is stored in the same place as other network persistence is
    stored. A call to setSafeNetworkConfig() will persist it across reboots.
    """
    logging.info(f'Changing number of vfs on device {devname} -> {numvfs}.')
    update_num_vfs(devname, numvfs)
    sriov.persist_numvfs(devname, numvfs)
Beispiel #3
0
def change_numvfs(pci_path, numvfs, devname):
    """Change number of virtual functions of a device.

    The persistence is stored in the same place as other network persistence is
    stored. A call to setSafeNetworkConfig() will persist it across reboots.
    """
    logging.info('Changing number of vfs on device %s -> %s.', pci_path,
                 numvfs)
    sriov.update_numvfs(pci_path, numvfs)
    sriov.persist_numvfs(devname, numvfs)

    link_iface.iface(devname).up()
Beispiel #4
0
Datei: api.py Projekt: oVirt/vdsm
def change_numvfs(pci_path, numvfs, devname):
    """Change number of virtual functions of a device.

    The persistence is stored in the same place as other network persistence is
    stored. A call to setSafeNetworkConfig() will persist it across reboots.
    """
    logging.info('Changing number of vfs on device %s -> %s.',
                 pci_path, numvfs)
    sriov.update_numvfs(pci_path, numvfs)
    sriov.persist_numvfs(devname, numvfs)

    link_iface.iface(devname).up()
Beispiel #5
0
def change_numvfs(pci_path, numvfs, net_name):
    """Change number of virtual functions of a device.

    The persistence is stored in the same place as other network persistence is
    stored. A call to setSafeNetworkConfig() will persist it across reboots.
    """
    # TODO: net_name is here only because it is hard to call pf_to_net_name
    # TODO: from here. once all our code will be under lib/vdsm this should be
    # TODO: removed.
    logging.info('Changing number of vfs on device %s -> %s.', pci_path,
                 numvfs)
    sriov.update_numvfs(pci_path, numvfs)
    sriov.persist_numvfs(pci_path, numvfs)

    link_iface.iface(net_name).up()
Beispiel #6
0
Datei: api.py Projekt: EdDev/vdsm
def change_numvfs(pci_path, numvfs, net_name):
    """Change number of virtual functions of a device.

    The persistence is stored in the same place as other network persistence is
    stored. A call to setSafeNetworkConfig() will persist it across reboots.
    """
    # TODO: net_name is here only because it is hard to call pf_to_net_name
    # TODO: from here. once all our code will be under lib/vdsm this should be
    # TODO: removed.
    logging.info('Changing number of vfs on device %s -> %s.',
                 pci_path, numvfs)
    sriov.update_numvfs(pci_path, numvfs)
    sriov.persist_numvfs(pci_path, numvfs)

    link_iface.up(net_name)
Beispiel #7
0
    def test_persist_config(self, mock_rconfig):
        sriov.persist_numvfs(PCI1, NUMVFS)

        mock_rconfig.return_value.set_device.assert_called_once_with(
            PCI1, {'sriov': {'numvfs': NUMVFS}})
        mock_rconfig.return_value.save.assert_called_once()