|
|
|
|
|
|
|
|
|
|
xen-devel
Re: [Xen-devel] [PATCH] Convert shutdown to use xenstore
Rusty Russell wrote:
/* 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;
}
I like this. It avoids having special case code for dom0 in all the
drivers.
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
|
|
|
|
|