mirror of
https://github.com/linuxkit/linuxkit.git
synced 2025-07-21 10:09:07 +00:00
cmd: Add option to override the qemu binary to use
It still defaults to whatever is in your PATH but it's useful to override when experimenting with different qemu builds. Signed-off-by: Rolf Neugebauer <rolf.neugebauer@docker.com>
This commit is contained in:
parent
ca2e4f06a0
commit
c5b3d088b0
@ -167,6 +167,7 @@ func runQemu(args []string) {
|
||||
|
||||
// Backend configuration
|
||||
qemuContainerized := flags.Bool("containerized", false, "Run qemu in a container")
|
||||
qemuCmd := flags.String("qemu", "", "Path to the qemu binary (otherwise look in $PATH)")
|
||||
|
||||
// Generate UUID, so that /sys/class/dmi/id/product_uuid is populated
|
||||
vmUUID := uuid.New()
|
||||
@ -311,6 +312,7 @@ func runQemu(args []string) {
|
||||
Memory: *mem,
|
||||
KVM: *enableKVM,
|
||||
Containerized: *qemuContainerized,
|
||||
QemuBinPath: *qemuCmd,
|
||||
PublishedPorts: publishFlags,
|
||||
NetdevConfig: netdevConfig,
|
||||
UUID: vmUUID,
|
||||
@ -591,6 +593,13 @@ func buildQemuCmdline(config QemuConfig) (QemuConfig, []string) {
|
||||
}
|
||||
|
||||
func discoverBackend(config QemuConfig) QemuConfig {
|
||||
if config.QemuImgPath != "" && config.Containerized {
|
||||
log.Fatal("-qemu and -containerized can't be used together.")
|
||||
}
|
||||
if config.QemuImgPath != "" {
|
||||
return config
|
||||
}
|
||||
|
||||
qemuBinPath := "qemu-system-" + config.Arch
|
||||
qemuImgPath := "qemu-img"
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user