Merge pull request #364 from nitkon/master

ppc64le: Restrict maxmem to avoid HTAB allocation failure
This commit is contained in:
Sebastien Boeuf 2018-06-04 06:58:02 -07:00 committed by GitHub
commit b285989b20
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -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
if hostMemoryMb > defaultMemMaxPPC64le {
hostMemoryMb = defaultMemMaxPPC64le
} else {
// align hostMemoryMb to 256MB multiples
hostMemoryMb -= (hostMemoryMb % 256)
}
return genericMemoryTopology(memoryMb, hostMemoryMb)
}