[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] Re: [Xen-devel] [PATCH] Convert shutdown to use xenstore
Rusty Russell wrote: I like this. It avoids having special case code for dom0 in all the drivers./* Only required if your code runs in dom0 as well as domU */ static int register_xenstore_notifier(struct notifier_block *notifier) { int ret = 0; down(&xenbus_lock); if (xen_start_info.evtchn) ret = notifier.notifier_call(notifier, 0, NULL); else notifier_chain_register(&xenstore_chain, nb); up(&xenbus_lock); return ret; } Implementation detail: just use the xenbus_lock rather than another lock, and make sure you hold it while traversing, not just registering! I was following kernel/cpu.c:cpu_down(). Definitely makes sense though. Regards, Anthony Liguori Rusty. _______________________________________________ Xen-devel mailing list Xen-devel@xxxxxxxxxxxxxxxxxxx http://lists.xensource.com/xen-devel
|
Lists.xenproject.org is hosted with RackSpace, monitoring our |