Skip to content

Commit

Permalink
Merge pull request #25155 from baude/movedetect
Browse files Browse the repository at this point in the history
Move detection of libkrun and intel
  • Loading branch information
openshift-merge-bot[bot] authored Jan 30, 2025
2 parents 357fd25 + 398377f commit 48f8742
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 5 deletions.
5 changes: 0 additions & 5 deletions cmd/podman/machine/machine.go
Original file line number Diff line number Diff line change
Expand Up @@ -8,15 +8,13 @@ import (
"os"
"path/filepath"
"regexp"
"runtime"
"strings"
"sync"
"time"

"github.com/containers/podman/v5/cmd/podman/registry"
"github.com/containers/podman/v5/cmd/podman/validate"
"github.com/containers/podman/v5/libpod/events"
"github.com/containers/podman/v5/pkg/machine/define"
"github.com/containers/podman/v5/pkg/machine/env"
provider2 "github.com/containers/podman/v5/pkg/machine/provider"
"github.com/containers/podman/v5/pkg/machine/vmconfigs"
Expand Down Expand Up @@ -59,9 +57,6 @@ func machinePreRunE(c *cobra.Command, args []string) error {
if err != nil {
return err
}
if provider.VMType() == define.LibKrun && runtime.GOARCH == "amd64" {
return errors.New("libkrun is not supported on Intel based machines. Please revert to the applehv provider")
}
return rootlessOnly(c, args)
}

Expand Down
4 changes: 4 additions & 0 deletions pkg/machine/provider/platform_darwin.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ package provider

import (
"bytes"
"errors"
"fmt"
"os"
"os/exec"
Expand Down Expand Up @@ -36,6 +37,9 @@ func Get() (vmconfigs.VMProvider, error) {
case define.AppleHvVirt:
return new(applehv.AppleHVStubber), nil
case define.LibKrun:
if runtime.GOARCH == "amd64" {
return nil, errors.New("libkrun is not supported on Intel based machines. Please revert to the applehv provider")
}
return new(libkrun.LibKrunStubber), nil
default:
return nil, fmt.Errorf("unsupported virtualization provider: `%s`", resolvedVMType.String())
Expand Down

0 comments on commit 48f8742

Please sign in to comment.