-
Notifications
You must be signed in to change notification settings - Fork 2.4k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
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 <[email protected]> [NO NEW TESTS NEEDED] Signed-off-by: Brent Baude <[email protected]>
- Loading branch information
Showing
16 changed files
with
1,308 additions
and
38 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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()) | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.