libvirt: Drop MIN_LIBVIRT_VHOSTUSER_MQ
The updated minimum required libvirt (1.3.1) and QEMU (2.5.0) for "Rocky" matches this now, so we can drop the compatibility code. Also remove / fix relevant unit tests. Change-Id: I92d59d10de4df1776b5b80f9f7db8be9331e4b1f
This commit is contained in:
parent
c1e0d2bf20
commit
65ab1e7a0a
@ -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):
|
||||
|
||||
@ -604,8 +602,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(
|
||||
@ -627,18 +624,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):
|
||||
self.flags(rx_queue_size=512, group='libvirt')
|
||||
@ -1293,20 +1282,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()
|
||||
|
||||
|
@ -46,8 +46,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)
|
||||
|
||||
@ -404,12 +402,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):
|
||||
@ -489,9 +481,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:
|
||||
|
Loading…
x
Reference in New Issue
Block a user