Skip to content

Commit

Permalink
podman machine 5 - hyperv
Browse files Browse the repository at this point in the history
this pr represents the podman 5 maching refactoring for HyperV.  with
the exception of already skipped tests, all local tests pass.

Signed-off-by: Brent Baude <bbaude@redhat.com>
  • Loading branch information
baude authored and Brent Baude committed Feb 5, 2024
1 parent 2e95664 commit 268743a
Show file tree
Hide file tree
Showing 20 changed files with 737 additions and 1,373 deletions.
4 changes: 2 additions & 2 deletions .cirrus.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ env:
#### Global variables used for all tasks
####
# Name of the ultimate destination branch for this CI run, PR or post-merge.
DEST_BRANCH: "main"
DEST_BRANCH: "machine-dev-5"
# Sane (default) value for GOPROXY and GOSUMDB.
GOPROXY: "https://proxy.golang.org,direct"
GOSUMDB: "sum.golang.org"
Expand Down Expand Up @@ -1098,7 +1098,7 @@ success_task:
- rootless_integration_test
- podman_machine
- podman_machine_aarch64
- podman_machine_windows
#- podman_machine_windows
# TODO: Issue #20853; Tests mostly fail then timeout after an hour.
# - podman_machine_mac
- local_system_test
Expand Down
1 change: 0 additions & 1 deletion cmd/podman/machine/init.go
Original file line number Diff line number Diff line change
Expand Up @@ -190,7 +190,6 @@ func initMachine(cmd *cobra.Command, args []string) error {
// return err
// }

// TODO this is for QEMU only (change to generic when adding second provider)
mc, err := shim.Init(initOpts, provider)
if err != nil {
return err
Expand Down
14 changes: 11 additions & 3 deletions pkg/machine/applehv/stubber.go
Original file line number Diff line number Diff line change
Expand Up @@ -287,15 +287,15 @@ func (a AppleHVStubber) StartVM(mc *vmconfigs.MachineConfig) (func() error, func
return cmd.Process.Release, returnFunc, nil
}

func (a AppleHVStubber) StopHostNetworking() error {
// TODO implement me
panic("implement me")
func (a AppleHVStubber) StopHostNetworking(_ *vmconfigs.MachineConfig, _ define.VMType) error {
return nil
}

func (a AppleHVStubber) VMType() define.VMType {
return define.AppleHvVirt
}


func waitForGvProxy(gvproxySocket *define.VMFile) error {
backoffWait := gvProxyWaitBackoff
logrus.Debug("checking that gvproxy is running")
Expand All @@ -309,3 +309,11 @@ func waitForGvProxy(gvproxySocket *define.VMFile) error {
}
return fmt.Errorf("unable to connect to gvproxy %q", gvproxySocket.GetPath())
}

func (a AppleHVStubber) PrepareIgnition(_ *vmconfigs.MachineConfig, _ *ignition.IgnitionBuilder) (*ignition.ReadyUnitOpts, error) {
return nil, nil
}

func (a AppleHVStubber) PostStartNetworking(mc *vmconfigs.MachineConfig) error {
return nil
}
2 changes: 1 addition & 1 deletion pkg/machine/applehv/vfkit.go
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ func getIgnitionVsockDevice(path string) (vfConfig.VirtioDevice, error) {
return vfConfig.VirtioVsockNew(1024, path, true)
}

func virtIOFsToVFKitVirtIODevice(mounts []vmconfigs.Mount) ([]vfConfig.VirtioDevice, error) {
func virtIOFsToVFKitVirtIODevice(mounts []*vmconfigs.Mount) ([]vfConfig.VirtioDevice, error) {
var virtioDevices []vfConfig.VirtioDevice
for _, vol := range mounts {
virtfsDevice, err := vfConfig.VirtioFsNew(vol.Source, vol.Tag)
Expand Down
16 changes: 0 additions & 16 deletions pkg/machine/e2e/config_windows_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,26 +4,10 @@ import (
"fmt"
"os/exec"
"strings"

"github.com/containers/podman/v4/pkg/machine"
"github.com/containers/podman/v4/pkg/machine/define"
"github.com/containers/podman/v4/pkg/machine/wsl"
. "github.com/onsi/ginkgo/v2"
)

const podmanBinary = "../../../bin/windows/podman.exe"

func getDownloadLocation(p machine.VirtProvider) string {
if p.VMType() == define.HyperVVirt {
return getFCOSDownloadLocation(p)
}
fd, err := wsl.NewFedoraDownloader(define.WSLVirt, "", defaultStream.String())
if err != nil {
Fail("unable to get WSL virtual image")
}
return fd.Get().URL.String()
}

// pgrep emulates the pgrep linux command
func pgrep(n string) (string, error) {
// add filter to find the process and do no display a header
Expand Down
Loading

0 comments on commit 268743a

Please sign in to comment.