Use of otherend field in xenbus_device

classic Classic list List threaded Threaded
1 message Options
Reply | Threaded
Open this post in threaded view

Use of otherend field in xenbus_device

Harry Butterworth

    My USB code is failing to unregister its watch correctly because
when it registers the watch it sets the watch.node to use the otherend
string in the xenbus_device and this string is freed in
xenbus_dev_remove before my driver's remove function is called to
unregister the watch.

    Using the otherend string directly during suspend and resume also
looks dodgy because the string is changed before resume is called and
resume unregisters the old watch.

    I think I either have to make a local copy of the string which my
driver can hang onto until after the watch is unregistered or I have to
change the xenbus_probe code such that the lifetime of the string spans
probe<->suspend and resume<->remove and probe<->remove.  In the latter
case I'd also have to change my code such that the watch was
unregistered on suspend and registered on resume rather than
unregistered and re-registered in resume.

    Was your intent here for drivers to make a copy of this string if
they needed it or for them to use the xenbus_device one?  For the time
being I'm going to go with making a local copy of the string.  Please
let me know if this is the wrong approach.



Xen-devel mailing list
[hidden email]