Bump MIN_{LIBVIRT,QEMU} for "Bobcat"

The minimum required version of QEMU is now 5.2.0, and of libvirt is
7.0.0.

The below version constants get removed:

  - MIN_LIBVIRT_VIOMMU_AW_BITS
  - MIN_LIBVIRT_VDPA
  - MIN_QEMU_VDPA
  - MIN_LIBVIRT_AARCH64_CPU_COMPARE

Adjust the related unit tests accordingly.

Change-Id: Ie805eb7fa59f9f7728da27fddbd6e968e971a2e4
Signed-off-by: Kashyap Chamarthy <kchamart@redhat.com>
This commit is contained in:
Kashyap Chamarthy 2023-06-26 17:28:07 +02:00
parent c13a8080ea
commit b6cf8e6128
5 changed files with 25 additions and 63 deletions

View File

@ -1394,9 +1394,6 @@ class VDPAServersTest(_PCIServersWithMigrationTestBase):
NUM_PFS = 1
NUM_VFS = 4
FAKE_LIBVIRT_VERSION = 6_009_000 # 6.9.0
FAKE_QEMU_VERSION = 5_001_000 # 5.1.0
def setUp(self):
super().setUp()
# The ultimate base class _IntegratedTestBase uses NeutronFixture but
@ -1444,9 +1441,7 @@ class VDPAServersTest(_PCIServersWithMigrationTestBase):
vdpa_info.add_device(f'vdpa_vdpa{idx}', idx, vf)
return super().start_compute(hostname=hostname,
pci_info=pci_info, vdpa_info=vdpa_info,
libvirt_version=self.FAKE_LIBVIRT_VERSION,
qemu_version=self.FAKE_QEMU_VERSION)
pci_info=pci_info, vdpa_info=vdpa_info)
def create_vdpa_port(self):
vdpa_port = {
@ -3661,7 +3656,6 @@ class RemoteManagedServersTest(_PCIServersWithMigrationTestBase):
# Min Libvirt version that supports working with PCI VPD.
FAKE_LIBVIRT_VERSION = 7_009_000 # 7.9.0
FAKE_QEMU_VERSION = 5_001_000 # 5.1.0
def setUp(self):
super().setUp()
@ -3790,8 +3784,7 @@ class RemoteManagedServersTest(_PCIServersWithMigrationTestBase):
return super().start_compute(
hostname=hostname, host_info=host_info, pci_info=pci_info,
mdev_info=mdev_info, vdpa_info=vdpa_info,
libvirt_version=libvirt_version or self.FAKE_LIBVIRT_VERSION,
qemu_version=qemu_version or self.FAKE_QEMU_VERSION)
libvirt_version=libvirt_version or self.FAKE_LIBVIRT_VERSION)
def create_remote_managed_tunnel_port(self):
dpu_tunnel_port = {

View File

@ -30,9 +30,6 @@ LOG = logging.getLogger(__name__)
class VPMEMTestBase(integrated_helpers.LibvirtProviderUsageBaseTestCase):
FAKE_LIBVIRT_VERSION = 5000000
FAKE_QEMU_VERSION = 3001000
def setUp(self):
super(VPMEMTestBase, self).setUp()
@ -88,8 +85,6 @@ class VPMEMTestBase(integrated_helpers.LibvirtProviderUsageBaseTestCase):
def _get_connection(self, host_info, hostname=None):
fake_connection = fakelibvirt.Connection(
'qemu:///system',
version=self.FAKE_LIBVIRT_VERSION,
hv_version=self.FAKE_QEMU_VERSION,
host_info=host_info,
hostname=hostname)
return fake_connection

View File

@ -8694,7 +8694,7 @@ class LibvirtConnTestCase(test.NoDBTestCase,
self.assertIsInstance(device,
vconfig.LibvirtConfigGuestIOMMU)
self.assertEqual('intel', device.model)
self.assertFalse(hasattr(device, "aw_bits"))
self.assertTrue(hasattr(device, "aw_bits"))
self.assertTrue(device.interrupt_remapping)
self.assertTrue(device.caching_mode)
self.assertTrue(device.eim)
@ -8803,7 +8803,7 @@ class LibvirtConnTestCase(test.NoDBTestCase,
self.assertIsInstance(device,
vconfig.LibvirtConfigGuestIOMMU)
self.assertEqual('smmuv3', device.model)
self.assertFalse(hasattr(device, "aw_bits"))
self.assertTrue(hasattr(device, "aw_bits"))
self.assertTrue(device.interrupt_remapping)
self.assertTrue(device.caching_mode)
self.assertFalse(device.eim)
@ -11672,30 +11672,10 @@ class LibvirtConnTestCase(test.NoDBTestCase,
instance)
self.assertIsNone(ret)
@mock.patch.object(fakelibvirt.Connection, 'getLibVersion',
return_value=versionutils.convert_version_to_int(
libvirt_driver.MIN_LIBVIRT_AARCH64_CPU_COMPARE) - 1
)
@mock.patch.object(nova.virt.libvirt, 'config')
def test_compare_cpu_aarch64_skip_comparison(self,
mock_vconfig,
mock_get_libversion):
instance = objects.Instance(**self.test_instance)
self.mock_uname.return_value = fakelibvirt.os_uname(
'Linux', '', '5.4.0-0-generic', '', fields.Architecture.AARCH64)
conn = libvirt_driver.LibvirtDriver(fake.FakeVirtAPI(), False)
ret = conn._compare_cpu(None, jsonutils.dumps(_fake_cpu_info_aarch64),
instance)
self.assertIsNone(ret)
@mock.patch.object(host.Host, 'get_capabilities')
@mock.patch.object(fakelibvirt.Connection, 'getLibVersion',
return_value=versionutils.convert_version_to_int(
libvirt_driver.MIN_LIBVIRT_AARCH64_CPU_COMPARE))
@mock.patch.object(host.Host, 'compare_hypervisor_cpu')
def test_compare_cpu_host_aarch64(self,
mock_compare,
mock_get_libversion,
mock_caps):
instance = objects.Instance(**self.test_instance)
mock_compare.return_value = 6

View File

@ -216,18 +216,14 @@ patch_tpool_proxy()
# doc/source/reference/libvirt-distro-support-matrix.rst
#
# DO NOT FORGET to update this document when touching any versions below!
MIN_LIBVIRT_VERSION = (6, 0, 0)
MIN_QEMU_VERSION = (4, 2, 0)
MIN_LIBVIRT_VERSION = (7, 0, 0)
MIN_QEMU_VERSION = (5, 2, 0)
NEXT_MIN_LIBVIRT_VERSION = (8, 0, 0)
NEXT_MIN_QEMU_VERSION = (6, 2, 0)
# vIOMMU driver attribute aw_bits minimal support version.
MIN_LIBVIRT_VIOMMU_AW_BITS = (6, 5, 0)
# vIOMMU model value `virtio` minimal support version
MIN_LIBVIRT_VIOMMU_VIRTIO_MODEL = (8, 3, 0)
MIN_LIBVIRT_AARCH64_CPU_COMPARE = (6, 9, 0)
# Virtuozzo driver support
MIN_VIRTUOZZO_VERSION = (7, 0, 0)
@ -246,9 +242,6 @@ VGPU_RESOURCE_SEMAPHORE = 'vgpu_resources'
LIBVIRT_PERF_EVENT_PREFIX = 'VIR_PERF_PARAM_'
# VDPA interface support
MIN_LIBVIRT_VDPA = (6, 9, 0)
MIN_QEMU_VDPA = (5, 1, 0)
REGISTER_IMAGE_PROPERTY_DEFAULTS = [
'hw_machine_type',
@ -7493,8 +7486,7 @@ class LibvirtDriver(driver.ComputeDriver):
# As Qemu supported values are 39 and 48, we set this to
# larger width (48) by default and will not exposed to end user.
if self._host.has_min_version(MIN_LIBVIRT_VIOMMU_AW_BITS):
iommu.aw_bits = 48
iommu.aw_bits = 48
if guest.os_mach_type is not None and 'q35' in guest.os_mach_type:
iommu.eim = True
@ -8170,12 +8162,9 @@ class LibvirtDriver(driver.ComputeDriver):
"""
dev_flags = (
libvirt.VIR_CONNECT_LIST_NODE_DEVICES_CAP_NET |
libvirt.VIR_CONNECT_LIST_NODE_DEVICES_CAP_PCI_DEV
libvirt.VIR_CONNECT_LIST_NODE_DEVICES_CAP_PCI_DEV |
libvirt.VIR_CONNECT_LIST_NODE_DEVICES_CAP_VDPA
)
if self._host.has_min_version(
lv_ver=MIN_LIBVIRT_VDPA, hv_ver=MIN_QEMU_VDPA,
):
dev_flags |= libvirt.VIR_CONNECT_LIST_NODE_DEVICES_CAP_VDPA
devices = {
dev.name(): dev for dev in
@ -9975,17 +9964,11 @@ class LibvirtDriver(driver.ComputeDriver):
host_cpu = self._host.get_capabilities().host.cpu
if host_cpu.arch == fields.Architecture.AARCH64:
if self._host.has_min_version(MIN_LIBVIRT_AARCH64_CPU_COMPARE):
LOG.debug("On AArch64 hosts, source and destination host "
"CPUs are compared to check if they're compatible"
"(the only use-case supported by libvirt for "
"Arm64/AArch64)")
cpu = host_cpu
else:
LOG.debug("You need %s libvirt version to be able to compare "
"source host CPU with destination host CPU; skip "
"CPU comparison", MIN_LIBVIRT_AARCH64_CPU_COMPARE)
return
LOG.debug("On AArch64 hosts, source and destination host "
"CPUs are compared to check if they're compatible"
"(the only use-case supported by libvirt for "
"Arm64/AArch64)")
cpu = host_cpu
u = ("http://libvirt.org/html/libvirt-libvirt-host.html#"
"virCPUCompareResult")

View File

@ -0,0 +1,11 @@
---
upgrade:
- |
The minimum required version of libvirt by the `nova-compute`
service is now 7.0.0, and the minimum required version of QEMU is
5.2.0. Failing to meet these minimum versions when using the libvirt
compute driver will result in the `nova-compute` service not
starting.
The next minimum required version of libvirt to be used in a future
release is 8.0.0, while the next minimum QEMU is 6.2.0.