machine refactoring preparations for hyperv

before we can support hyperv as a virtualization option for podman
machine, several areas in machine will require cleanup.  this is the
first pass of these changes to keep the review burden low.  changes
include:

  * convert artifact, format (image format) and compression to enums
    with string methods
  * rename Provider interface to VirtProvider
  * change Provider implementation in QEMU to QEMUVirt
  * change Provider implementation in WSL to WSLVirt

as mentioned earlier, there will be several more of these refactoring
PRs because assumptions were made about associations of platforms and
virt providers as well as compression and image formats.

Signed-off-by: Brent Baude <bbaude@redhat.com>
This commit is contained in:
Brent Baude
2023-02-20 10:40:13 -06:00
parent a9ec6492e8
commit ebb45b5bdd
12 changed files with 250 additions and 59 deletions

View File

@ -47,7 +47,7 @@ const (
DefaultMachineName string = "podman-machine-default"
)
type Provider interface {
type VirtProvider interface {
NewMachine(opts InitOptions) (VM, error)
LoadVMByName(name string) (VM, error)
List(opts ListOptions) ([]*ListResponse, error)
@ -72,10 +72,10 @@ var (
type Download struct {
Arch string
Artifact string
Artifact artifact
CompressionType string
CacheDir string
Format string
Format imageFormat
ImageName string
LocalPath string
LocalUncompressedFile string