-
Notifications
You must be signed in to change notification settings - Fork 2.4k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
QEMU Apple Silicon: Find BIOS FD wherever #11453
QEMU Apple Silicon: Find BIOS FD wherever #11453
Conversation
LGTM (i'm using macbook air m1) |
Can you squash the commits down into one, and ensure it has a signoff? |
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: jonpspri, mheon The full list of commands accepted by this bot can be found here. The pull request process is described here
Needs approval from an approver in each of these files:
Approvers can indicate their approval by writing |
Yep, will do. Still getting the hang of the contributors guidelines. |
0731349
to
e356374
Compare
Gofmt is complaining about trailing whitespace in the comment you added. Otherwise LGTM |
@@ -15,7 +16,7 @@ func (v *MachineVM) addArchOptions() []string { | |||
"-accel", "hvf", | |||
"-cpu", "cortex-a57", | |||
"-M", "virt,highmem=off", | |||
"-drive", "file=/usr/local/share/qemu/edk2-aarch64-code.fd,if=pflash,format=raw,readonly=on", | |||
"-drive", "file=" + getEdk2CodeFd("edk2-aarch64-code.fd") + ",if=pflash,format=raw,readonly=on", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Does the Leading " + " matter here?
Wouldn't this be different then the existing code?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Not sure what you mean by "The leading plus". getEdk2CodeFd
will return either /usr/local/share/qemu/edk2-aarch64-code.fd
or /opt/homebrew/share/qemu/edk2-aarch64-code.fd
. Those get concatenated in where the full filename used to be. If it makes things clearer, I can switch to using a formatted string.
Unless you mean the diff plus... in which case it very definitely matters :).
return fullpath | ||
} | ||
} | ||
return name |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
In case if nothing is found inside loop or stat
call fails, it should default to return filepath.Join(dirs[0], name)
instead of return name
at line no 56. Otherwise default return would be edk2-aarch64-code.fd
which is not a valid path.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I followed the convention established in options_linux_arm64.go. I believe the rationale is to return a naked filename to pass to qemu
and let it deal with trying to find it or erroring out. I considered adding go-style error
returns across the package but decided instead to follow already-established patterns.
Looks like you need to run gofmt on your code to get by the test. |
@rhatdan Yes. Waiting for your response on the review question you raised about the '+' up above. Want to be sure I didn't miss something before I kick off another squash. |
e356374
to
b95d065
Compare
QEmu normally install BIOS images under `/usr/local` prefix, but Homebrew installs them under `/opt/homebrew`. This change searches both locations and then puts back to an unpathed name if it doesn't find the BIOS. (I imitated other architectures' implemenations in that failback behavior.) [NO TESTS NEEDED] Signed-off-by: Jonathan Springer <[email protected]>
b95d065
to
8b4f99a
Compare
Rebase... |
I am fine with the explanation of the " + " |
/hold cancel |
QEmu normally install BIOS images under
/usr/local
prefix, butHomebrew installs them under
/opt/homebrew
. This change searches bothlocations and then puts back to an unpathed name if it doesn't find the
BIOS. (I imitated other architectures' implemenations in that failback
behavior.)
[NO TESTS NEEDED]
Signed-off-by: Jonathan Springer [email protected]