From 6014f26c4744acc98a1e109e5e77eb2302fec6c9 Mon Sep 17 00:00:00 2001 From: Nathan Henrie Date: Mon, 24 Apr 2023 08:59:13 -0600 Subject: [PATCH] Revert "Resolve symlink path for qemu directory if possible" This reverts commit 6b6458916eaa51f0dbbcfeccd740706697697ad3 (Resolve symlink path for qemu directory if possible). Fully resolving the symlink to qemu solves some issues for aarch64-darwin nix with regards to finding `edk2-aarch64-code.fd`, but unfortunately the fully resolved path includes the version number, making it so that even patch updates break the path to homebrew-installed qemu files. Fixes https://github.com/containers/podman/issues/18111 [NO NEW TESTS NEEDED] Signed-off-by: Nathan Henrie --- pkg/machine/qemu/options_darwin_arm64.go | 22 ++++++---------------- 1 file changed, 6 insertions(+), 16 deletions(-) diff --git a/pkg/machine/qemu/options_darwin_arm64.go b/pkg/machine/qemu/options_darwin_arm64.go index e9c0c5ab42..d75237938a 100644 --- a/pkg/machine/qemu/options_darwin_arm64.go +++ b/pkg/machine/qemu/options_darwin_arm64.go @@ -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 "" } /*