[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] Re: [QUESTION] tools/xenstored: Best way to proceed with the protocol modification
On 30.10.24 12:58, Andrii Sultanov wrote: 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/ <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? As libxenstore is calculating the offset based on the length of the returned result of the previous call and then using this value for the next iteration, there is no way "offset" could be redefined to be an opaque handle with a different value than today. Modifying the output format isn't possible either, as we have no control over all clients using the current format. So you need to comply with the current interface. Juergen Attachment:
OpenPGP_0xB0DE9DD628BF132F.asc Attachment:
OpenPGP_signature.asc
|
Lists.xenproject.org is hosted with RackSpace, monitoring our |