Merge "libvirt: Drop MIN_LIBVIRT_VHOSTUSER_MQ"

This commit is contained in:
Zuul 2018-09-20 08:26:21 +00:00 committed by Gerrit Code Review
commit d87852ae6a
2 changed files with 1 additions and 37 deletions

View File

@ -40,8 +40,6 @@ from nova.virt.libvirt import vif
CONF = cfg.CONF
MIN_LIBVIRT_VHOSTUSER_MQ = vif.MIN_LIBVIRT_VHOSTUSER_MQ
class LibvirtVifTestCase(test.NoDBTestCase):
@ -632,8 +630,7 @@ class LibvirtVifTestCase(test.NoDBTestCase):
def test_virtio_multiqueue_in_kernel_4(self, mock_uname):
self._test_virtio_multiqueue(10, '10')
@mock.patch.object(host.Host, "has_min_version")
def test_vhostuser_os_vif_multiqueue(self, has_min_version):
def test_vhostuser_os_vif_multiqueue(self):
d = vif.LibvirtGenericVIFDriver()
hostimpl = host.Host("qemu:///system")
image_meta = objects.ImageMeta.from_dict(
@ -655,18 +652,10 @@ class LibvirtVifTestCase(test.NoDBTestCase):
self.assertEqual(4, conf.vhost_queues)
self.assertEqual('vhost', conf.driver_name)
has_min_version.return_value = True
d._set_config_VIFVHostUser(self.instance, self.os_vif_vhostuser,
conf, hostimpl)
self.assertEqual(4, conf.vhost_queues)
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(
self, vnic_type=network_model.VNIC_TYPE_NORMAL):
@ -1373,20 +1362,6 @@ class LibvirtVifTestCase(test.NoDBTestCase):
</devices>
</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):
d = vif.LibvirtGenericVIFDriver()

View File

@ -47,8 +47,6 @@ LOG = logging.getLogger(__name__)
CONF = nova.conf.CONF
# vhostuser queues support
MIN_LIBVIRT_VHOSTUSER_MQ = (1, 2, 17)
# vlan tag for macvtap passthrough mode on SRIOV VFs
MIN_LIBVIRT_MACVTAP_PASSTHROUGH_VLAN = (1, 3, 5)
# 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(
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
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)
designer.set_vif_host_backend_vhostuser_config(
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):
if vif.dev_type == osv_fields.VIFHostDeviceDevType.ETHERNET: