ppc64le: Restrict maxmem to avoid HTAB allocation failure

Fixes: #363

Signed-off-by: Nitesh Konkar <niteshkonkar@in.ibm.com>
This commit is contained in:
Nitesh Konkar 2018-06-01 20:41:27 +05:30
parent 329f70463a
commit 3b20aebd5b

View File

@ -27,6 +27,8 @@ const defaultQemuMachineOptions = "accel=kvm,usb=off"
const defaultPCBridgeBus = "pci.0" const defaultPCBridgeBus = "pci.0"
const defaultMemMaxPPC64le = 32256 // Restrict MemMax to 32Gb on PPC64le
var qemuPaths = map[string]string{ var qemuPaths = map[string]string{
QemuPseries: defaultQemuPath, QemuPseries: defaultQemuPath,
} }
@ -103,8 +105,12 @@ func (q *qemuPPC64le) cpuModel() string {
func (q *qemuPPC64le) memoryTopology(memoryMb, hostMemoryMb uint64) govmmQemu.Memory { func (q *qemuPPC64le) memoryTopology(memoryMb, hostMemoryMb uint64) govmmQemu.Memory {
if hostMemoryMb > defaultMemMaxPPC64le {
hostMemoryMb = defaultMemMaxPPC64le
} else {
// align hostMemoryMb to 256MB multiples // align hostMemoryMb to 256MB multiples
hostMemoryMb -= (hostMemoryMb % 256) hostMemoryMb -= (hostMemoryMb % 256)
}
return genericMemoryTopology(memoryMb, hostMemoryMb) return genericMemoryTopology(memoryMb, hostMemoryMb)
} }