mirror of
https://github.com/linuxkit/linuxkit.git
synced 2025-07-20 09:39:08 +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
|
// Backend configuration
|
||||||
qemuContainerized := flags.Bool("containerized", false, "Run qemu in a container")
|
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
|
// Generate UUID, so that /sys/class/dmi/id/product_uuid is populated
|
||||||
vmUUID := uuid.New()
|
vmUUID := uuid.New()
|
||||||
@ -311,6 +312,7 @@ func runQemu(args []string) {
|
|||||||
Memory: *mem,
|
Memory: *mem,
|
||||||
KVM: *enableKVM,
|
KVM: *enableKVM,
|
||||||
Containerized: *qemuContainerized,
|
Containerized: *qemuContainerized,
|
||||||
|
QemuBinPath: *qemuCmd,
|
||||||
PublishedPorts: publishFlags,
|
PublishedPorts: publishFlags,
|
||||||
NetdevConfig: netdevConfig,
|
NetdevConfig: netdevConfig,
|
||||||
UUID: vmUUID,
|
UUID: vmUUID,
|
||||||
@ -591,6 +593,13 @@ func buildQemuCmdline(config QemuConfig) (QemuConfig, []string) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
func discoverBackend(config QemuConfig) QemuConfig {
|
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
|
qemuBinPath := "qemu-system-" + config.Arch
|
||||||
qemuImgPath := "qemu-img"
|
qemuImgPath := "qemu-img"
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user