[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [Xen-devel] Xenstore watch interface in the kernel
While working on the Linux xenbus kernel driver I stumbled over a rather strange interface: a Xenstore watch event is delivered via a callback defined as: void (*callback)(struct xenbus_watch *, const char **vec, unsigned int len); vec is an array of strings and len the number of strings in that array. Looking at the Xenstore interface I don't see how there could ever be an array with another len than 2 be presented (the first string being the modified path, the second the token specified when registering the watch). I'd like to modify the callback's prototype to: void (*callback)(struct xenbus_watch *, const char *path, const char *token); This would make it easier to avoid some memory allocation when reading a Xenstore reply, as in case of a watch event I'd know how many strings are expected. Is there any reason not to change the interface in the kernel? BTW: The handling of more than 2 strings as watch event parameters is even repeated in the interface to libxenstore. I looked through the Xen sources and could find no use of the number of strings returned in case of a watch event. While we can't change the interface of libxenstore I don't think we have to be prepared for an arbitrary number of strings for a watch event at the kernel interface. Juergen _______________________________________________ Xen-devel mailing list Xen-devel@xxxxxxxxxxxxx https://lists.xen.org/xen-devel
|
Lists.xenproject.org is hosted with RackSpace, monitoring our |