Dan Smith
2005-Aug-05 18:53 UTC
[Xen-devel] [PATCH 1/2] Make shutdown use strings instead of codes
This patch changes the shutdown driver and xend to use strings instead of codes for signaling a shutdown request. Also, we fix the return code for the shutdown notifier, so other notifiers will get to run ;) Signed-off-by: Dan Smith <danms@us.ibm.com> -- Dan Smith IBM Linux Technology Center Open Hypervisor Team email: danms@us.ibm.com _______________________________________________ Xen-devel mailing list Xen-devel@lists.xensource.com http://lists.xensource.com/xen-devel
Mark Williamson
2005-Aug-06 02:38 UTC
Re: [Xen-devel] [PATCH 1/2] Make shutdown use strings instead of codes
On Friday 05 August 2005 19:53, Dan Smith wrote:> This patch changes the shutdown driver and xend to use strings instead > of codes for signaling a shutdown request.Thanks! + printk("Ignoring shutdown request: %s\n", str); + shutting_down = SHUTDOWN_INVALID; You missed an opportunity for a KERN_WARN or a KERN_INFO here - I notice you added them everywhere else. Cheers, Mark _______________________________________________ Xen-devel mailing list Xen-devel@lists.xensource.com http://lists.xensource.com/xen-devel
Rusty Russell
2005-Aug-06 08:17 UTC
Re: [Xen-devel] [PATCH 1/2] Make shutdown use strings instead of codes
On Fri, 2005-08-05 at 11:53 -0700, Dan Smith wrote:> This patch changes the shutdown driver and xend to use strings instead > of codes for signaling a shutdown request.Commenting on this: + unsigned int len; + + str = (char *)xenbus_read("control", "shutdown", &len); + + if (! len) { return; - }; + } xenbus_read will always nul-terminate the string it receives, and you should *never* test len as an indication of error! It should be: str = xenbus_read("control", "shutdown", NULL); if (IS_ERR(str)) return; Cheers! Rusty. -- A bad analogy is like a leaky screwdriver -- Richard Braakman _______________________________________________ Xen-devel mailing list Xen-devel@lists.xensource.com http://lists.xensource.com/xen-devel