From mboxrd@z Thu Jan 1 00:00:00 1970 From: aq Subject: Re: [PATCH] Convert shutdown to use xenstore Date: Fri, 5 Aug 2005 12:58:51 +0900 Message-ID: <9cde8bff050804205857e191e4@mail.gmail.com> References: Reply-To: aq Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable Return-path: In-Reply-To: Content-Disposition: inline List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Sender: xen-devel-bounces@lists.xensource.com Errors-To: xen-devel-bounces@lists.xensource.com To: Dan Smith Cc: xen-devel@lists.xensource.com List-Id: xen-devel@lists.xenproject.org On 8/5/05, Dan Smith wrote: > The attached patch: >=20 > 1. Converts the shutdown driver and xend to use the store instead of > control messages, >=20 > 2. Includes Anthony's xenstore notification code, and >=20 > 3. Changes xend so that sysrq's are no longer sent as "special case" > shutdown messages. Store keys are cheap, so making the sysrq > delivery less obscure is good. >=20 +static int setup_shutdown_watcher(struct notifier_block *notifier, + unsigned long event, + void *data) +{ + int err1=3D0, err2=3D0; + + down(&xenbus_lock); + err1 =3D register_xenbus_watch(&shutdown_watch); +#ifdef CONFIG_MAGIC_SYSRQ + err2 =3D register_xenbus_watch(&sysrq_watch); +#endif + up(&xenbus_lock); + + if (err1) { + printk("Failed to set shutdown watcher\n"); + } How about putting declaration of err2 inside a "#ifdef CONFIG_MAGIC_SYSRQ" = ? Besides i think some printk should use KERN_ERR to report error properly. regards, aq