MVP for Podman Machine with AppleHV

this pr is the first pass at enabling podman machine to use the apple hypervisor. there are still several TODO
areas like host networking.  once the decision is handled on what host networking should look like, these TODOs
should be fairly quick to resolve.  they also will impact the remove methods.

you must also have vfkit (https://github.com/crc-org/vfkit)

Signed-off-by: Brent Baude <bbaude@redhat.com>

[NO NEW TESTS NEEDED]

Signed-off-by: Brent Baude <bbaude@redhat.com>
This commit is contained in:
Brent Baude committed 2023-05-02 13:09:56 -05:00
1 parent cda2b6e7ea
commit dc7515dc32
16 files changed
+1308 -38

No files matched your search

+1 -2
View File
@@ -1,5 +1,4 @@
//go:build (amd64 && !windows) || (arm64 && !windows)
// +build amd64,!windows arm64,!windows
//go:build (amd64 && !windows && amd64 && !darwin) || (arm64 && !windows && arm64 && !darwin) || (amd64 && darwin)
package machine
+36
View File
@@ -0,0 +1,36 @@
//go:build darwin && arm64
package machine
import (
"fmt"
"os"
"github.com/containers/common/pkg/config"
"github.com/containers/podman/v4/pkg/machine"
"github.com/containers/podman/v4/pkg/machine/qemu"
"github.com/sirupsen/logrus"
)
func GetSystemProvider() (machine.VirtProvider, error) {
cfg, err := config.Default()
if err != nil {
return nil, err
}
provider := cfg.Machine.Provider
if providerOverride, found := os.LookupEnv("CONTAINERS_MACHINE_PROVIDER"); found {
provider = providerOverride
}
resolvedVMType, err := machine.ParseVMType(provider, machine.QemuVirt)
if err != nil {
return nil, err
}
logrus.Debugf("Using Podman machine with `%s` virtualization provider", resolvedVMType.String())
switch resolvedVMType {
case machine.QemuVirt:
return qemu.GetVirtualizationProvider(), nil
default:
return nil, fmt.Errorf("unsupported virtualization provider: `%s`", resolvedVMType.String())
}
}