All of lore.kernel.org
 help / color / mirror / Atom feed
From: Olaf Hering <olaf@aepfle.de>
To: Ian Campbell <Ian.Campbell@citrix.com>
Cc: Konrad Rzeszutek Wilk <konrad@darnok.org>,
	"xen-devel@lists.xensource.com" <xen-devel@lists.xensource.com>,
	Ian Jackson <Ian.Jackson@eu.citrix.com>,
	Stefan Bader <stefan.bader@canonical.com>,
	Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>
Subject: Re: xenbus and the message of doom
Date: Wed, 4 Jan 2012 16:57:34 +0100	[thread overview]
Message-ID: <20120104155734.GA9271@aepfle.de> (raw)
In-Reply-To: <1325588512.25206.60.camel@zakaz.uk.xensource.com>

On Tue, Jan 03, Ian Campbell wrote:

> As I said in the bit you trimmed the precedent seems to be to
> write /local/domain/<N>/control/platform-feature-<X> for each guest that
> you want to expose the feature to. I think a per-guest key makes sense
> since even if something seems obviously global you never know when you
> might need to hide it from a guest (e.g. to workaround an in-guest bug).
> 
> I'm afraid I don't have time to work on this myself but it seems pretty
> simple?

After looking at this, the (compile tested) patch below should be enough:


diff -r 3a22ed3ec534 tools/xenstore/xs.c
--- a/tools/xenstore/xs.c
+++ b/tools/xenstore/xs.c
@@ -884,6 +884,10 @@ bool xs_introduce_domain(struct xs_handl
 	char mfn_str[MAX_STRLEN(mfn)];
 	char eventchn_str[MAX_STRLEN(eventchn)];
 	struct iovec iov[3];
+	static const char feat[] = "control/platform-feature-xs_reset_watches";
+	int len;
+	char *dom_path, *feat_path;
+	bool ret;
 
 	snprintf(domid_str, sizeof(domid_str), "%u", domid);
 	snprintf(mfn_str, sizeof(mfn_str), "%lu", mfn);
@@ -896,8 +900,21 @@ bool xs_introduce_domain(struct xs_handl
 	iov[2].iov_base = eventchn_str;
 	iov[2].iov_len = strlen(eventchn_str) + 1;
 
-	return xs_bool(xs_talkv(h, XBT_NULL, XS_INTRODUCE, iov,
+	ret = xs_bool(xs_talkv(h, XBT_NULL, XS_INTRODUCE, iov,
 				ARRAY_SIZE(iov), NULL));
+
+	dom_path = xs_get_domain_path(h, domid);
+	if (dom_path) {
+		len = strlen(dom_path) + 1 + strlen(feat);
+		feat_path = malloc(len + 1);
+		if (feat_path) {
+			snprintf(feat_path, len + 1, "%s/%s", dom_path, feat);
+			xs_write(h, XBT_NULL, feat_path, "1", 1);
+			free(feat_path);
+		}
+		free(dom_path);
+	}
+	return ret;
 }
 
 bool xs_set_target(struct xs_handle *h,

  reply	other threads:[~2012-01-04 15:57 UTC|newest]

Thread overview: 24+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-12-15 19:20 xenbus and the message of doom Stefan Bader
2011-12-15 19:39 ` Konrad Rzeszutek Wilk
2011-12-15 19:45   ` Stefan Bader
2011-12-16 11:33   ` Olaf Hering
2011-12-16 15:25     ` Konrad Rzeszutek Wilk
2012-01-02  9:32       ` Stefan Bader
2011-12-20 10:11     ` Ian Campbell
2011-12-20 13:15       ` Olaf Hering
2011-12-20 14:16         ` Konrad Rzeszutek Wilk
2011-12-20 17:29           ` Ian Jackson
2011-12-20 20:19             ` Ian Campbell
2012-01-02 17:16               ` Olaf Hering
2012-01-03 11:01                 ` Ian Campbell
2012-01-04 15:57                   ` Olaf Hering [this message]
2012-01-04 16:22                     ` Ian Campbell
2012-01-04 16:27                       ` Olaf Hering
2012-01-05  9:26                         ` Ian Campbell
2012-01-05 18:43                           ` Olaf Hering
2012-01-02  9:29     ` Stefan Bader
2011-12-15 20:53 ` Ian Campbell
2011-12-16  9:18   ` Stefan Bader
2011-12-16  9:31     ` Ian Campbell
2011-12-16 17:01       ` Olaf Hering
2011-12-16 21:26         ` Alessandro Salvatori

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=20120104155734.GA9271@aepfle.de \
    --to=olaf@aepfle.de \
    --cc=Ian.Campbell@citrix.com \
    --cc=Ian.Jackson@eu.citrix.com \
    --cc=konrad.wilk@oracle.com \
    --cc=konrad@darnok.org \
    --cc=stefan.bader@canonical.com \
    --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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.