From: Ian Campbell <Ian.Campbell@citrix.com>
To: Olaf Hering <olaf@aepfle.de>
Cc: "linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>,
"Jeremy Fitzhardinge" <jeremy@goop.org>,
Konrad <konrad.wilk@oracle.com>,
"xen-devel@lists.xensource.com" <xen-devel@lists.xensource.com>
Subject: Re: [Xen-devel] [PATCH 1/3] xen/pv-on-hvm kexec: add xs_introduce to shutdown watches from old kernel
Date: Tue, 9 Aug 2011 10:15:18 +0100 [thread overview]
Message-ID: <1312881318.26263.44.camel@zakaz.uk.xensource.com> (raw)
In-Reply-To: <20110804162054.096018606@aepfle.de>
> 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@lists.xensource.com
> http://lists.xensource.com/xen-devel
next prev parent reply other threads:[~2011-08-09 9:15 UTC|newest]
Thread overview: 15+ messages / expand[flat|nested] mbox.gz Atom feed top
2011-08-04 16:20 [PATCH 0/3] [v4] kexec and kdump for Xen PVonHVM guests Olaf Hering
2011-08-04 16:20 ` [PATCH 1/3] xen/pv-on-hvm kexec: add xs_introduce to shutdown watches from old kernel Olaf Hering
2011-08-09 9:15 ` Ian Campbell [this message]
2011-08-09 9:28 ` [Xen-devel] " Olaf Hering
2011-08-04 16:20 ` [PATCH 2/3] xen/pv-on-hvm kexec: rebind virqs to existing eventchannel ports Olaf Hering
2011-08-09 9:17 ` [Xen-devel] " Ian Campbell
2011-08-09 9:29 ` Olaf Hering
2011-08-09 11:25 ` Ian Campbell
2011-08-09 15:28 ` Olaf Hering
2011-08-09 18:51 ` Konrad Rzeszutek Wilk
2011-08-04 16:20 ` [PATCH 3/3] xen/pv-on-hvm kexec+kdump: reset PV devices in kexec or crash kernel Olaf Hering
2011-08-09 9:23 ` [Xen-devel] " Ian Campbell
2011-08-09 9:44 ` Olaf Hering
2011-08-09 11:26 ` Ian Campbell
2011-08-09 19:02 ` [Xen-devel] [PATCH 0/3] [v4] kexec and kdump for Xen PVonHVM guests Konrad Rzeszutek Wilk
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1312881318.26263.44.camel@zakaz.uk.xensource.com \
--to=ian.campbell@citrix.com \
--cc=jeremy@goop.org \
--cc=konrad.wilk@oracle.com \
--cc=linux-kernel@vger.kernel.org \
--cc=olaf@aepfle.de \
--cc=xen-devel@lists.xensource.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®