From mboxrd@z Thu Jan 1 00:00:00 1970 From: Ian Campbell Subject: Re: [PATCH 2/5] libxl: use LIBXL_TOOLSTACK_DOMID Date: Wed, 18 Mar 2015 13:21:37 +0000 Message-ID: <1426684897.14291.25.camel@citrix.com> References: <1426242875-24446-1-git-send-email-wei.liu2@citrix.com> <1426242875-24446-3-git-send-email-wei.liu2@citrix.com> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Return-path: In-Reply-To: <1426242875-24446-3-git-send-email-wei.liu2@citrix.com> List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Sender: xen-devel-bounces@lists.xen.org Errors-To: xen-devel-bounces@lists.xen.org To: Wei Liu Cc: anthony.perard@citrix.com, stefano.stabellini@eu.citrix.com, ian.jackson@eu.citrix.com, xen-devel@lists.xen.org List-Id: xen-devel@lists.xenproject.org On Fri, 2015-03-13 at 10:34 +0000, Wei Liu wrote: > The function in question is libxl__spawn_local_dm. We should use > LIBXL_TOOLSTACK_DOMID when constructing xenstore path. > > Currently LIBXL_TOOLSTACK_DOMID is 0, so this patch introduces no > functional change. As I mentioned on the previous patch, path should come from a helper rather than repeated everywhere. > > Signed-off-by: Wei Liu > --- > tools/libxl/libxl_dm.c | 6 ++++-- > 1 file changed, 4 insertions(+), 2 deletions(-) > > diff --git a/tools/libxl/libxl_dm.c b/tools/libxl/libxl_dm.c > index 0fd5ffa..3dedad4 100644 > --- a/tools/libxl/libxl_dm.c > +++ b/tools/libxl/libxl_dm.c > @@ -1375,7 +1375,8 @@ void libxl__spawn_local_dm(libxl__egc *egc, libxl__dm_spawn_state *dmss) > free(path); > } > > - path = libxl__sprintf(gc, "/local/domain/0/device-model/%d", domid); > + path = libxl__sprintf(gc, "/local/domain/%d/device-model/%d", > + LIBXL_TOOLSTACK_DOMID, domid); > xs_mkdir(ctx->xsh, XBT_NULL, path); > > if (b_info->type == LIBXL_DOMAIN_TYPE_HVM && > @@ -1424,7 +1425,8 @@ retry_transaction: > LIBXL__LOG(CTX, XTL_DEBUG, " %s", *arg); > > spawn->what = GCSPRINTF("domain %d device model", domid); > - spawn->xspath = GCSPRINTF("/local/domain/0/device-model/%d/state", domid); > + spawn->xspath = GCSPRINTF("/local/domain/%d/device-model/%d/state", > + LIBXL_TOOLSTACK_DOMID, domid); > spawn->timeout_ms = LIBXL_DEVICE_MODEL_START_TIMEOUT * 1000; > spawn->pidpath = GCSPRINTF("%s/image/device-model-pid", dom_path); > spawn->midproc_cb = libxl__spawn_record_pid;