Skip to content

Conversation

freddy77
Copy link
Contributor

@freddy77 freddy77 commented Jul 2, 2024

  • Fix some typos in comments
  • Reuse String.split_on_char
  • Use Buffer.blit instead of Buffer.to_bytes + Bytes.blit
  • Use @tail_mod_cons if possible

A bit more details on series.

freddy77 added 3 commits July 2, 2024 09:18
Signed-off-by: Frediano Ziglio <frediano.ziglio@cloud.com>
Function available since Ocaml 4.05.
Use instead of split_string if possible as more efficient (not recursive).
Use split_string only if limit is provided.

Signed-off-by: Frediano Ziglio <frediano.ziglio@cloud.com>
Available since 3.11.
Avoid temporary conversion.

Signed-off-by: Frediano Ziglio <frediano.ziglio@cloud.com>
Signed-off-by: Frediano Ziglio <frediano.ziglio@cloud.com>
@@ -53,7 +53,7 @@ module Node = struct

let replace_child node child nchild =
(* this is the on-steroid version of the filter one-replace one *)
let rec replace_one_in_list l =
let[@tail_mod_cons] rec replace_one_in_list l =
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This has is recognised from OCaml 4.14 onwards, for older versions of the compiler it's ignored, so it shouldn't cause problems

Copy link
Collaborator

@edwintorok edwintorok Jul 2, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't have older compiler versions at hand to check, but godbolt confirms that the attribute is ignored by OCaml 4.04 for example: https://godbolt.org/z/zKxxGoafY
Also the CI here is testing with various versions and they all pass

Copy link
Collaborator

@edwintorok edwintorok left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

Copy link
Member

@palainp palainp left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you, this PR LGTM too! I tested with qubes-mirage-firewall and it interacts with xenstore and other AppVMs as expected.

@palainp
Copy link
Member

palainp commented Jul 4, 2024

To me it's fine to merge, I tested the client part with qubes-mirage-firewall, and the server part seems to be good according to @edwintorok and @psafont. Is there a need for cutting a release right after the merge or is it ok to wait for further improvements?

@edwintorok
Copy link
Collaborator

edwintorok commented Jul 4, 2024

I think @freddy77 has some more planned changes for the client side (partial directory listing support), so there is no rush for a new release imminently, but merging this PR would be appreciated.

@palainp palainp merged commit c36e48c into mirage:main Jul 4, 2024
psafont added a commit to psafont/opam-repository that referenced this pull request May 28, 2025
CHANGES:

* minor performance fixes (mirage/ocaml-xenstore#53 by freddy77)
* use dune 2.0 (mirage/ocaml-xenstore#54 by lindig)
* require OCaml 4.13 (mirage/ocaml-xenstore#56 by last-genius)
* Add support `XS_DIRECTORY_PART` to the client (mirage/ocaml-xenstore#55 by last-genius)
* Add x-maintenance-intent to opam  metadata (mirage/ocaml-xenstore#57 by hannesm)
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.

4 participants