From 3b20aebd5ba8b32b00dac535e3d3902ffa5bf85d Mon Sep 17 00:00:00 2001 From: Nitesh Konkar Date: Fri, 1 Jun 2018 20:41:27 +0530 Subject: [PATCH] ppc64le: Restrict maxmem to avoid HTAB allocation failure Fixes: #363 Signed-off-by: Nitesh Konkar --- virtcontainers/qemu_ppc64le.go | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/virtcontainers/qemu_ppc64le.go b/virtcontainers/qemu_ppc64le.go index 7d309973b5..1909f5e653 100644 --- a/virtcontainers/qemu_ppc64le.go +++ b/virtcontainers/qemu_ppc64le.go @@ -27,6 +27,8 @@ const defaultQemuMachineOptions = "accel=kvm,usb=off" const defaultPCBridgeBus = "pci.0" +const defaultMemMaxPPC64le = 32256 // Restrict MemMax to 32Gb on PPC64le + var qemuPaths = map[string]string{ QemuPseries: defaultQemuPath, } @@ -103,8 +105,12 @@ func (q *qemuPPC64le) cpuModel() string { func (q *qemuPPC64le) memoryTopology(memoryMb, hostMemoryMb uint64) govmmQemu.Memory { - // align hostMemoryMb to 256 MB multiples - hostMemoryMb -= (hostMemoryMb % 256) + if hostMemoryMb > defaultMemMaxPPC64le { + hostMemoryMb = defaultMemMaxPPC64le + } else { + // align hostMemoryMb to 256MB multiples + hostMemoryMb -= (hostMemoryMb % 256) + } return genericMemoryTopology(memoryMb, hostMemoryMb) }