mirror of
https://github.com/kata-containers/kata-containers.git
synced 2025-06-25 06:52:13 +00:00
qemu.go: qemu: setupVirtioMem: let sizeMB be multiple of 2Mib
Got: FATA[0000] run pod sandbox: rpc error: code = Unknown desc = failed to create containerd task: Add 189759MB virtio-mem-pci fail QMP command failed: backend memory size must be multiple of 0x200000: unknown This commit let sizeMB be multiple of 2Mib to fix the issue. Fixes: #1796 Signed-off-by: Hui Zhu <teawater@antfin.com>
This commit is contained in:
parent
d0eda5ecfd
commit
c9053ea3fb
@ -768,8 +768,8 @@ func (q *qemu) setupVirtioMem() error {
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
// 1024 is size for nvdimm
|
||||
sizeMB := int(maxMem) - int(q.config.MemorySize)
|
||||
// backend memory size must be multiple of 2Mib
|
||||
sizeMB := (int(maxMem) - int(q.config.MemorySize)) >> 2 << 2
|
||||
|
||||
share, target, memoryBack, err := q.getMemArgs()
|
||||
if err != nil {
|
||||
|
Loading…
Reference in New Issue
Block a user