[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[QUESTION] tools/xenstored: Best way to proceed with the protocol modification



Hello, 

(CC-ing Jürgen as the original author of the xenstored partial directory patches: https://lore.kernel.org/xen-devel/20161205074853.13268-1-jgross@xxxxxxxx/)

I'm investigating implementing XS_DIRECTORY_PART support in Oxenstored, and have come by a possible issue - the protocol specifies that the 'offset' parameter for each call is a "byte offset into the list of children", and so should be calculated on the user side. This makes sense for the C side as children are stored in a single char array separated by null characters, but OCaml stores children in a different structure, which can't be indexed into this way (but is searched more efficiently, etc.)

What's the best way to proceed here?

Could the protocol be redefined to:
1) turn the 'offset' into an opaque id that needs to be re-sent as-is on the next iteration? (it would keep being interpreted as an index into an array on the C side, and as something else on the OCaml side)
2) return the opaque 'offset' on each call alongside the string and generation id so that it wouldn't be calculated from strlen() on the user side anymore?

Thank you,
Andrii

 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.