Skip to content
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

Merged
merged 8 commits into from
Jun 2, 2017
Merged

Cleanup and remove verbosity #17

merged 8 commits into from
Jun 2, 2017

Conversation

mato
Copy link
Contributor

@mato mato commented Jun 2, 2017

General cleanup of the mirage-solo5 code. Removes the unnecessary Solo5: 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

File "lib/time.ml", line 54, characters 2-17:
Warning 3: deprecated: module Lwt_pqueue
 This module is an implementation detail of Lwt. See
   http://ocsigen.org/lwt/dev/api/Lwt_pqueue

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?

@mato
Copy link
Contributor Author

mato commented Jun 2, 2017

/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
Copy link
Member

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).

@samoht
Copy link
Member

samoht commented Jun 2, 2017

The OCaml side LGTM appart one comment (I haven't looked at the C bindings very closely).

mato added 8 commits June 2, 2017 12:47
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.
@mato mato force-pushed the remove-verbosity branch from dad12ad to 5f11de5 Compare June 2, 2017 10:48
@mato
Copy link
Contributor Author

mato commented Jun 2, 2017

@samoht Rebased and addressed your comments. Thanks!

@mato mato merged commit 54bda73 into mirage:master Jun 2, 2017
@mato mato deleted the remove-verbosity branch June 2, 2017 14:04
const char *str = String_val(arg);
solo5_console_write(str, strlen(str));

solo5_console_write(String_val(arg), caml_string_length(arg));
Copy link
Member

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.

@hannesm
Copy link
Member

hannesm commented Jun 4, 2017

LGTM! thanks!

kit-ty-kate pushed a commit to kit-ty-kate/mirage-solo5 that referenced this pull request Oct 6, 2022
opam: Sync metadata with ocaml/opam-repository
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants