Skip to content

Commit

Permalink
Merge pull request #375 from stgraber/qemu
Browse files Browse the repository at this point in the history
  • Loading branch information
tych0 authored Jan 8, 2024
2 parents 07b556d + a4266dc commit 066db5a
Showing 1 changed file with 14 additions and 1 deletion.
15 changes: 14 additions & 1 deletion internal/server/instance/drivers/driver_qemu.go
Original file line number Diff line number Diff line change
Expand Up @@ -8306,7 +8306,20 @@ func (d *qemu) checkFeatures(hostArch int, qemuPath string) (map[string]any, err
}

if d.architectureSupportsUEFI(hostArch) {
qemuArgs = append(qemuArgs, "-drive", fmt.Sprintf("if=pflash,format=raw,readonly=on,file=%s", filepath.Join(d.ovmfPath(), "OVMF_CODE.fd")))
// Try to locate a UEFI firmware.
var ovmfPath string
for _, entry := range ovmfGenericFirmwares {
if util.PathExists(filepath.Join(d.ovmfPath(), entry.code)) {
ovmfPath = filepath.Join(d.ovmfPath(), entry.code)
break
}
}

if ovmfPath == "" {
return nil, fmt.Errorf("Unable to locate a UEFI firmware")
}

qemuArgs = append(qemuArgs, "-drive", fmt.Sprintf("if=pflash,format=raw,readonly=on,file=%s", ovmfPath))
}

var stderr bytes.Buffer
Expand Down

0 comments on commit 066db5a

Please sign in to comment.