Merge "libvirt: Drop MIN_LIBVIRT_VHOSTUSER_MQ"
This commit is contained in:
commit
d87852ae6a
@ -40,8 +40,6 @@ from nova.virt.libvirt import vif
|
|||||||
|
|
||||||
CONF = cfg.CONF
|
CONF = cfg.CONF
|
||||||
|
|
||||||
MIN_LIBVIRT_VHOSTUSER_MQ = vif.MIN_LIBVIRT_VHOSTUSER_MQ
|
|
||||||
|
|
||||||
|
|
||||||
class LibvirtVifTestCase(test.NoDBTestCase):
|
class LibvirtVifTestCase(test.NoDBTestCase):
|
||||||
|
|
||||||
@ -632,8 +630,7 @@ class LibvirtVifTestCase(test.NoDBTestCase):
|
|||||||
def test_virtio_multiqueue_in_kernel_4(self, mock_uname):
|
def test_virtio_multiqueue_in_kernel_4(self, mock_uname):
|
||||||
self._test_virtio_multiqueue(10, '10')
|
self._test_virtio_multiqueue(10, '10')
|
||||||
|
|
||||||
@mock.patch.object(host.Host, "has_min_version")
|
def test_vhostuser_os_vif_multiqueue(self):
|
||||||
def test_vhostuser_os_vif_multiqueue(self, has_min_version):
|
|
||||||
d = vif.LibvirtGenericVIFDriver()
|
d = vif.LibvirtGenericVIFDriver()
|
||||||
hostimpl = host.Host("qemu:///system")
|
hostimpl = host.Host("qemu:///system")
|
||||||
image_meta = objects.ImageMeta.from_dict(
|
image_meta = objects.ImageMeta.from_dict(
|
||||||
@ -655,18 +652,10 @@ class LibvirtVifTestCase(test.NoDBTestCase):
|
|||||||
self.assertEqual(4, conf.vhost_queues)
|
self.assertEqual(4, conf.vhost_queues)
|
||||||
self.assertEqual('vhost', conf.driver_name)
|
self.assertEqual('vhost', conf.driver_name)
|
||||||
|
|
||||||
has_min_version.return_value = True
|
|
||||||
d._set_config_VIFVHostUser(self.instance, self.os_vif_vhostuser,
|
d._set_config_VIFVHostUser(self.instance, self.os_vif_vhostuser,
|
||||||
conf, hostimpl)
|
conf, hostimpl)
|
||||||
self.assertEqual(4, conf.vhost_queues)
|
self.assertEqual(4, conf.vhost_queues)
|
||||||
self.assertIsNone(conf.driver_name)
|
self.assertIsNone(conf.driver_name)
|
||||||
has_min_version.assert_called_once_with(MIN_LIBVIRT_VHOSTUSER_MQ)
|
|
||||||
|
|
||||||
has_min_version.return_value = False
|
|
||||||
d._set_config_VIFVHostUser(self.instance, self.os_vif_vhostuser,
|
|
||||||
conf, hostimpl)
|
|
||||||
self.assertIsNone(conf.vhost_queues)
|
|
||||||
self.assertIsNone(conf.driver_name)
|
|
||||||
|
|
||||||
def _test_virtio_config_queue_sizes(
|
def _test_virtio_config_queue_sizes(
|
||||||
self, vnic_type=network_model.VNIC_TYPE_NORMAL):
|
self, vnic_type=network_model.VNIC_TYPE_NORMAL):
|
||||||
@ -1373,20 +1362,6 @@ class LibvirtVifTestCase(test.NoDBTestCase):
|
|||||||
</devices>
|
</devices>
|
||||||
</domain>""", xml)
|
</domain>""", xml)
|
||||||
|
|
||||||
def test_vhostuser_no_queues(self):
|
|
||||||
d = vif.LibvirtGenericVIFDriver()
|
|
||||||
image_meta = objects.ImageMeta.from_dict(
|
|
||||||
{'properties': {'hw_vif_model': 'virtio',
|
|
||||||
'hw_vif_multiqueue_enabled': 'true'}})
|
|
||||||
xml = self._get_instance_xml(d, self.vif_vhostuser, image_meta,
|
|
||||||
has_min_libvirt_version=False)
|
|
||||||
node = self._get_node(xml)
|
|
||||||
self.assertEqual(node.get("type"),
|
|
||||||
network_model.VIF_TYPE_VHOSTUSER)
|
|
||||||
self._assertMacEquals(node, self.vif_vhostuser)
|
|
||||||
driver = node.find("driver")
|
|
||||||
self.assertIsNone(driver, None)
|
|
||||||
|
|
||||||
def test_vhostuser_driver_no_path(self):
|
def test_vhostuser_driver_no_path(self):
|
||||||
d = vif.LibvirtGenericVIFDriver()
|
d = vif.LibvirtGenericVIFDriver()
|
||||||
|
|
||||||
|
@ -47,8 +47,6 @@ LOG = logging.getLogger(__name__)
|
|||||||
|
|
||||||
CONF = nova.conf.CONF
|
CONF = nova.conf.CONF
|
||||||
|
|
||||||
# vhostuser queues support
|
|
||||||
MIN_LIBVIRT_VHOSTUSER_MQ = (1, 2, 17)
|
|
||||||
# vlan tag for macvtap passthrough mode on SRIOV VFs
|
# vlan tag for macvtap passthrough mode on SRIOV VFs
|
||||||
MIN_LIBVIRT_MACVTAP_PASSTHROUGH_VLAN = (1, 3, 5)
|
MIN_LIBVIRT_MACVTAP_PASSTHROUGH_VLAN = (1, 3, 5)
|
||||||
# setting interface mtu was intoduced in libvirt 3.3, We also need to
|
# setting interface mtu was intoduced in libvirt 3.3, We also need to
|
||||||
@ -448,12 +446,6 @@ class LibvirtGenericVIFDriver(object):
|
|||||||
designer.set_vif_host_backend_vhostuser_config(
|
designer.set_vif_host_backend_vhostuser_config(
|
||||||
conf, mode, sock_path, rx_queue_size, tx_queue_size)
|
conf, mode, sock_path, rx_queue_size, tx_queue_size)
|
||||||
|
|
||||||
# (vladikr) Not setting up driver and queues for vhostuser
|
|
||||||
# as queues are not supported in Libvirt until version 1.2.17
|
|
||||||
if not host.has_min_version(MIN_LIBVIRT_VHOSTUSER_MQ):
|
|
||||||
LOG.debug('Queues are not a vhostuser supported feature.')
|
|
||||||
conf.vhost_queues = None
|
|
||||||
|
|
||||||
return conf
|
return conf
|
||||||
|
|
||||||
def _get_virtio_queue_sizes(self, host):
|
def _get_virtio_queue_sizes(self, host):
|
||||||
@ -533,9 +525,6 @@ class LibvirtGenericVIFDriver(object):
|
|||||||
rx_queue_size, tx_queue_size = self._get_virtio_queue_sizes(host)
|
rx_queue_size, tx_queue_size = self._get_virtio_queue_sizes(host)
|
||||||
designer.set_vif_host_backend_vhostuser_config(
|
designer.set_vif_host_backend_vhostuser_config(
|
||||||
conf, vif.mode, vif.path, rx_queue_size, tx_queue_size)
|
conf, vif.mode, vif.path, rx_queue_size, tx_queue_size)
|
||||||
if not host.has_min_version(MIN_LIBVIRT_VHOSTUSER_MQ):
|
|
||||||
LOG.debug('Queues are not a vhostuser supported feature.')
|
|
||||||
conf.vhost_queues = None
|
|
||||||
|
|
||||||
def _set_config_VIFHostDevice(self, instance, vif, conf, host=None):
|
def _set_config_VIFHostDevice(self, instance, vif, conf, host=None):
|
||||||
if vif.dev_type == osv_fields.VIFHostDeviceDevType.ETHERNET:
|
if vif.dev_type == osv_fields.VIFHostDeviceDevType.ETHERNET:
|
||||||
|
Loading…
x
Reference in New Issue
Block a user