-
Notifications
You must be signed in to change notification settings - Fork 21
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
Cleanup and remove verbosity #17
Conversation
/cc @ricarkol |
lib/lifecycle.ml
Outdated
@@ -1,3 +1,5 @@ | |||
(* No shutdown events on Solo5. *) | |||
let await_shutdown_request ?(can_poweroff:_) ?(can_reboot:_) () = | |||
let _poweroff = can_poweroff in | |||
let _rebooot = can_reboot in |
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.
It would be better to write:
let await_shutdown_request ?can_poweroff:_ ?can_reboot:_ () =
e.g. the current form ignore the type, but what you want is ignoring the values (yes, that syntax is confusing).
The OCaml side LGTM appart one comment (I haven't looked at the C bindings very closely). |
Fix deprecation warning.
solo5_console_write() handles null bytes so no need to do strlen() here, just ask OCaml for the string length in bytes and pass that directly.
Formatting and more explicit if() chains. No functional change intended.
Not removing 4.02 for now since that would require an OPAM constraint and the package still builds with that version.
@samoht Rebased and addressed your comments. Thanks! |
const char *str = String_val(arg); | ||
solo5_console_write(str, strlen(str)); | ||
|
||
solo5_console_write(String_val(arg), caml_string_length(arg)); |
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.
while your PR didn't change anything, I want to raise the issue that stub_console_write
ignores the returned number of bytes written here -- see mirage/mirage-flow#4 (comment) for some more detail. I suspect we want stub_console_write
to return an int
, and loop until all the bytes are written.
LGTM! thanks! |
opam: Sync metadata with ocaml/opam-repository
General cleanup of the
mirage-solo5
code. Removes the unnecessarySolo5: new bindings
message, cleans up formatting of other aborts/errors.I've also cleaned up some of the stubs (removing dead/unused/debug code) and fixed all the OCaml warnings with the exception of
Could someone with more OCaml/Lwt chops than me give this a quick review and verify that I've not broken anything? @hannesm / @samoht perhaps?