diff options
author | Jason T. Greene <jason@stacksmash.com> | 2021-11-12 00:10:58 -0600 |
---|---|---|
committer | Jason T. Greene <jason.greene@redhat.com> | 2021-12-24 19:28:10 -0600 |
commit | 803defbe509af1902a1fdc2ed7f41b49ebd241f6 (patch) | |
tree | 54fe3a08b58b9129f87e51cd1b8fcd938f582777 /cmd/podman/machine/start.go | |
parent | 73a54ea54d0a1b4ccaa2a0e23c678e5b7c1d5c37 (diff) | |
download | podman-803defbe509af1902a1fdc2ed7f41b49ebd241f6.tar.gz podman-803defbe509af1902a1fdc2ed7f41b49ebd241f6.tar.bz2 podman-803defbe509af1902a1fdc2ed7f41b49ebd241f6.zip |
Introduce Windows WSL implementation of podman machine
[NO NEW TESTS NEEDED] for now
Signed-off-by: Jason Greene <jason.greene@redhat.com>
Diffstat (limited to 'cmd/podman/machine/start.go')
-rw-r--r-- | cmd/podman/machine/start.go | 22 |
1 files changed, 11 insertions, 11 deletions
diff --git a/cmd/podman/machine/start.go b/cmd/podman/machine/start.go index 4ae31e6de..9c9c24f64 100644 --- a/cmd/podman/machine/start.go +++ b/cmd/podman/machine/start.go @@ -1,4 +1,4 @@ -// +build amd64,!windows arm64,!windows +// +build amd64 arm64 package machine @@ -7,7 +7,6 @@ import ( "github.com/containers/podman/v3/cmd/podman/registry" "github.com/containers/podman/v3/pkg/machine" - "github.com/containers/podman/v3/pkg/machine/qemu" "github.com/pkg/errors" "github.com/spf13/cobra" ) @@ -33,30 +32,31 @@ func init() { func start(cmd *cobra.Command, args []string) error { var ( - err error - vm machine.VM - vmType string + err error + vm machine.VM ) vmName := defaultMachineName if len(args) > 0 && len(args[0]) > 0 { vmName = args[0] } - // We only have qemu VM's for now - active, activeName, err := qemu.CheckActiveVM() + provider := getSystemDefaultProvider() + vm, err = provider.LoadVMByName(vmName) if err != nil { return err } + + active, activeName, cerr := provider.CheckExclusiveActiveVM() + if cerr != nil { + return cerr + } if active { if vmName == activeName { return errors.Wrapf(machine.ErrVMAlreadyRunning, "cannot start VM %s", vmName) } return errors.Wrapf(machine.ErrMultipleActiveVM, "cannot start VM %s. VM %s is currently running", vmName, activeName) } - switch vmType { - default: - vm, err = qemu.LoadVMByName(vmName) - } + vm, err = provider.LoadVMByName(vmName) if err != nil { return err } |