It might be perfectly fine not to have a control/shutdown Xenstore
node. If this is the case, don't crash, but just terminate the
shutdown thread after issuing a message that shutdown isn't available.
In fini_shutdown() clearing the watch can result in an error now, in
case the early exit above was taken. Just ignore this error now.
Signed-off-by: Juergen Gross <jgross@suse.com>
Reviewed-by: Jason Andryuk <jandryuk@gmail.com>
xenbus_wait_for_watch(&events);
if ((err = xenbus_read(XBT_NIL, path, &shutdown))) {
free(err);
- do_exit();
+ free(xenbus_unwatch_path_token(XBT_NIL, path, token));
+ printk("Shutdown Xenstore node not available.\n");
+ return;
}
if (end_shutdown_thread)
void fini_shutdown(void)
{
- char *err;
-
end_shutdown_thread = 1;
xenbus_release_wait_for_watch(&events);
- err = xenbus_unwatch_path_token(XBT_NIL, path, token);
- if (err) {
- free(err);
- do_exit();
- }
+ free(xenbus_unwatch_path_token(XBT_NIL, path, token));
}
#endif