Skip to content

Commit

Permalink
Merge pull request #18677 from openshift-cherrypick-robot/cherry-pick…
Browse files Browse the repository at this point in the history
…-18322-to-v4.5

[v4.5] Revert "Resolve symlink path for qemu directory if possible"
  • Loading branch information
openshift-merge-robot authored May 25, 2023
2 parents bcc68fc + b1281ae commit 5e72d7d
Showing 1 changed file with 6 additions and 16 deletions.
22 changes: 6 additions & 16 deletions pkg/machine/qemu/options_darwin_arm64.go
Original file line number Diff line number Diff line change
Expand Up @@ -46,23 +46,13 @@ func getOvmfDir(imagePath, vmName string) string {
*/
func getEdk2CodeFdPathFromQemuBinaryPath() string {
cfg, err := config.Default()
if err != nil {
return ""
}
execPath, err := cfg.FindHelperBinary(QemuCommand, true)
if err != nil {
return ""
}

sharePath := func(path string) string {
return filepath.Clean(filepath.Join(filepath.Dir(path), "..", "share", "qemu"))
}

symlinkedPath, err := filepath.EvalSymlinks(execPath)
if err != nil {
return sharePath(execPath)
if err == nil {
execPath, err := cfg.FindHelperBinary(QemuCommand, true)
if err == nil {
return filepath.Clean(filepath.Join(filepath.Dir(execPath), "..", "share", "qemu"))
}
}
return sharePath(symlinkedPath)
return ""
}

/*
Expand Down

0 comments on commit 5e72d7d

Please sign in to comment.