mirror of
https://github.com/kata-containers/kata-containers.git
synced 2025-05-04 14:37:25 +00:00
Merge pull request #11085 from kevinzs2048/fix-virtiomem
runtime-go: qemu: Fix sandbox start failing with virtio-mem enable on arm64
This commit is contained in:
commit
d81a1747bd
src/runtime/virtcontainers
tools/packaging/kernel
@ -161,3 +161,7 @@ func (q *qemuArm64) appendProtectionDevice(devices []govmmQemu.Device, firmware,
|
|||||||
}
|
}
|
||||||
return devices, firmware, err
|
return devices, firmware, err
|
||||||
}
|
}
|
||||||
|
|
||||||
|
func (q *qemuArm64) memoryTopology(memoryMb, hostMemoryMb uint64, slots uint8) govmmQemu.Memory {
|
||||||
|
return genericMemoryTopology(memoryMb, hostMemoryMb, slots, q.memoryOffset)
|
||||||
|
}
|
||||||
|
@ -43,6 +43,7 @@ func TestQemuArm64CPUModel(t *testing.T) {
|
|||||||
func TestQemuArm64MemoryTopology(t *testing.T) {
|
func TestQemuArm64MemoryTopology(t *testing.T) {
|
||||||
assert := assert.New(t)
|
assert := assert.New(t)
|
||||||
arm64 := newTestQemu(assert, QemuVirt)
|
arm64 := newTestQemu(assert, QemuVirt)
|
||||||
|
memoryOffset := uint64(1024)
|
||||||
|
|
||||||
hostMem := uint64(4096)
|
hostMem := uint64(4096)
|
||||||
mem := uint64(1024)
|
mem := uint64(1024)
|
||||||
@ -50,7 +51,7 @@ func TestQemuArm64MemoryTopology(t *testing.T) {
|
|||||||
expectedMemory := govmmQemu.Memory{
|
expectedMemory := govmmQemu.Memory{
|
||||||
Size: fmt.Sprintf("%dM", mem),
|
Size: fmt.Sprintf("%dM", mem),
|
||||||
Slots: slots,
|
Slots: slots,
|
||||||
MaxMem: fmt.Sprintf("%dM", hostMem),
|
MaxMem: fmt.Sprintf("%dM", hostMem+memoryOffset),
|
||||||
}
|
}
|
||||||
|
|
||||||
m := arm64.memoryTopology(mem, hostMem, slots)
|
m := arm64.memoryTopology(mem, hostMem, slots)
|
||||||
|
@ -0,0 +1 @@
|
|||||||
|
CONFIG_VIRTIO_MEM=y
|
@ -1 +1 @@
|
|||||||
150
|
151
|
||||||
|
Loading…
Reference in New Issue
Block a user