xen-devel.lists.xenproject.org archive mirror
 help / color / mirror / Atom feed
From: Ian Jackson <ian.jackson@eu.citrix.com>
To: Wei Liu <wei.liu2@citrix.com>
Cc: Xen-devel <xen-devel@lists.xenproject.org>
Subject: Re: [PATCH v2 6/7] libxenstat: honour XEN_RUN_DIR
Date: Mon, 15 Aug 2016 11:48:34 +0100	[thread overview]
Message-ID: <22449.40450.393800.756794@mariner.uk.xensource.com> (raw)
In-Reply-To: <20160720144820.GD28784@citrix.com>

Wei Liu writes ("Re: [PATCH v2 6/7] libxenstat: honour XEN_RUN_DIR"):
> On Wed, Jul 20, 2016 at 03:40:56PM +0100, Ian Jackson wrote:
> > Wei Liu writes ("[PATCH v2 6/7] libxenstat: honour XEN_RUN_DIR"):
> > > Backport candidate.
> > 
> > Thanks.  Can you let me know when it's applied to staging ?
> 
> $ git describe --contains eb141d23a00a349dc1474bb982e7812fc091f845
> 4.6.0-rc1~844
> 
> So backport to 4.6 and 4.7.

I have applied it to staging-4.7, as ab75cdf.  In staging-4.6 I had to
fix it up, which was easy.  See below.

From 77a9be97f5238a48f2b73b145c0a7ceaef22e0d6 Mon Sep 17 00:00:00 2001
From: Wei Liu <wei.liu2@citrix.com>
Date: Mon, 11 Jul 2016 18:28:08 +0100
Subject: [PATCH] libxenstat: honour XEN_RUN_DIR

This is because libxl uses XEN_RUN_DIR to generate the socket path for
libxenstat while libxenstat itself uses hard-coded path, which is not
necessarily the same path as XEN_RUN_DIR.  The default configuration
happened to work because XEN_RUN_DIR defaulted to /var/run/xen, which
matched the hard-coded path.

We should make libxenstat use XEN_RUN_DIR so that it works with
non-default configuration.

Generate a _paths.h because it is required to make this change work.

Signed-off-by: Wei Liu <wei.liu2@citrix.com>
Acked-by: Ian Jackson <ian.jackson@eu.citrix.com>
(cherry picked from commit dedb221889dbdd96f1d3c1155c3eb492d329bb53)

(cherry picked from commit ab75cdf635da31012f822260c607f5b4ceaf7668)
Conflicts:
	tools/xenstat/libxenstat/src/xenstat_qmp.c
Signed-off-by: Ian Jackson <ian.jackson@eu.citrix.com>
---
 .gitignore                                 | 1 +
 tools/xenstat/libxenstat/Makefile          | 7 ++++++-
 tools/xenstat/libxenstat/src/xenstat_qmp.c | 3 ++-
 3 files changed, 9 insertions(+), 2 deletions(-)

diff --git a/.gitignore b/.gitignore
index 9ead7c4..8c98b01 100644
--- a/.gitignore
+++ b/.gitignore
@@ -199,6 +199,7 @@ tools/xenmon/xentrace_setmask
 tools/xenmon/xenbaked
 tools/xenpaging/xenpaging
 tools/xenpmd/xenpmd
+tools/xenstat/libxenstat/src/_paths.h
 tools/xenstat/xentop/xentop
 tools/xenstore/init-xenstore-domain
 tools/xenstore/xenstore
diff --git a/tools/xenstat/libxenstat/Makefile b/tools/xenstat/libxenstat/Makefile
index 850d24a..213d998 100644
--- a/tools/xenstat/libxenstat/Makefile
+++ b/tools/xenstat/libxenstat/Makefile
@@ -40,6 +40,8 @@ LDLIBS-$(CONFIG_SunOS) += -lkstat
 .PHONY: all
 all: $(LIB) $(SHLIB) $(SHLIB_LINKS)
 
+$(OBJECTS-y): src/_paths.h
+
 $(LIB): $(OBJECTS-y)
 	$(AR) rc $@ $^
 	$(RANLIB) $@
@@ -135,9 +137,12 @@ endif
 .PHONY: clean
 clean:
 	rm -f $(LIB) $(SHLIB) $(SHLIB_LINKS) $(OBJECTS-y) \
-	      $(BINDINGS) $(BINDINGSRC) $(DEPS)
+	      $(BINDINGS) $(BINDINGSRC) $(DEPS) src/_paths.h
 
 .PHONY: distclean
 distclean: clean
 
 -include $(DEPS)
+
+genpath-target = $(call buildmakevars2header,src/_paths.h)
+$(eval $(genpath-target))
diff --git a/tools/xenstat/libxenstat/src/xenstat_qmp.c b/tools/xenstat/libxenstat/src/xenstat_qmp.c
index 5e261af..8c35983 100644
--- a/tools/xenstat/libxenstat/src/xenstat_qmp.c
+++ b/tools/xenstat/libxenstat/src/xenstat_qmp.c
@@ -23,6 +23,7 @@
 #include <xenctrl.h>
 
 #include "xenstat_priv.h"
+#include "_paths.h"
 
 #ifdef HAVE_YAJL_YAJL_VERSION_H
 #  include <yajl/yajl_version.h>
@@ -418,7 +419,7 @@ void read_attributes_qdisk(xenstat_node * node)
 		free(val);
 
 		/* Connect to this VMs QMP socket */
-		snprintf(path, sizeof(path), "/var/run/xen/qmp-libxenstat-%i", dominfo[i].domain);
+		snprintf(path, sizeof(path), XEN_RUN_DIR "/qmp-libxenstat-%i", dominfo[i].domain);
 		if ((qfd = qmp_connect(path)) < 0) {
 			continue;
 		}
-- 
2.1.4


_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
https://lists.xen.org/xen-devel

  reply	other threads:[~2016-08-15 10:48 UTC|newest]

Thread overview: 16+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-07-11 17:28 [PATCH v2 0/7] Remove hard-coded /var/run in tools Wei Liu
2016-07-11 17:28 ` [PATCH v2 1/7] xenconsoled: honour XEN_RUN_DIR Wei Liu
2016-07-20 14:41   ` Ian Jackson
2016-07-11 17:28 ` [PATCH v2 2/7] tools/helper: honour XEN_RUN_DIR in init-xenstore-domain.c Wei Liu
2016-07-20 14:41   ` Ian Jackson
2016-07-11 17:28 ` [PATCH v2 3/7] hotplug/FreeBSD: honour XEN_RUN_DIR Wei Liu
2016-07-11 17:28 ` [PATCH v2 4/7] hotplug/NetBSD: " Wei Liu
2016-07-11 17:28 ` [PATCH v2 5/7] hotplug/Linux: " Wei Liu
2016-07-11 17:28 ` [PATCH v2 6/7] libxenstat: " Wei Liu
2016-07-20 14:40   ` Ian Jackson
2016-07-20 14:48     ` Wei Liu
2016-08-15 10:48       ` Ian Jackson [this message]
2016-07-11 17:28 ` [PATCH v2 7/7] oxenstored: " Wei Liu
2016-07-12 16:21 ` [PATCH v2 0/7] Remove hard-coded /var/run in tools Rusty Bird
2016-07-13 14:12   ` Wei Liu
2016-07-20 15:23 ` Wei Liu

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=22449.40450.393800.756794@mariner.uk.xensource.com \
    --to=ian.jackson@eu.citrix.com \
    --cc=wei.liu2@citrix.com \
    --cc=xen-devel@lists.xenproject.org \
    /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;
as well as URLs for NNTP newsgroup(s).