-
Notifications
You must be signed in to change notification settings - Fork 22
Implement client support for the XS_DIRECTORY_PART
call
#55
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
Conversation
The CI will fail for OCaml <4.13 because some newer Stdlib functions are used, do we intend to support these? |
We previously discussed that the minimum OCaml version could be bumped. I'd suggest doing that in a PR of its own and checking the Ci passes there. 4.13 is probably ok mirage/ocaml-vhd#78 (comment) |
client_unix/xs_client_unix.ml
Outdated
(* Node's children changed, restart *) | ||
if data <> "" && new_generation <> generation then read_part "" "" | ||
else | ||
let data = data ^ new_data 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.
For efficiency it would be better to collect all strings in a list and do a String.concat
or to use a Buffer
value.
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.
Switched to using a Buffer
in the fixup commit.
01b9eb8
to
8412de5
Compare
8412de5
to
31c85ea
Compare
I've addressed the comments, and tested this. If the fixup looks good, I can squash it and we can merge this. |
@psafont would you mind merging this? |
Signed-off-by: Andrii Sultanov <andrii.sultanov@cloud.com>
Signed-off-by: Frediano Ziglio <frediano.ziglio@cloud.com>
Storage should not order the entries, check it adding in not alphabetical order Signed-off-by: Frediano Ziglio <frediano.ziglio@cloud.com>
Since call IDs are encoded in C as enum variants, the removal of Restrict created a hole that should be treated as an error. Oxenstored treats it as an Invalid variant, so follow that practice here as well. Signed-off-by: Andrii Sultanov <andrii.sultanov@cloud.com>
Also add Reset_watches call that has been added upstream - currently unimplemented. It needs to be present so as not to leave a hole in call IDs. Server implementation is a noop as well. Co-authored-by: Andrii Sultanov <andrii.sultanov@cloud.com> Signed-off-by: Andrii Sultanov <andrii.sultanov@cloud.com> Signed-off-by: Frediano Ziglio <frediano.ziglio@cloud.com>
31c85ea
to
dd8845d
Compare
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)
Adds the partial directory call to
client_unix
. Server implementation is available in xapi-project/oxenstored#2, so wasn't attempted here.Also removes the deprecated Restrict call, and brings some minor improvements elsewhere.
Thanks to @freddy77 for working on this.
Changes were tested with the server implementation above, with the client coping well with large directories without having to utilize larger packets.