* [PATCH v2 0/7] Remove hard-coded /var/run in tools
@ 2016-07-11 17:28 Wei Liu
2016-07-11 17:28 ` [PATCH v2 1/7] xenconsoled: honour XEN_RUN_DIR Wei Liu
` (8 more replies)
0 siblings, 9 replies; 16+ messages in thread
From: Wei Liu @ 2016-07-11 17:28 UTC (permalink / raw)
To: Xen-devel; +Cc: Ian Jackson, Wei Liu
Wei Liu (7):
xenconsoled: honour XEN_RUN_DIR
tools/helper: honour XEN_RUN_DIR in init-xenstore-domain.c
hotplug/FreeBSD: honour XEN_RUN_DIR
hotplug/NetBSD: honour XEN_RUN_DIR
hotplug/Linux: honour XEN_RUN_DIR
libxenstat: honour XEN_RUN_DIR
oxenstored: honour XEN_RUN_DIR
.gitignore | 2 ++
tools/console/daemon/main.c | 2 +-
tools/helpers/Makefile | 7 ++++++-
tools/helpers/init-xenstore-domain.c | 8 +++++---
tools/hotplug/FreeBSD/rc.d/xendriverdomain.in | 2 +-
tools/hotplug/Linux/init.d/xencommons.in | 6 +++---
tools/hotplug/Linux/init.d/xendriverdomain.in | 2 +-
tools/hotplug/NetBSD/rc.d/xendriverdomain.in | 2 +-
tools/ocaml/xenstored/xenstored.ml | 2 +-
tools/xenstat/libxenstat/Makefile | 7 ++++++-
tools/xenstat/libxenstat/src/xenstat_qmp.c | 3 ++-
11 files changed, 29 insertions(+), 14 deletions(-)
--
2.1.4
_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
https://lists.xen.org/xen-devel
^ permalink raw reply [flat|nested] 16+ messages in thread
* [PATCH v2 1/7] xenconsoled: honour XEN_RUN_DIR
2016-07-11 17:28 [PATCH v2 0/7] Remove hard-coded /var/run in tools Wei Liu
@ 2016-07-11 17:28 ` 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
` (7 subsequent siblings)
8 siblings, 1 reply; 16+ messages in thread
From: Wei Liu @ 2016-07-11 17:28 UTC (permalink / raw)
To: Xen-devel; +Cc: Ian Jackson, Wei Liu
Place the PID file under XEN_RUN_DIR by default. Note this change the
default location from /var/run to /var/run/xen.
Signed-off-by: Wei Liu <wei.liu2@citrix.com>
---
Cc: Ian Jackson <ian.jackson@eu.citrix.com>
---
tools/console/daemon/main.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/tools/console/daemon/main.c b/tools/console/daemon/main.c
index 20e3513..806d2fd 100644
--- a/tools/console/daemon/main.c
+++ b/tools/console/daemon/main.c
@@ -193,7 +193,7 @@ int main(int argc, char **argv)
increase_fd_limit();
if (!is_interactive) {
- daemonize(pidfile ? pidfile : "/var/run/xenconsoled.pid");
+ daemonize(pidfile ? pidfile : XEN_RUN_DIR "/xenconsoled.pid");
}
if (!xen_setup())
--
2.1.4
_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
https://lists.xen.org/xen-devel
^ permalink raw reply related [flat|nested] 16+ messages in thread
* [PATCH v2 2/7] tools/helper: honour XEN_RUN_DIR in init-xenstore-domain.c
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-11 17:28 ` 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
` (6 subsequent siblings)
8 siblings, 1 reply; 16+ messages in thread
From: Wei Liu @ 2016-07-11 17:28 UTC (permalink / raw)
To: Xen-devel; +Cc: Ian Jackson, Wei Liu
Place the PID file under XEN_RUN_DIR. Note that this change the default
location from /var/run to /var/run/xen.
Generate a _paths.h as that is required to make this change work.
Signed-off-by: Wei Liu <wei.liu2@citrix.com>
---
Cc: Ian Jackson <ian.jackson@eu.citrix.com>
v4: fix dependency in Makefile
v3: new
---
.gitignore | 1 +
tools/helpers/Makefile | 7 ++++++-
tools/helpers/init-xenstore-domain.c | 8 +++++---
3 files changed, 12 insertions(+), 4 deletions(-)
diff --git a/.gitignore b/.gitignore
index e019f2e..d4ffaa6 100644
--- a/.gitignore
+++ b/.gitignore
@@ -145,6 +145,7 @@ tools/flask/utils/flask-loadpolicy
tools/flask/utils/flask-setenforce
tools/flask/utils/flask-set-bool
tools/flask/utils/flask-label-pci
+tools/helpers/_paths.h
tools/helpers/init-xenstore-domain
tools/helpers/xen-init-dom0
tools/hotplug/common/hotplugpath.sh
diff --git a/tools/helpers/Makefile b/tools/helpers/Makefile
index a05a368..5017350 100644
--- a/tools/helpers/Makefile
+++ b/tools/helpers/Makefile
@@ -28,6 +28,8 @@ all: $(PROGS)
xen-init-dom0: $(XEN_INIT_DOM0_OBJS)
$(CC) $(LDFLAGS) -o $@ $(XEN_INIT_DOM0_OBJS) $(LDLIBS_libxentoollog) $(LDLIBS_libxenstore) $(LDLIBS_libxenlight) $(APPEND_LDFLAGS)
+$(INIT_XENSTORE_DOMAIN_OBJS): _paths.h
+
init-xenstore-domain: $(INIT_XENSTORE_DOMAIN_OBJS)
$(CC) $(LDFLAGS) -o $@ $(INIT_XENSTORE_DOMAIN_OBJS) $(LDLIBS_libxentoollog) $(LDLIBS_libxenstore) $(LDLIBS_libxenctrl) $(LDLIBS_libxenguest) $(LDLIBS_libxenlight) $(APPEND_LDFLAGS)
@@ -41,6 +43,9 @@ endif
.PHONY: clean
clean:
- $(RM) -f *.o $(PROGS) $(DEPS)
+ $(RM) -f *.o $(PROGS) $(DEPS) _paths.h
distclean: clean
+
+genpath-target = $(call buildmakevars2header,_paths.h)
+$(eval $(genpath-target))
diff --git a/tools/helpers/init-xenstore-domain.c b/tools/helpers/init-xenstore-domain.c
index 909542b..53b4b01 100644
--- a/tools/helpers/init-xenstore-domain.c
+++ b/tools/helpers/init-xenstore-domain.c
@@ -14,6 +14,7 @@
#include <xen-xsm/flask/flask.h>
#include "init-dom-json.h"
+#include "_paths.h"
static uint32_t domid = ~0;
static char *kernel;
@@ -316,10 +317,10 @@ int main(int argc, char** argv)
do_xs_write_dom(xsh, "memory/static-max", buf);
xs_close(xsh);
- fd = creat("/var/run/xenstored.pid", 0666);
+ fd = creat(XEN_RUN_DIR "/xenstored.pid", 0666);
if ( fd < 0 )
{
- fprintf(stderr, "Creating /var/run/xenstored.pid failed\n");
+ fprintf(stderr, "Creating " XEN_RUN_DIR "/xenstored.pid failed\n");
return 3;
}
rv = snprintf(buf, 16, "domid:%d\n", domid);
@@ -327,7 +328,8 @@ int main(int argc, char** argv)
close(fd);
if ( rv < 0 )
{
- fprintf(stderr, "Writing domid to /var/run/xenstored.pid failed\n");
+ fprintf(stderr,
+ "Writing domid to " XEN_RUN_DIR "/xenstored.pid failed\n");
return 3;
}
--
2.1.4
_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
https://lists.xen.org/xen-devel
^ permalink raw reply related [flat|nested] 16+ messages in thread
* [PATCH v2 3/7] hotplug/FreeBSD: honour XEN_RUN_DIR
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-11 17:28 ` [PATCH v2 2/7] tools/helper: honour XEN_RUN_DIR in init-xenstore-domain.c Wei Liu
@ 2016-07-11 17:28 ` Wei Liu
2016-07-11 17:28 ` [PATCH v2 4/7] hotplug/NetBSD: " Wei Liu
` (5 subsequent siblings)
8 siblings, 0 replies; 16+ messages in thread
From: Wei Liu @ 2016-07-11 17:28 UTC (permalink / raw)
To: Xen-devel; +Cc: Ian Jackson, Wei Liu, Roger Pau Monné
Store xldevd.pid under XEN_RUN_DIR. Note that the default location would
change from /var/run to /var/run/xen.
Signed-off-by: Wei Liu <wei.liu2@citrix.com>
Acked-by: Roger Pau Monné <roger.pau@citrix.com>
Acked-by: Ian Jackson <ian.jackson@eu.citrix.com>
---
Cc: Ian Jackson <ian.jackson@eu.citrix.com>
Cc: Roger Pau Monné <roger.pau@citrix.com>
---
tools/hotplug/FreeBSD/rc.d/xendriverdomain.in | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/tools/hotplug/FreeBSD/rc.d/xendriverdomain.in b/tools/hotplug/FreeBSD/rc.d/xendriverdomain.in
index 4063c06..8ece7c3 100644
--- a/tools/hotplug/FreeBSD/rc.d/xendriverdomain.in
+++ b/tools/hotplug/FreeBSD/rc.d/xendriverdomain.in
@@ -18,7 +18,7 @@ start_cmd="xendriverdomain_startcmd"
stop_cmd="xendriverdomain_stop"
extra_commands=""
-XLDEVD_PIDFILE="/var/run/xldevd.pid"
+XLDEVD_PIDFILE="@XEN_RUN_DIR@/xldevd.pid"
xendriverdomain_precmd()
{
--
2.1.4
_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
https://lists.xen.org/xen-devel
^ permalink raw reply related [flat|nested] 16+ messages in thread
* [PATCH v2 4/7] hotplug/NetBSD: honour XEN_RUN_DIR
2016-07-11 17:28 [PATCH v2 0/7] Remove hard-coded /var/run in tools Wei Liu
` (2 preceding siblings ...)
2016-07-11 17:28 ` [PATCH v2 3/7] hotplug/FreeBSD: honour XEN_RUN_DIR Wei Liu
@ 2016-07-11 17:28 ` Wei Liu
2016-07-11 17:28 ` [PATCH v2 5/7] hotplug/Linux: " Wei Liu
` (4 subsequent siblings)
8 siblings, 0 replies; 16+ messages in thread
From: Wei Liu @ 2016-07-11 17:28 UTC (permalink / raw)
To: Xen-devel; +Cc: Ian Jackson, Wei Liu, Roger Pau Monné
Store xldevd.pid under XEN_RUN_DIR. Note that this will change the
default location from /var/run to /var/run/xen.
Signed-off-by: Wei Liu <wei.liu2@citrix.com>
Acked-by: Roger Pau Monné <roger.pau@citrix.com>
Acked-by: Ian Jackson <ian.jackson@eu.citrix.com>
---
Cc: Ian Jackson <ian.jackson@eu.citrix.com>
Cc: Roger Pau Monné <roger.pau@citrix.com>
---
tools/hotplug/NetBSD/rc.d/xendriverdomain.in | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/tools/hotplug/NetBSD/rc.d/xendriverdomain.in b/tools/hotplug/NetBSD/rc.d/xendriverdomain.in
index 5062a71..f47b0b1 100644
--- a/tools/hotplug/NetBSD/rc.d/xendriverdomain.in
+++ b/tools/hotplug/NetBSD/rc.d/xendriverdomain.in
@@ -19,7 +19,7 @@ start_cmd="xendriverdomain_startcmd"
stop_cmd="xendriverdomain_stop"
extra_commands=""
-XLDEVD_PIDFILE="/var/run/xldevd.pid"
+XLDEVD_PIDFILE="@XEN_RUN_DIR@/xldevd.pid"
xendriverdomain_precmd()
{
--
2.1.4
_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
https://lists.xen.org/xen-devel
^ permalink raw reply related [flat|nested] 16+ messages in thread
* [PATCH v2 5/7] hotplug/Linux: honour XEN_RUN_DIR
2016-07-11 17:28 [PATCH v2 0/7] Remove hard-coded /var/run in tools Wei Liu
` (3 preceding siblings ...)
2016-07-11 17:28 ` [PATCH v2 4/7] hotplug/NetBSD: " Wei Liu
@ 2016-07-11 17:28 ` Wei Liu
2016-07-11 17:28 ` [PATCH v2 6/7] libxenstat: " Wei Liu
` (3 subsequent siblings)
8 siblings, 0 replies; 16+ messages in thread
From: Wei Liu @ 2016-07-11 17:28 UTC (permalink / raw)
To: Xen-devel; +Cc: Ian Jackson, Wei Liu, Roger Pau Monné
Store various PID files under XEN_RUN_DIR. Note that this change the
default location from /var/run to /var/run/xen.
Signed-off-by: Wei Liu <wei.liu2@citrix.com>
Acked-by: Roger Pau Monné <roger.pau@citrix.com>
Acked-by: Ian Jackson <ian.jackson@eu.citrix.com>
---
Cc: Ian Jackson <ian.jackson@eu.citrix.com>
Cc: Roger Pau Monné <roger.pau@citrix.com>
---
tools/hotplug/Linux/init.d/xencommons.in | 6 +++---
tools/hotplug/Linux/init.d/xendriverdomain.in | 2 +-
2 files changed, 4 insertions(+), 4 deletions(-)
diff --git a/tools/hotplug/Linux/init.d/xencommons.in b/tools/hotplug/Linux/init.d/xencommons.in
index 7b69fc2..2d8f30b 100644
--- a/tools/hotplug/Linux/init.d/xencommons.in
+++ b/tools/hotplug/Linux/init.d/xencommons.in
@@ -27,8 +27,8 @@ xencommons_config=@CONFIG_DIR@/@CONFIG_LEAF_DIR@
test -f $xencommons_config/xencommons && . $xencommons_config/xencommons
-XENCONSOLED_PIDFILE=/var/run/xenconsoled.pid
-QEMU_PIDFILE=/var/run/qemu-dom0.pid
+XENCONSOLED_PIDFILE=@XEN_RUN_DIR@/xenconsoled.pid
+QEMU_PIDFILE=@XEN_RUN_DIR@/qemu-dom0.pid
shopt -s extglob
# not running in Xen dom0 or domU
@@ -70,7 +70,7 @@ do_start () {
if [ -n "$XENSTORED" ] ; then
echo -n Starting $XENSTORED...
- $XENSTORED --pid-file /var/run/xenstored.pid $XENSTORED_ARGS
+ $XENSTORED --pid-file @XEN_RUN_DIR@/xenstored.pid $XENSTORED_ARGS
else
echo "No xenstored found"
exit 1
diff --git a/tools/hotplug/Linux/init.d/xendriverdomain.in b/tools/hotplug/Linux/init.d/xendriverdomain.in
index 8d4592a..c63060f 100644
--- a/tools/hotplug/Linux/init.d/xendriverdomain.in
+++ b/tools/hotplug/Linux/init.d/xendriverdomain.in
@@ -24,7 +24,7 @@ xendriverdomain_config=@CONFIG_DIR@/@CONFIG_LEAF_DIR@
test -f $xendriverdomain_config/xendriverdomain && . $xendriverdomain_config/xendriverdomain
-XLDEVD_PIDFILE=/var/run/xldevd.pid
+XLDEVD_PIDFILE=@XEN_RUN_DIR@/xldevd.pid
# not running in Xen dom0 or domU
if ! test -d /proc/xen ; then
--
2.1.4
_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
https://lists.xen.org/xen-devel
^ permalink raw reply related [flat|nested] 16+ messages in thread
* [PATCH v2 6/7] libxenstat: honour XEN_RUN_DIR
2016-07-11 17:28 [PATCH v2 0/7] Remove hard-coded /var/run in tools Wei Liu
` (4 preceding siblings ...)
2016-07-11 17:28 ` [PATCH v2 5/7] hotplug/Linux: " Wei Liu
@ 2016-07-11 17:28 ` Wei Liu
2016-07-20 14:40 ` Ian Jackson
2016-07-11 17:28 ` [PATCH v2 7/7] oxenstored: " Wei Liu
` (2 subsequent siblings)
8 siblings, 1 reply; 16+ messages in thread
From: Wei Liu @ 2016-07-11 17:28 UTC (permalink / raw)
To: Xen-devel; +Cc: Ian Jackson, Wei Liu
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>
---
Cc: Ian Jackson <ian.jackson@eu.citrix.com>
Backport candidate.
---
.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 d4ffaa6..9b8dece 100644
--- a/.gitignore
+++ b/.gitignore
@@ -220,6 +220,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/xenstore
tools/xenstore/xenstore-chmod
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 c12929a..a87c937 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>
@@ -398,7 +399,7 @@ static void read_attributes_qdisk_dom(xenstat_node *node, domid_t domain)
free(val);
/* Connect to this VMs QMP socket */
- snprintf(path, sizeof(path), "/var/run/xen/qmp-libxenstat-%i", domain);
+ snprintf(path, sizeof(path), XEN_RUN_DIR "/qmp-libxenstat-%i", domain);
if ((qfd = qmp_connect(path)) < 0)
return;
--
2.1.4
_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
https://lists.xen.org/xen-devel
^ permalink raw reply related [flat|nested] 16+ messages in thread
* [PATCH v2 7/7] oxenstored: honour XEN_RUN_DIR
2016-07-11 17:28 [PATCH v2 0/7] Remove hard-coded /var/run in tools Wei Liu
` (5 preceding siblings ...)
2016-07-11 17:28 ` [PATCH v2 6/7] libxenstat: " Wei Liu
@ 2016-07-11 17:28 ` Wei Liu
2016-07-12 16:21 ` [PATCH v2 0/7] Remove hard-coded /var/run in tools Rusty Bird
2016-07-20 15:23 ` Wei Liu
8 siblings, 0 replies; 16+ messages in thread
From: Wei Liu @ 2016-07-11 17:28 UTC (permalink / raw)
To: Xen-devel; +Cc: Ian Jackson, Wei Liu
Move default the pid file under XEN_RUN_DIR. Note that it changes the
location from /var/run to /var/run/xen.
Signed-off-by: Wei Liu <wei.liu2@citrix.com>
Acked-by: David Scott <dave@recoil.org>
---
Cc: Ian Jackson <ian.jackson@eu.citrix.com>
Not a backport candidate.
---
tools/ocaml/xenstored/xenstored.ml | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/tools/ocaml/xenstored/xenstored.ml b/tools/ocaml/xenstored/xenstored.ml
index 30570ed..7ea4026 100644
--- a/tools/ocaml/xenstored/xenstored.ml
+++ b/tools/ocaml/xenstored/xenstored.ml
@@ -81,7 +81,7 @@ let config_filename cf =
| Some name -> name
| None -> Define.default_config_dir ^ "/oxenstored.conf"
-let default_pidfile = "/var/run/xenstored.pid"
+let default_pidfile = Paths.xen_run_dir ^ "/xenstored.pid"
let ring_scan_interval = ref 20
--
2.1.4
_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
https://lists.xen.org/xen-devel
^ permalink raw reply related [flat|nested] 16+ messages in thread
* Re: [PATCH v2 0/7] Remove hard-coded /var/run in tools
2016-07-11 17:28 [PATCH v2 0/7] Remove hard-coded /var/run in tools Wei Liu
` (6 preceding siblings ...)
2016-07-11 17:28 ` [PATCH v2 7/7] oxenstored: " Wei Liu
@ 2016-07-12 16:21 ` Rusty Bird
2016-07-13 14:12 ` Wei Liu
2016-07-20 15:23 ` Wei Liu
8 siblings, 1 reply; 16+ messages in thread
From: Rusty Bird @ 2016-07-12 16:21 UTC (permalink / raw)
To: xen-devel; +Cc: Ian Jackson, Wei Liu
[-- Attachment #1.1.1: Type: text/plain, Size: 568 bytes --]
Hello Wei,
For systemd/xendriverdomain.service.in, the hardcoded PID file could be
removed altogether -- systemd has no trouble figuring out the PID with
only one process. But I wasn't sure if maybe something outside of the
xen tree uses it?
(Sorry that you're not getting my CCs: "554-SMTP.EU.CITRIX.COM 554 You
are being rejected because your senderbase score is below our accepted
policy. If you have any questions about your senderbase score, please
goto http://www.senderbase.org" -- they don't like mail.openmailbox.org
for some reason)
Rusty
[-- Attachment #1.2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 931 bytes --]
[-- Attachment #2: Type: text/plain, Size: 127 bytes --]
_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
https://lists.xen.org/xen-devel
^ permalink raw reply [flat|nested] 16+ messages in thread
* Re: [PATCH v2 0/7] Remove hard-coded /var/run in tools
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
0 siblings, 0 replies; 16+ messages in thread
From: Wei Liu @ 2016-07-13 14:12 UTC (permalink / raw)
To: Rusty Bird; +Cc: Wei Liu, Ian Jackson, xen-devel
On Tue, Jul 12, 2016 at 04:21:00PM +0000, Rusty Bird wrote:
> Hello Wei,
>
> For systemd/xendriverdomain.service.in, the hardcoded PID file could be
> removed altogether -- systemd has no trouble figuring out the PID with
> only one process. But I wasn't sure if maybe something outside of the
> xen tree uses it?
Oh, thanks for the heads-up. I will just remove the path with a separate
patch if that's not very useful.
Out-of-tree users have the option patch the script as they see fit. But
if they use systemd it would be better to use the "systemd-way" to
obtain the pid anyway.
Wei.
_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
https://lists.xen.org/xen-devel
^ permalink raw reply [flat|nested] 16+ messages in thread
* Re: [PATCH v2 6/7] libxenstat: honour XEN_RUN_DIR
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
0 siblings, 1 reply; 16+ messages in thread
From: Ian Jackson @ 2016-07-20 14:40 UTC (permalink / raw)
To: Wei Liu; +Cc: Xen-devel
Wei Liu writes ("[PATCH v2 6/7] 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.
Acked-by: Ian Jackson <ian.jackson@eu.citrix.com>
> Backport candidate.
Thanks. Can you let me know when it's applied to staging ?
Thanks,
Ian.
_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
https://lists.xen.org/xen-devel
^ permalink raw reply [flat|nested] 16+ messages in thread
* Re: [PATCH v2 1/7] xenconsoled: honour XEN_RUN_DIR
2016-07-11 17:28 ` [PATCH v2 1/7] xenconsoled: honour XEN_RUN_DIR Wei Liu
@ 2016-07-20 14:41 ` Ian Jackson
0 siblings, 0 replies; 16+ messages in thread
From: Ian Jackson @ 2016-07-20 14:41 UTC (permalink / raw)
To: Wei Liu; +Cc: Xen-devel
Wei Liu writes ("[PATCH v2 1/7] xenconsoled: honour XEN_RUN_DIR"):
> Place the PID file under XEN_RUN_DIR by default. Note this change the
> default location from /var/run to /var/run/xen.
>
> Signed-off-by: Wei Liu <wei.liu2@citrix.com>
Acked-by: Ian Jackson <ian.jackson@eu.citrix.com>
_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
https://lists.xen.org/xen-devel
^ permalink raw reply [flat|nested] 16+ messages in thread
* Re: [PATCH v2 2/7] tools/helper: honour XEN_RUN_DIR in init-xenstore-domain.c
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
0 siblings, 0 replies; 16+ messages in thread
From: Ian Jackson @ 2016-07-20 14:41 UTC (permalink / raw)
To: Wei Liu; +Cc: Xen-devel
Wei Liu writes ("[PATCH v2 2/7] tools/helper: honour XEN_RUN_DIR in init-xenstore-domain.c"):
> Place the PID file under XEN_RUN_DIR. Note that this change the default
> location from /var/run to /var/run/xen.
>
> Generate a _paths.h as that is required to make this change work.
Acked-by: Ian Jackson <ian.jackson@eu.citrix.com>
_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
https://lists.xen.org/xen-devel
^ permalink raw reply [flat|nested] 16+ messages in thread
* Re: [PATCH v2 6/7] libxenstat: honour XEN_RUN_DIR
2016-07-20 14:40 ` Ian Jackson
@ 2016-07-20 14:48 ` Wei Liu
2016-08-15 10:48 ` Ian Jackson
0 siblings, 1 reply; 16+ messages in thread
From: Wei Liu @ 2016-07-20 14:48 UTC (permalink / raw)
To: Ian Jackson; +Cc: Xen-devel, Wei Liu
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"):
> > 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.
>
> Acked-by: Ian Jackson <ian.jackson@eu.citrix.com>
>
> > 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.
Wei.
> Thanks,
> Ian.
_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
https://lists.xen.org/xen-devel
^ permalink raw reply [flat|nested] 16+ messages in thread
* Re: [PATCH v2 0/7] Remove hard-coded /var/run in tools
2016-07-11 17:28 [PATCH v2 0/7] Remove hard-coded /var/run in tools Wei Liu
` (7 preceding siblings ...)
2016-07-12 16:21 ` [PATCH v2 0/7] Remove hard-coded /var/run in tools Rusty Bird
@ 2016-07-20 15:23 ` Wei Liu
8 siblings, 0 replies; 16+ messages in thread
From: Wei Liu @ 2016-07-20 15:23 UTC (permalink / raw)
To: Xen-devel; +Cc: Ian Jackson, Wei Liu
Series pushed to staging.
_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
https://lists.xen.org/xen-devel
^ permalink raw reply [flat|nested] 16+ messages in thread
* Re: [PATCH v2 6/7] libxenstat: honour XEN_RUN_DIR
2016-07-20 14:48 ` Wei Liu
@ 2016-08-15 10:48 ` Ian Jackson
0 siblings, 0 replies; 16+ messages in thread
From: Ian Jackson @ 2016-08-15 10:48 UTC (permalink / raw)
To: Wei Liu; +Cc: Xen-devel
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
^ permalink raw reply related [flat|nested] 16+ messages in thread
end of thread, other threads:[~2016-08-15 10:48 UTC | newest]
Thread overview: 16+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
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
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
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).