diff options
author | Anders F Björklund <anders.f.bjorklund@gmail.com> | 2021-12-13 20:34:37 +0100 |
---|---|---|
committer | Anders F Björklund <anders.f.bjorklund@gmail.com> | 2021-12-30 13:47:16 +0100 |
commit | 6630e5cf66cf76aefcfe9caebe5df4f37dd0bdd5 (patch) | |
tree | 70e331263370fe3ce81673f89e8f426a8c83212f /pkg | |
parent | a3326e23d852fdcf03e7358f631ca24f5881ac70 (diff) | |
download | podman-6630e5cf66cf76aefcfe9caebe5df4f37dd0bdd5.tar.gz podman-6630e5cf66cf76aefcfe9caebe5df4f37dd0bdd5.tar.bz2 podman-6630e5cf66cf76aefcfe9caebe5df4f37dd0bdd5.zip |
Make it possible to select the volume driver
Use the same type of mounts for all the machine volumes.
The default could change in the future, depending on OS.
[NO NEW TESTS NEEDED]
Signed-off-by: Anders F Björklund <anders.f.bjorklund@gmail.com>
Diffstat (limited to 'pkg')
-rw-r--r-- | pkg/machine/config.go | 1 | ||||
-rw-r--r-- | pkg/machine/qemu/machine.go | 12 |
2 files changed, 11 insertions, 2 deletions
diff --git a/pkg/machine/config.go b/pkg/machine/config.go index 162ef43e2..33a352898 100644 --- a/pkg/machine/config.go +++ b/pkg/machine/config.go @@ -19,6 +19,7 @@ type InitOptions struct { IgnitionPath string ImagePath string Volumes []string + VolumeDriver string IsDefault bool Memory uint64 Name string diff --git a/pkg/machine/qemu/machine.go b/pkg/machine/qemu/machine.go index fde520f03..f09107c71 100644 --- a/pkg/machine/qemu/machine.go +++ b/pkg/machine/qemu/machine.go @@ -172,8 +172,16 @@ func (v *MachineVM) Init(opts machine.InitOptions) (bool, error) { // Add arch specific options including image location v.CmdLine = append(v.CmdLine, v.addArchOptions()...) - // TODO: add to opts - volumeType := VolumeTypeVirtfs + var volumeType string + switch opts.VolumeDriver { + case "virtfs": + volumeType = VolumeTypeVirtfs + case "": // default driver + volumeType = VolumeTypeVirtfs + default: + err := fmt.Errorf("unknown volume driver: %s", opts.VolumeDriver) + return false, err + } mounts := []Mount{} for i, volume := range opts.Volumes { |