mirror of
https://github.com/containers/podman.git
synced 2025-08-06 19:44:14 +08:00

On darwin arm64, we need to set the location of the ovmf vars. It should be put into the imageDir (also known as as dataDir). But because qemu determines the image path late in Init(), the image path is set something like a stream marker. Fixes #20361 [NO NEW TESTS NEEDED] Signed-off-by: Brent Baude <bbaude@redhat.com>
42 lines
695 B
Go
42 lines
695 B
Go
package qemu
|
|
|
|
import (
|
|
"os"
|
|
"path/filepath"
|
|
)
|
|
|
|
var (
|
|
QemuCommand = "qemu-system-aarch64"
|
|
)
|
|
|
|
func (v *MachineVM) addArchOptions(_ *setNewMachineCMDOpts) []string {
|
|
opts := []string{
|
|
"-accel", "kvm",
|
|
"-cpu", "host",
|
|
"-M", "virt,gic-version=max",
|
|
"-bios", getQemuUefiFile("QEMU_EFI.fd"),
|
|
}
|
|
return opts
|
|
}
|
|
|
|
func (v *MachineVM) prepare() error {
|
|
return nil
|
|
}
|
|
|
|
func (v *MachineVM) archRemovalFiles() []string {
|
|
return []string{}
|
|
}
|
|
|
|
func getQemuUefiFile(name string) string {
|
|
dirs := []string{
|
|
"/usr/share/qemu-efi-aarch64",
|
|
"/usr/share/edk2/aarch64",
|
|
}
|
|
for _, dir := range dirs {
|
|
if _, err := os.Stat(dir); err == nil {
|
|
return filepath.Join(dir, name)
|
|
}
|
|
}
|
|
return name
|
|
}
|