mirror of
https://github.com/containers/podman.git
synced 2025-11-30 01:58:46 +08:00
Fix compilation issues in QEMU machine files (Windows platform)
Signed-off-by: Arthur Sengileyev <arthur.sengileyev@gmail.com>
This commit is contained in:
18
pkg/machine/qemu/command/command_unix.go
Normal file
18
pkg/machine/qemu/command/command_unix.go
Normal file
@@ -0,0 +1,18 @@
|
||||
//go:build dragonfly || freebsd || linux || netbsd || openbsd
|
||||
|
||||
package command
|
||||
|
||||
import (
|
||||
"fmt"
|
||||
"strconv"
|
||||
|
||||
"github.com/containers/common/pkg/strongunits"
|
||||
)
|
||||
|
||||
// SetMemory adds the specified amount of memory for the machine
|
||||
func (q *QemuCmd) SetMemory(m strongunits.MiB) {
|
||||
serializedMem := strconv.FormatUint(uint64(m), 10)
|
||||
// In order to use virtiofsd, we must enable shared memory
|
||||
*q = append(*q, "-object", fmt.Sprintf("memory-backend-memfd,id=mem,size=%sM,share=on", serializedMem))
|
||||
*q = append(*q, "-m", serializedMem)
|
||||
}
|
||||
Reference in New Issue
Block a user