Merge "libvirt: drop MIN_QEMU_NUMA_HUGEPAGE_VERSION"

This commit is contained in:
Jenkins 2017-04-25 13:02:56 +00:00 committed by Gerrit Code Review
commit 8c9291b458
2 changed files with 10 additions and 42 deletions
nova
tests/unit/virt/libvirt
virt/libvirt

@ -2311,7 +2311,7 @@ class LibvirtConnTestCase(test.NoDBTestCase):
versionutils.convert_version_to_int(
libvirt_driver.MIN_LIBVIRT_NUMA_VERSION) - 1,
versionutils.convert_version_to_int(
libvirt_driver.MIN_QEMU_NUMA_HUGEPAGE_VERSION),
libvirt_driver.MIN_QEMU_VERSION),
host.HV_DRIVER_QEMU,
fields.Architecture.X86_64,
exception.NUMATopologyUnsupported,
@ -2324,7 +2324,7 @@ class LibvirtConnTestCase(test.NoDBTestCase):
versionutils.convert_version_to_int(
libvirt_driver.MIN_LIBVIRT_NUMA_VERSION_PPC) - 1,
versionutils.convert_version_to_int(
libvirt_driver.MIN_QEMU_NUMA_HUGEPAGE_VERSION),
libvirt_driver.MIN_QEMU_VERSION),
host.HV_DRIVER_QEMU,
fields.Architecture.PPC64LE,
exception.NUMATopologyUnsupported,
@ -2337,7 +2337,7 @@ class LibvirtConnTestCase(test.NoDBTestCase):
versionutils.convert_version_to_int(
libvirt_driver.BAD_LIBVIRT_NUMA_VERSIONS[0]),
versionutils.convert_version_to_int(
libvirt_driver.MIN_QEMU_NUMA_HUGEPAGE_VERSION),
libvirt_driver.MIN_QEMU_VERSION),
host.HV_DRIVER_QEMU,
fields.Architecture.X86_64,
exception.NUMATopologyUnsupported,
@ -2357,19 +2357,6 @@ class LibvirtConnTestCase(test.NoDBTestCase):
# assert the version is logged properly
self.assertEqual('1.2.9.2', mock_warn.call_args[0][1])
def test_get_guest_config_numa_old_version_qemu(self):
self.flags(virt_type='kvm', group='libvirt')
self._test_get_guest_config_numa_unsupported(
versionutils.convert_version_to_int(
libvirt_driver.MIN_LIBVIRT_NUMA_VERSION),
versionutils.convert_version_to_int(
libvirt_driver.MIN_QEMU_NUMA_HUGEPAGE_VERSION) - 1,
host.HV_DRIVER_QEMU,
fields.Architecture.X86_64,
exception.NUMATopologyUnsupported,
None)
def test_get_guest_config_numa_other_arch_qemu(self):
self.flags(virt_type='kvm', group='libvirt')
@ -2377,7 +2364,7 @@ class LibvirtConnTestCase(test.NoDBTestCase):
versionutils.convert_version_to_int(
libvirt_driver.MIN_LIBVIRT_NUMA_VERSION),
versionutils.convert_version_to_int(
libvirt_driver.MIN_QEMU_NUMA_HUGEPAGE_VERSION),
libvirt_driver.MIN_QEMU_VERSION),
host.HV_DRIVER_QEMU,
fields.Architecture.S390,
exception.NUMATopologyUnsupported,
@ -2401,25 +2388,12 @@ class LibvirtConnTestCase(test.NoDBTestCase):
versionutils.convert_version_to_int(
libvirt_driver.MIN_LIBVIRT_HUGEPAGE_VERSION) - 1,
versionutils.convert_version_to_int(
libvirt_driver.MIN_QEMU_NUMA_HUGEPAGE_VERSION),
libvirt_driver.MIN_QEMU_VERSION),
host.HV_DRIVER_QEMU,
fields.Architecture.X86_64,
exception.MemoryPagesUnsupported,
2048)
def test_get_guest_config_numa_old_pages_qemu(self):
self.flags(virt_type='kvm', group='libvirt')
self._test_get_guest_config_numa_unsupported(
versionutils.convert_version_to_int(
libvirt_driver.MIN_LIBVIRT_HUGEPAGE_VERSION),
versionutils.convert_version_to_int(
libvirt_driver.MIN_QEMU_NUMA_HUGEPAGE_VERSION) - 1,
host.HV_DRIVER_QEMU,
fields.Architecture.X86_64,
exception.NUMATopologyUnsupported,
2048)
@mock.patch.object(
host.Host, "is_cpu_control_policy_capable", return_value=True)
def test_get_guest_config_numa_host_instance_fit_w_cpu_pinset(
@ -12951,7 +12925,7 @@ class LibvirtConnTestCase(test.NoDBTestCase):
mock_lib_version.return_value = versionutils.convert_version_to_int(
libvirt_driver.MIN_LIBVIRT_HUGEPAGE_VERSION) - 1
mock_version.return_value = versionutils.convert_version_to_int(
libvirt_driver.MIN_QEMU_NUMA_HUGEPAGE_VERSION)
libvirt_driver.MIN_QEMU_VERSION)
mock_type.return_value = host.HV_DRIVER_QEMU
self._test_get_host_numa_topology(mempages=False)
@ -12982,7 +12956,7 @@ class LibvirtConnTestCase(test.NoDBTestCase):
mock_lib_version.return_value = versionutils.convert_version_to_int(
libvirt_driver.MIN_LIBVIRT_NUMA_VERSION) - 1
mock_version.return_value = versionutils.convert_version_to_int(
libvirt_driver.MIN_QEMU_NUMA_HUGEPAGE_VERSION)
libvirt_driver.MIN_QEMU_VERSION)
mock_type.return_value = host.HV_DRIVER_QEMU
self.assertIsNone(drvr._get_host_numa_topology())
@ -12997,7 +12971,7 @@ class LibvirtConnTestCase(test.NoDBTestCase):
mock_lib_version.return_value = versionutils.convert_version_to_int(
libvirt_driver.MIN_LIBVIRT_NUMA_VERSION)
mock_version.return_value = versionutils.convert_version_to_int(
libvirt_driver.MIN_QEMU_NUMA_HUGEPAGE_VERSION)
libvirt_driver.MIN_QEMU_VERSION)
mock_type.return_value = host.HV_DRIVER_XEN
self.assertIsNone(drvr._get_host_numa_topology())

