From ead2e7dfeb07123d16be0bf355938a3c6f4eafba Mon Sep 17 00:00:00 2001 From: Arthur Sengileyev Date: Sun, 15 Jan 2023 20:14:18 +0200 Subject: [PATCH] Add Provider to MachineConfig Signed-off-by: Arthur Sengileyev --- docs/containers.conf.5.md | 6 ++++++ pkg/config/config.go | 4 +++- pkg/config/containers.conf | 9 +++++++-- pkg/config/containers.conf-freebsd | 7 ++++++- 4 files changed, 22 insertions(+), 4 deletions(-) diff --git a/docs/containers.conf.5.md b/docs/containers.conf.5.md index dcea3b7b0..cac551c08 100644 --- a/docs/containers.conf.5.md +++ b/docs/containers.conf.5.md @@ -747,6 +747,12 @@ tell the container engines to mount the volume readonly. On Mac, the default volumes are: `"/Users:/Users", "/private:/private", "/var/folders:/var/folders"` +**provider**="" + +Virtualization provider to be used for running a podman-machine VM. Empty value +is interpreted as the default provider for the current host OS. On Linux/Mac +default is `QEMU` and on Windows it is `WSL`. + # FILES **containers.conf** diff --git a/pkg/config/config.go b/pkg/config/config.go index 5e965402c..aa4fdf1d3 100644 --- a/pkg/config/config.go +++ b/pkg/config/config.go @@ -609,7 +609,7 @@ type MachineConfig struct { CPUs uint64 `toml:"cpus,omitempty,omitzero"` // DiskSize is the size of the disk in GB created when init-ing a podman-machine VM DiskSize uint64 `toml:"disk_size,omitempty,omitzero"` - // MachineImage is the image used when init-ing a podman-machine VM + // Image is the image used when init-ing a podman-machine VM Image string `toml:"image,omitempty"` // Memory in MB a machine is created with. Memory uint64 `toml:"memory,omitempty,omitzero"` @@ -617,6 +617,8 @@ type MachineConfig struct { User string `toml:"user,omitempty"` // Volumes are host directories mounted into the VM by default. Volumes []string `toml:"volumes"` + // Provider is the virtualization provider used to run podman-machine VM + Provider string `toml:"provider,omitempty"` } // Destination represents destination for remote service diff --git a/pkg/config/containers.conf b/pkg/config/containers.conf index 833961735..2a08d8d3e 100644 --- a/pkg/config/containers.conf +++ b/pkg/config/containers.conf @@ -693,7 +693,7 @@ default_sysctls = [ # "https://example.com/linux/amd64/foobar.ami" on a Linux AMD machine. # The default value is `testing`. # -# image = "testing" +#image = "testing" # Memory in MB a machine is created with. # @@ -709,10 +709,15 @@ default_sysctls = [ # the source and destination. An optional third field `:ro` can be used to # tell the container engines to mount the volume readonly. # -# volumes = [ +#volumes = [ # "$HOME:$HOME", #] +# Virtualization provider used to run Podman machine. +# If it is empty or commented out, the default provider will be used. +# +#provider = "" + # The [machine] table MUST be the last entry in this file. # (Unless another table is added) # TOML does not provide a way to end a table other than a further table being diff --git a/pkg/config/containers.conf-freebsd b/pkg/config/containers.conf-freebsd index 0ac0f325e..f98bb0bf3 100644 --- a/pkg/config/containers.conf-freebsd +++ b/pkg/config/containers.conf-freebsd @@ -626,10 +626,15 @@ default_sysctls = [ # the source and destination. An optional third field `:ro` can be used to # tell the container engines to mount the volume readonly. # -# volumes = [ +#volumes = [ # "$HOME:$HOME", #] +# Virtualization provider used to run Podman machine. +# If it is empty or commented out, the default provider will be used. +# +#provider = "" + # The [machine] table MUST be the last entry in this file. # (Unless another table is added) # TOML does not provide a way to end a table other than a further table being