mirror of
https://github.com/kata-containers/kata-containers.git
synced 2025-06-28 08:17:37 +00:00
ppc64le: Restrict maxmem to avoid HTAB allocation failure
Fixes: #363 Signed-off-by: Nitesh Konkar <niteshkonkar@in.ibm.com>
This commit is contained in:
parent
329f70463a
commit
3b20aebd5b
@ -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 {
|
||||||
|
|
||||||
// align hostMemoryMb to 256 MB multiples
|
if hostMemoryMb > defaultMemMaxPPC64le {
|
||||||
hostMemoryMb -= (hostMemoryMb % 256)
|
hostMemoryMb = defaultMemMaxPPC64le
|
||||||
|
} else {
|
||||||
|
// align hostMemoryMb to 256MB multiples
|
||||||
|
hostMemoryMb -= (hostMemoryMb % 256)
|
||||||
|
}
|
||||||
return genericMemoryTopology(memoryMb, hostMemoryMb)
|
return genericMemoryTopology(memoryMb, hostMemoryMb)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user