From: Ian Campbell Subject: Re: xenbus and the message of doom Date: Wed, 4 Jan 2012 16:22:04 +0000 Message-ID: <1325694125.25206.299.camel@zakaz.uk.xensource.com> References: <4EEA4877.8010307@canonical.com> <20111215193942.GA7640@andromeda.dapyr.net> <20111216113300.GA4854@aepfle.de> <1324375910.23729.31.camel@zakaz.uk.xensource.com> <20111220131533.GA7800@aepfle.de> <20111220141612.GA25139@konrad-lan> <20208.50657.799146.57017@mariner.uk.xensource.com> <1324412394.8252.163.camel@dagon.hellion.org.uk> <20120102171631.GA13603@aepfle.de> <1325588512.25206.60.camel@zakaz.uk.xensource.com> <20120104155734.GA9271@aepfle.de> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Return-path: In-Reply-To: <20120104155734.GA9271@aepfle.de> List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Sender: xen-devel-bounces@lists.xensource.com Errors-To: xen-devel-bounces@lists.xensource.com To: Olaf Hering Cc: Konrad Rzeszutek Wilk , "xen-devel@lists.xensource.com" , Ian Jackson , Stefan Bader , Konrad Rzeszutek Wilk List-Id: xen-devel@lists.xenproject.org On Wed, 2012-01-04 at 15:57 +0000, Olaf Hering wrote: > On Tue, Jan 03, Ian Campbell wrote: > > > As I said in the bit you trimmed the precedent seems to be to > > write /local/domain//control/platform-feature- 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 I think the toolstack needs to be involved with this. IOW this should be done in libxl__domain_make() around the same place as control/platform-feature-multiprocessor-suspend is written. Ian. > @@ -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,