WARNING - OLD ARCHIVES

This is an archived copy of the Xen.org mailing list, which we have preserved to ensure that existing links to archives are not broken. The live archive, which contains the latest emails, can be found at http://lists.xen.org/
   
 
 
Xen 
 
Home Products Support Community News
 
   
 

xen-devel

Re: [Xen-devel] [PATCH 1/3] xen/pv-on-hvm kexec: add xs_introduce to shu

To: Olaf Hering <olaf@xxxxxxxxx>
Subject: Re: [Xen-devel] [PATCH 1/3] xen/pv-on-hvm kexec: add xs_introduce to shutdown watches from old kernel
From: Ian Campbell <Ian.Campbell@xxxxxxxxxx>
Date: Tue, 9 Aug 2011 10:15:18 +0100
Cc: Jeremy Fitzhardinge <jeremy@xxxxxxxx>, "xen-devel@xxxxxxxxxxxxxxxxxxx" <xen-devel@xxxxxxxxxxxxxxxxxxx>, "linux-kernel@xxxxxxxxxxxxxxx" <linux-kernel@xxxxxxxxxxxxxxx>, Konrad <konrad.wilk@xxxxxxxxxx>
Delivery-date: Tue, 09 Aug 2011 02:16:09 -0700
Envelope-to: www-data@xxxxxxxxxxxxxxxxxxx
In-reply-to: <20110804162054.096018606@xxxxxxxxx>
List-help: <mailto:xen-devel-request@lists.xensource.com?subject=help>
List-id: Xen developer discussion <xen-devel.lists.xensource.com>
List-post: <mailto:xen-devel@lists.xensource.com>
List-subscribe: <http://lists.xensource.com/mailman/listinfo/xen-devel>, <mailto:xen-devel-request@lists.xensource.com?subject=subscribe>
List-unsubscribe: <http://lists.xensource.com/mailman/listinfo/xen-devel>, <mailto:xen-devel-request@lists.xensource.com?subject=unsubscribe>
Organization: Citrix Systems, Inc.
References: <20110804162053.723541930@xxxxxxxxx> <20110804162054.096018606@xxxxxxxxx>
Sender: xen-devel-bounces@xxxxxxxxxxxxxxxxxxx
> Index: linux-3.0/drivers/xen/xenbus/xenbus_xs.c
> ===================================================================
> --- linux-3.0.orig/drivers/xen/xenbus/xenbus_xs.c
> +++ linux-3.0/drivers/xen/xenbus/xenbus_xs.c
> @@ -620,6 +620,20 @@ static struct xenbus_watch *find_watch(c
>       return NULL;
>  }
>  
> +static int xs_introduce(const char *domid, const char *mfn, const char *port)
> +{
> +     struct kvec iov[3];
> +
> +     iov[0].iov_base = (char *)domid;
> +     iov[0].iov_len = strlen(domid) + 1;
> +     iov[1].iov_base = (char *)mfn;
> +     iov[1].iov_len = strlen(mfn) + 1;
> +     iov[2].iov_base = (char *)port;
> +     iov[2].iov_len = strlen(port) + 1;
> +
> +     return xs_error(xs_talkv(XBT_NIL, XS_INTRODUCE, iov,
> +                              ARRAY_SIZE(iov), NULL));

What should we do if this fails?

> +}
>  /* Register callback to watch this node. */
>  int register_xenbus_watch(struct xenbus_watch *watch)
>  {
> @@ -867,10 +881,11 @@ static int xenbus_thread(void *unused)
>       return 0;
>  }
>  
> -int xs_init(void)
> +int xs_init(unsigned long xen_store_mfn)
>  {
>       int err;
>       struct task_struct *task;
> +     char domid[12], mfn[24], port[24];
>  
>       INIT_LIST_HEAD(&xs_state.reply_list);
>       spin_lock_init(&xs_state.reply_lock);
> @@ -897,5 +912,15 @@ int xs_init(void)
>       if (IS_ERR(task))
>               return PTR_ERR(task);
>  
> +     snprintf(domid, sizeof(domid), "%u", DOMID_SELF);
> +     snprintf(mfn, sizeof(mfn), "%lu", xen_store_mfn);
> +     snprintf(port, sizeof(port), "%d", xen_store_evtchn);

These can be within the if, or better within the xs_introduce function
itself.

> +     if (xen_hvm_domain()) {
> +             /* shutdown watches for kexec boot */
> +             err = xs_introduce(domid, mfn, port);
> +             if (err)
> +                     printk(KERN_WARNING "xs_introduce failed: %d\n", err);
> +     }
> +
>       return 0;
>  }
> 
> 
> _______________________________________________
> Xen-devel mailing list
> Xen-devel@xxxxxxxxxxxxxxxxxxx
> http://lists.xensource.com/xen-devel



_______________________________________________
Xen-devel mailing list
Xen-devel@xxxxxxxxxxxxxxxxxxx
http://lists.xensource.com/xen-devel