-
Notifications
You must be signed in to change notification settings - Fork 4
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
Make the crate independent of xenstore C library #23
Conversation
0083138
to
86cc523
Compare
2e77900
to
49a5774
Compare
I think it is good for now, there is some stuff that could be improved for the future : It would be useful to have a interface to xenstore management commands ( We can make the tokio implementation runtime-agnostic by relying only on We can do a similar thing with the synchronous implementation with a wrapper for some And if we need it, have a implementation for transactions. |
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.
Overall LGTM
Thanks for the effort !
We can continue iterating on the design in future PRs as this one is already introducting a lot of changes.
Can you fix the CI (formatting) ?
Make Xs a trait that define the XenStore API. Add auxiliary traits for additional features. Expose a async variant of Xs ((Local)AsyncXs), including watch ((Local)XsAsyncWatch). Provide a standard library based implementation of Xs for Dom0 and DomU. (Unix platforms only) Signed-off-by: Teddy Astie <teddy.astie@vates.tech>
Provide a tokio-based AsyncXs implementation. This feature is guarded behind "async-tokio" feature. It uses a underlying task that multiplexes the xenstore accesses and interacted by a channel under the hood. XsTokio can be cloned and is Sync/Send for concurrent accesses to XenStore and provides watch support. Signed-off-by: Teddy Astie <teddy.astie@vates.tech>
Add a example code that uses tokio instead of std implementation. Signed-off-by: Teddy Astie <teddy.astie@vates.tech>
Needs --all-features to build/test with tokio. Needed for cargo test to not fail on xenstore-cli-async. Signed-off-by Teddy Astie <teddy.astie@vates.tech>
Fix possible deadlock when dropping multiples watchers that can clobber the channel thus actually blocking "send_blocking" in watcher Drop. Signed-off-by: Teddy Astie <teddy.astie@vates.tech>
I think that will make the life easier for xenstore crate users (especially those that were using the old version) Signed-off-by: Teddy Astie <teddy.astie@vates.tech>
xenstore doesn't require WRITE values to contain the NUL character, if one is added to the payload, it will appear in xenstore. Signed-off-by Teddy Astie <teddy.astie@vates.tech>
Signed-off-by Teddy Astie <teddy.astie@vates.tech>
Add a pure rust xenstore implementation to replace the C binding.
xenstore is exposed to useland by two interfaces :
/run/xenstored/socket
)/dev/xen/xenbus
device (or(deprecated path)) (or another platform specific path)/proc/xen/xenbus
(depending on whether the domain hosts xenstored or not)
Those two interfaces follow a same protocol as defined in xs_wire.h 1 and xenstore.txt 2 using regular read/write syscalls.
Implement this protocol using pure-Rust and standard library and replace the C binding by this implementation.