@ -234,10 +234,6 @@ MIN_LIBVIRT_HUGEPAGE_VERSION = (1, 2, 8)
# NUMA
# See bug #1438226
BAD_LIBVIRT_CPU_POLICY_VERSIONS = [(1, 2, 10)]
# qemu 2.1 introduces support for pinning memory on host
# NUMA nodes, along with the ability to specify hugepage
# sizes per guest NUMA node
MIN_QEMU_NUMA_HUGEPAGE_VERSION = (2, 1, 0)
# Virtuozzo driver support
MIN_VIRTUOZZO_VERSION = (7, 0, 0)
@ -5436,8 +5432,7 @@ class LibvirtDriver(driver.ComputeDriver):
for archs, libvirt_ver in support_matrix.items():
if ((caps.host.cpu.arch in archs) and
self._host.has_min_version(libvirt_ver,
MIN_QEMU_NUMA_HUGEPAGE_VERSION,
host.HV_DRIVER_QEMU)):
hv_type=host.HV_DRIVER_QEMU)):
is_supported = True
return is_supported
@ -5452,8 +5447,7 @@ class LibvirtDriver(driver.ComputeDriver):
caps = self._host.get_capabilities()
return ((caps.host.cpu.arch in supported_archs) and
self._host.has_min_version(MIN_LIBVIRT_HUGEPAGE_VERSION,
MIN_QEMU_NUMA_HUGEPAGE_VERSION,
host.HV_DRIVER_QEMU))
hv_type=host.HV_DRIVER_QEMU))
def _get_host_numa_topology(self):
if not self._has_numa_support():