diff --git a/nova/tests/unit/virt/libvirt/test_driver.py b/nova/tests/unit/virt/libvirt/test_driver.py index aed6404c6256..648a94240034 100644 --- a/nova/tests/unit/virt/libvirt/test_driver.py +++ b/nova/tests/unit/virt/libvirt/test_driver.py @@ -2909,6 +2909,12 @@ class LibvirtConnTestCase(test.NoDBTestCase): return_value=True) @mock.patch.object(host.Host, "get_capabilities") def test_does_want_hugepages(self, mock_caps, mock_hp, mock_numa): + for each_arch in [arch.I686, arch.X86_64, arch.PPC64LE, arch.PPC64]: + self._test_does_want_hugepages( + mock_caps, mock_hp, mock_numa, each_arch) + + def _test_does_want_hugepages(self, mock_caps, mock_hp, mock_numa, + architecture): self.flags(reserved_huge_pages=[ {'node': 0, 'size': 2048, 'count': 128}, {'node': 1, 'size': 2048, 'count': 1}, @@ -2926,7 +2932,7 @@ class LibvirtConnTestCase(test.NoDBTestCase): caps = vconfig.LibvirtConfigCaps() caps.host = vconfig.LibvirtConfigCapsHost() caps.host.cpu = vconfig.LibvirtConfigCPU() - caps.host.cpu.arch = "x86_64" + caps.host.cpu.arch = architecture caps.host.topology = self._fake_caps_numa_topology() mock_caps.return_value = caps diff --git a/nova/virt/libvirt/driver.py b/nova/virt/libvirt/driver.py index 2daaabe878d4..53c3292993b5 100644 --- a/nova/virt/libvirt/driver.py +++ b/nova/virt/libvirt/driver.py @@ -5113,7 +5113,7 @@ class LibvirtDriver(driver.ComputeDriver): def _has_hugepage_support(self): # This means that the host can support multiple values for the size # field in LibvirtConfigGuestMemoryBackingPage - supported_archs = [arch.I686, arch.X86_64] + supported_archs = [arch.I686, arch.X86_64, arch.PPC64LE, arch.PPC64] caps = self._host.get_capabilities() return ((caps.host.cpu.arch in supported_archs) and self._host.has_min_version(MIN_LIBVIRT_HUGEPAGE_VERSION, diff --git a/releasenotes/notes/libvirt_ppc64le_hugepage_support-b9fd39cf20c8e91d.yaml b/releasenotes/notes/libvirt_ppc64le_hugepage_support-b9fd39cf20c8e91d.yaml new file mode 100644 index 000000000000..fb84d83f7d6c --- /dev/null +++ b/releasenotes/notes/libvirt_ppc64le_hugepage_support-b9fd39cf20c8e91d.yaml @@ -0,0 +1,3 @@ +--- +features: + - Added hugepage support for POWER architectures.