Skip to contentSkip to conversation

Honour XEN_{LOG, RUN}_DIR in various places

PATCH In review Wei Liu 6 participants 42 messages Jun 9, 2016 – Jun 13, 2016

lore
Share & tools
lore

Wei Liu

author
#0 lore raw

cover Honour XEN_{LOG, RUN}_DIR in various places

Wei Liu (11):
Config.mk: add XEN_LOG_DIR to BUILD_MAKE_VARS
docs: use XEN_LOG_DIR in log file location
tools: install XEN_{LOG,RUN}_DIR
xenconsoled: honour XEN_LOG_DIR and remove hard-coded path
xenbackendd: honour XEN_{RUN,LOG}_DIR
libxc: honour XEN_LOG_DIR in xc_dom_core.c hotplug/FreeBSD: honour XEN_{LOG,RUN}_DIR hotplug/Linux: honour XEN_LOG_DIR hotplug/NetBSD: honour XEN_{LOG,RUN}_DIR
libxl: honour XEN_LOG_DIR
oxenstored: honour XEN_{LOG,RUN}_DIR in oxenstored.conf

 .gitignore                                                 |  4 ++++
 Config.mk                                                  |  2 +-
 docs/misc/hvm-emulated-unplug.markdown                     |  2 +-
 tools/Makefile                                             |  3 ++-
 tools/configure                                            |  3 ++-
 tools/configure.ac                                         |  1 +
 tools/console/Makefile                                     |  5 +++++
 tools/console/daemon/main.c                                |  3 ++-
 tools/hotplug/FreeBSD/rc.d/xencommons.in                   | 10 +++++-----
 tools/hotplug/Linux/init.d/sysconfig.xencommons.in         |  2 +-
 tools/hotplug/Linux/init.d/xencommons.in                   |  2 +-
 tools/hotplug/Linux/xen-hotplug-common.sh.in               |  2 +-
 tools/hotplug/NetBSD/rc.d/xencommons.in                    | 14 +++++++-------
 tools/libxc/xc_dom_core.c                                  |  3 ++-
 tools/libxl/libxl_utils.c                                  | 13 +++++++------
 .../xenstored/{oxenstored.conf => oxenstored.conf.in}      |  6 +++---
 tools/xenbackendd/Makefile                                 |  6 +++++-
 tools/xenbackendd/xenbackendd.c                            |  6 ++++--
 18 files changed, 54 insertions(+), 33 deletions(-)
 rename tools/ocaml/xenstored/{oxenstored.conf => oxenstored.conf.in} (84%)
Signature · 7 lines
2.1.4


_______________________________________________
Xen-devel mailing list
[email protected]
http://lists.xen.org/xen-devel
author
#1 lore raw

PATCH 1/11 Config.mk: add XEN_LOG_DIR to BUILD_MAKE_VARS

... so that it can be turned into shell environment and exported to header files.

---
Cc: Andrew Cooper <[email protected]>
Cc: George Dunlap <[email protected]>
Cc: Ian Jackson <[email protected]>
Cc: Jan Beulich <[email protected]>
Cc: Konrad Rzeszutek Wilk <[email protected]>
Cc: Stefano Stabellini <[email protected]>
Cc: Tim Deegan <[email protected]>
Cc: Wei Liu <[email protected]>

---
 Config.mk | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
Config.mk +1 -1
index e083727..b35a13f 100644
@@ -181,7 +181,7 @@ endef
 
 BUILD_MAKE_VARS := sbindir bindir LIBEXEC LIBEXEC_BIN libdir SHAREDIR \
                    XENFIRMWAREDIR XEN_CONFIG_DIR XEN_SCRIPT_DIR XEN_LOCK_DIR \
-                   XEN_RUN_DIR XEN_PAGING_DIR XEN_DUMP_DIR
+                   XEN_RUN_DIR XEN_PAGING_DIR XEN_DUMP_DIR XEN_LOG_DIR
 
 buildmakevars2file = $(eval $(call buildmakevars2file-closure,$(1)))
 define buildmakevars2file-closure
Signature · 7 lines
2.1.4


_______________________________________________
Xen-devel mailing list
[email protected]
http://lists.xen.org/xen-devel
author
#3 lore raw

PATCH 2/11 docs: use XEN_LOG_DIR in log file location

In reply to Wei Liu

---
Cc: Andrew Cooper <[email protected]>
Cc: George Dunlap <[email protected]>
Cc: Ian Jackson <[email protected]>
Cc: Jan Beulich <[email protected]>
Cc: Konrad Rzeszutek Wilk <[email protected]>
Cc: Stefano Stabellini <[email protected]>
Cc: Tim Deegan <[email protected]>
Cc: Wei Liu <[email protected]>

---
 docs/misc/hvm-emulated-unplug.markdown | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
docs/misc/hvm-emulated-unplug.markdown +1 -1
index c6d1f9b..89fe14b 100644
@@ -45,7 +45,7 @@ drivers):
 
 Once the drivers have checked the magic number, they can send log
 messages to qemu which will be logged to wherever qemu's logs go
-(`/var/log/xen/qemu-dm.log` on normal Xen, dom0 syslog on XenServer).
+(`$XEN_LOG_DIR/qemu-dm.log` on normal Xen, dom0 syslog on XenServer).
 These messages are written to IO port `0x12` a byte at a time, and are
 terminated by newlines.  There's a fairly aggressive rate limiter on
 these messages, so they shouldn't be used for anything even vaguely
Signature · 7 lines
2.1.4


_______________________________________________
Xen-devel mailing list
[email protected]
http://lists.xen.org/xen-devel
#4 lore raw

Re: [PATCH 02/11] docs: use XEN_LOG_DIR in log file location

Wei Liu writes ("[PATCH 02/11] docs: use XEN_LOG_DIR in log file location"):

Quoted 1 line

...

docs/misc/hvm-emulated-unplug.markdown drivers): · line 51

Quoted 13 lines
docs/misc/hvm-emulated-unplug.markdown +1 -1
index c6d1f9b..89fe14b 100644
@@ -45,7 +45,7 @@ drivers):
 
 Once the drivers have checked the magic number, they can send log
 messages to qemu which will be logged to wherever qemu's logs go
-(`/var/log/xen/qemu-dm.log` on normal Xen, dom0 syslog on XenServer).
+(`$XEN_LOG_DIR/qemu-dm.log` on normal Xen, dom0 syslog on XenServer).
 These messages are written to IO port `0x12` a byte at a time, and are
 terminated by newlines.  There's a fairly aggressive rate limiter on
 these messages, so they shouldn't be used for anything even vaguely

I'm not a big fan of this kind of abstracted-away documentation. (I think writing this in the markdown does not cause substitution.) IMO it's better to have a concrete path which is right in almost all cases, even if it is sometimes wrong.

Ian.

_______________________________________________
Xen-devel mailing list
[email protected]
http://lists.xen.org/xen-devel

author
#5 lore raw

Re: [PATCH 02/11] docs: use XEN_LOG_DIR in log file location

Quoted 9 lines · Ian Jackson

Wei Liu writes ("[PATCH 02/11] docs: use XEN_LOG_DIR in log file location"):

Quoted 1 line

...

Quoted 6 lines
docs/misc/hvm-emulated-unplug.markdown +0 -0
index c6d1f9b..89fe14b 100644
@@ -45,7 +45,7 @@ drivers):
 
Quoted 12 lines

docs/misc/hvm-emulated-unplug.markdown drivers): · line 51

Quoted 7 lines
docs/misc/hvm-emulated-unplug.markdown +1 -1
 Once the drivers have checked the magic number, they can send log
 messages to qemu which will be logged to wherever qemu's logs go
-(`/var/log/xen/qemu-dm.log` on normal Xen, dom0 syslog on XenServer).
+(`$XEN_LOG_DIR/qemu-dm.log` on normal Xen, dom0 syslog on XenServer).
 These messages are written to IO port `0x12` a byte at a time, and are
 terminated by newlines.  There's a fairly aggressive rate limiter on
 these messages, so they shouldn't be used for anything even vaguely

I'm not a big fan of this kind of abstracted-away documentation. (I think writing this in the markdown does not cause substitution.) IMO it's better to have a concrete path which is right in almost all cases, even if it is sometimes wrong.

Correct, it is not substituted.

I will drop this one.

Wei.

Quoted 2 lines

Ian.

_______________________________________________
Xen-devel mailing list
[email protected]
http://lists.xen.org/xen-devel

author
#6 lore raw

PATCH 3/11 tools: install XEN_{LOG,RUN}_DIR

In reply to Wei Liu

---
Cc: Ian Jackson <[email protected]>

---
 tools/Makefile | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)
tools/Makefile +2 -1
index 6440dec..d43a229 100644
@@ -61,7 +61,8 @@ build all: subdirs-all
 .PHONY: install
 install: subdirs-install
 	$(INSTALL_DIR) -m 700 $(DESTDIR)$(XEN_DUMP_DIR)
-	$(INSTALL_DIR) $(DESTDIR)/var/log/xen
+	$(INSTALL_DIR) $(DESTDIR)$(XEN_LOG_DIR)
+	$(INSTALL_DIR) $(DESTDIR)$(XEN_RUN_DIR)
 	$(INSTALL_DIR) $(DESTDIR)/var/lib/xen
 
 .PHONY: uninstall
Signature · 7 lines
2.1.4


_______________________________________________
Xen-devel mailing list
[email protected]
http://lists.xen.org/xen-devel
#7 lore raw

Re: [PATCH 03/11] tools: install XEN_{LOG,RUN}_DIR

Quoted 12 lines · Wei Liu

---
Cc: Ian Jackson <[email protected]>

---
 tools/Makefile | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)
tools/Makefile +0 -0
index 6440dec..d43a229 100644

tools/Makefile build all: subdirs-all · line 66

Quoted 7 lines
tools/Makefile +2 -1
@@ -61,7 +61,8 @@ build all: subdirs-all
 .PHONY: install
 install: subdirs-install
 	$(INSTALL_DIR) -m 700 $(DESTDIR)$(XEN_DUMP_DIR)
-	$(INSTALL_DIR) $(DESTDIR)/var/log/xen
+	$(INSTALL_DIR) $(DESTDIR)$(XEN_LOG_DIR)
+	$(INSTALL_DIR) $(DESTDIR)$(XEN_RUN_DIR)
 	$(INSTALL_DIR) $(DESTDIR)/var/lib/xen

Looking at a git grep, /var/lib/xen is another path in need of a name and less hard coding.

~Andrew

_______________________________________________
Xen-devel mailing list
[email protected]
http://lists.xen.org/xen-devel

author
#8 lore raw

Re: [PATCH 03/11] tools: install XEN_{LOG,RUN}_DIR

Quoted 8 lines · Andrew Cooper
Quoted 7 lines · Wei Liu

---
Cc: Ian Jackson <[email protected]>

---
 tools/Makefile | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)
Quoted 16 lines

tools/Makefile build all: subdirs-all · line 66

Quoted 12 lines
tools/Makefile +2 -1
index 6440dec..d43a229 100644
@@ -61,7 +61,8 @@ build all: subdirs-all
 .PHONY: install
 install: subdirs-install
 	$(INSTALL_DIR) -m 700 $(DESTDIR)$(XEN_DUMP_DIR)
-	$(INSTALL_DIR) $(DESTDIR)/var/log/xen
+	$(INSTALL_DIR) $(DESTDIR)$(XEN_LOG_DIR)
+	$(INSTALL_DIR) $(DESTDIR)$(XEN_RUN_DIR)
 	$(INSTALL_DIR) $(DESTDIR)/var/lib/xen

Looking at a git grep, /var/lib/xen is another path in need of a name and less hard coding.

Yeah, I started off only looking at /var/log/xen and found issues with XEN_RUN_DIR as well.

The one you mentioned doesn't seem to have a XEN_*_DIR set, so I left it untouched. I have it on my list already.

Wei.

Quoted 1 line

~Andrew

_______________________________________________
Xen-devel mailing list
[email protected]
http://lists.xen.org/xen-devel

author
#10 lore raw

PATCH 4/11 xenconsoled: honour XEN_LOG_DIR and remove hard-coded path

In reply to Wei Liu

Make a _paths.h for xenconsoled as well and use that to generate a default path for log file directory.

---
Cc: Ian Jackson <[email protected]>

---
 .gitignore                  | 1 +
 tools/console/Makefile      | 5 +++++
 tools/console/daemon/main.c | 3 ++-
 3 files changed, 8 insertions(+), 1 deletion(-)
.gitignore +1 -0
index 7347801..b014509 100644
@@ -111,6 +111,7 @@ tools/blktap2/vhd/vhd-util
 tools/console/xenconsole
 tools/console/xenconsoled
 tools/console/client/_paths.h
+tools/console/daemon/_paths.h
 tools/debugger/gdb/gdb-6.2.1-linux-i386-xen/*
 tools/debugger/gdb/gdb-6.2.1/*
 tools/debugger/gdb/gdb-6.2.1.tar.bz2
tools/console/Makefile +5 -0
index a7bec75..c8b0300 100644
@@ -22,10 +22,12 @@ clean:
 	$(RM) *.a *.so *.o *.rpm $(BIN) $(DEPS)
 	$(RM) client/*.o daemon/*.o
 	$(RM) client/_paths.h
+	$(RM) daemon/_paths.h
 
 .PHONY: distclean
 distclean: clean
 
+daemon/main.o: daemon/_paths.h
 daemon/io.o: CFLAGS += $(CFLAGS_libxenevtchn) $(CFLAGS_libxengnttab)
 xenconsoled: $(patsubst %.c,%.o,$(wildcard daemon/*.c))
 	$(CC) $(LDFLAGS) $^ -o $@ $(LDLIBS) $(LDLIBS_libxenevtchn) $(LDLIBS_libxengnttab) $(LDLIBS_xenconsoled) $(APPEND_LDFLAGS)
@@ -37,6 +39,9 @@ xenconsole: $(patsubst %.c,%.o,$(wildcard client/*.c))
 genpath-target = $(call buildmakevars2header,client/_paths.h)
 $(eval $(genpath-target))
 
+genpath-target = $(call buildmakevars2header,daemon/_paths.h)
+$(eval $(genpath-target))
+
 .PHONY: install
 install: $(BIN)
 	$(INSTALL_DIR) $(DESTDIR)/$(sbindir)
tools/console/daemon/main.c +2 -1
index 23860d3..20e3513 100644
@@ -31,6 +31,7 @@
 
 #include "utils.h"
 #include "io.h"
+#include "_paths.h"
 
 int log_reload = 0;
 int log_guest = 0;
@@ -176,7 +177,7 @@ int main(int argc, char **argv)
 	}
 
 	if (!log_dir) {
-		log_dir = strdup("/var/log/xen/console");
+		log_dir = strdup(XEN_LOG_DIR "/console");
 	}
 
 	if (geteuid() != 0) {
Signature · 7 lines
2.1.4


_______________________________________________
Xen-devel mailing list
[email protected]
http://lists.xen.org/xen-devel
Acked-by on v1 4/11
#11 lore raw

Re: [PATCH 04/11] xenconsoled: honour XEN_LOG_DIR and remove hard-coded path

Wei Liu writes ("[PATCH 04/11] xenconsoled: honour XEN_LOG_DIR and remove hard-coded path"):

Quoted 2 lines

Make a _paths.h for xenconsoled as well and use that to generate a default path for log file directory.

_______________________________________________
Xen-devel mailing list
[email protected]
http://lists.xen.org/xen-devel

author
#12 lore raw

PATCH 5/11 xenbackendd: honour XEN_{RUN,LOG}_DIR

In reply to Wei Liu

Also added a gitignore entry for xenbackendd binary while I was there.

---
Cc: Ian Jackson <[email protected]>

---
 .gitignore                      | 2 ++
 tools/xenbackendd/Makefile      | 6 +++++-
 tools/xenbackendd/xenbackendd.c | 6 ++++--
 3 files changed, 11 insertions(+), 3 deletions(-)
.gitignore +2 -0
index b014509..af0e0a8 100644
@@ -210,6 +210,8 @@ tools/tests/mem-sharing/memshrtool
 tools/tests/mce-test/tools/xen-mceinj
 tools/xcutils/lsevtchn
 tools/xcutils/readnotes
+tools/xenbackendd/_paths.h
+tools/xenbackendd/xenbackendd
 tools/xenmon/xentrace_setmask
 tools/xenmon/xenbaked
 tools/xenpaging/xenpaging
tools/xenbackendd/Makefile +5 -1
index f52be74..80ac7f4 100644
@@ -30,12 +30,16 @@ install: build
 
 .PHONY: clean
 clean:
-	$(RM) *.a *.so *.o $(DEPS) xenbackendd
+	$(RM) *.a *.so *.o $(DEPS) xenbackendd _paths.h
 
 .PHONY: distclean
 distclean: clean
 
+xenbackendd.o: _paths.h
 xenbackendd: xenbackendd.o
 	$(CC) $(LDFLAGS) $< -o $@ $(LDLIBS) $(APPEND_LDFLAGS)
 
+genpath-target = $(call buildmakevars2header,_paths.h)
+$(eval $(genpath-target))
+
 -include $(DEPS)
tools/xenbackendd/xenbackendd.c +4 -2
index e21464b..b6d9298 100644
@@ -29,6 +29,8 @@
 
 #include <xenstore.h>
 
+#include "_paths.h"
+
 #define DEVTYPE_UNKNOWN 0
 #define DEVTYPE_VIF 1
 #define DEVTYPE_VBD 2
@@ -44,10 +46,10 @@
 #define VBD_SCRIPT XEN_SCRIPT_DIR"/block"
 #endif
 #ifndef LOG_FILE
-#define LOG_FILE "/var/log/xen/xenbackendd.log"
+#define LOG_FILE XEN_LOG_DIR "xenbackendd.log"
 #endif
 #ifndef PID_FILE
-#define PID_FILE "/var/run/xenbackendd.pid"
+#define PID_FILE XEN_RUN_DIR "xenbackendd.pid"
 #endif
 
 
Signature · 7 lines
2.1.4


_______________________________________________
Xen-devel mailing list
[email protected]
http://lists.xen.org/xen-devel
author
#14 lore raw

PATCH 6/11 libxc: honour XEN_LOG_DIR in xc_dom_core.c

In reply to Wei Liu

---
Cc: Ian Jackson <[email protected]>

---
 tools/libxc/xc_dom_core.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)
tools/libxc/xc_dom_core.c +2 -1
index 55c779d..ebada89 100644
@@ -33,13 +33,14 @@
 
 #include "xg_private.h"
 #include "xc_dom.h"
+#include "_paths.h"
 
 /* ------------------------------------------------------------------------ */
 /* debugging                                                                */
 
 
 
-static const char *default_logfile = "/var/log/xen/domain-builder-ng.log";
+static const char *default_logfile = XEN_LOG_DIR "/domain-builder-ng.log";
 
 int xc_dom_loginit(xc_interface *xch) {
     if (xch->dombuild_logger) return 0;
Signature · 7 lines
2.1.4


_______________________________________________
Xen-devel mailing list
[email protected]
http://lists.xen.org/xen-devel
author
#16 lore raw

PATCH 7/11 hotplug/FreeBSD: honour XEN_{LOG, RUN}_DIR

In reply to Wei Liu

---
Cc: Ian Jackson <[email protected]>
Cc: Roger Pau Monné <[email protected]>

---
 tools/hotplug/FreeBSD/rc.d/xencommons.in | 10 +++++-----
 1 file changed, 5 insertions(+), 5 deletions(-)
tools/hotplug/FreeBSD/rc.d/xencommons.in +5 -5
index d453c6b..2f9e1ec 100644
@@ -18,10 +18,10 @@ status_cmd="xen_status"
 extra_commands="status"
 required_files="/dev/xen/privcmd"
 
-XENSTORED_PIDFILE="/var/run/xenstored.pid"
-XENCONSOLED_PIDFILE="/var/run/xenconsoled.pid"
-#XENCONSOLED_TRACE="/var/log/xen/xenconsole-trace.log"
-#XENSTORED_TRACE="/var/log/xen/xenstore-trace.log"
+XENSTORED_PIDFILE="@XEN_RUN_DIR@/xenstored.pid"
+XENCONSOLED_PIDFILE="@XEN_RUN_DIR@/xenconsoled.pid"
+#XENCONSOLED_TRACE="@XEN_LOG_DIR@/xenconsole-trace.log"
+#XENSTORED_TRACE="@XEN_LOG_DIR@/xen/xenstore-trace.log"
 
 xen_precmd()
 {
@@ -43,7 +43,7 @@ xen_startcmd()
 		printf "Starting xenservices: xenstored, xenconsoled."
 		XENSTORED_ARGS=" --pid-file ${XENSTORED_PIDFILE}"
 		if [ -n "${XENSTORED_TRACE}" ]; then
-			XENSTORED_ARGS="${XENSTORED_ARGS} -T /var/log/xen/xenstored-trace.log"
+			XENSTORED_ARGS="${XENSTORED_ARGS} -T @XEN_LOG_DIR@/xenstored-trace.log"
 		fi
 		${sbindir}/xenstored ${XENSTORED_ARGS}
 		while [ $time -lt $timeout ] && ! `${bindir}/xenstore-read -s / >/dev/null 2>&1` ; do
Signature · 7 lines
2.1.4


_______________________________________________
Xen-devel mailing list
[email protected]
http://lists.xen.org/xen-devel
author
#19 lore raw

PATCH 8/11 hotplug/Linux: honour XEN_LOG_DIR

In reply to Wei Liu

---
Cc: Ian Jackson <[email protected]>
Cc: Roger Pau Monné <[email protected]>

---
 tools/hotplug/Linux/init.d/sysconfig.xencommons.in | 2 +-
 tools/hotplug/Linux/init.d/xencommons.in           | 2 +-
 tools/hotplug/Linux/xen-hotplug-common.sh.in       | 2 +-
 3 files changed, 3 insertions(+), 3 deletions(-)
tools/hotplug/Linux/init.d/sysconfig.xencommons.in +1 -1
index acc7309..c27a476 100644
@@ -24,7 +24,7 @@
 ## Default: ""
 #
 # Additional commandline arguments to start xenstored,
-# like "--trace-file /var/log/xen/xenstored-trace.log"
+# like "--trace-file @XEN_LOG_DIR@/xenstored-trace.log"
 # See "@sbindir@/xenstored --help" for possible options.
 XENSTORED_ARGS=
 
tools/hotplug/Linux/init.d/xencommons.in +1 -1
index eeac8ab..7b69fc2 100644
@@ -66,7 +66,7 @@ do_start () {
 	then
 		test -z "$XENSTORED_ROOTDIR" && XENSTORED_ROOTDIR="@XEN_LIB_STORED@"
 		rm -f "$XENSTORED_ROOTDIR"/tdb* &>/dev/null
-		test -z "$XENSTORED_TRACE" || XENSTORED_ARGS=" -T /var/log/xen/xenstored-trace.log"
+		test -z "$XENSTORED_TRACE" || XENSTORED_ARGS=" -T @XEN_LOG_DIR@/xenstored-trace.log"
 
 		if [ -n "$XENSTORED" ] ; then
 		    echo -n Starting $XENSTORED...
tools/hotplug/Linux/xen-hotplug-common.sh.in +1 -1
index d5d0b69..8c2cb9e 100644
@@ -20,7 +20,7 @@ dir=$(dirname "$0")
 . "$dir/xen-script-common.sh"
 . "$dir/locking.sh"
 
-exec 2>>/var/log/xen/xen-hotplug.log
+exec 2>>@XEN_LOG_DIR@/xen-hotplug.log
 
 export PATH="${bindir}:${sbindir}:${LIBEXEC_BIN}:/sbin:/bin:/usr/bin:/usr/sbin:$PATH"
 export LD_LIBRARY_PATH="${libdir}${LD_LIBRARY_PATH+:}$LD_LIBRARY_PATH"
Signature · 7 lines
2.1.4


_______________________________________________
Xen-devel mailing list
[email protected]
http://lists.xen.org/xen-devel
author
#22 lore raw

PATCH 9/11 hotplug/NetBSD: honour XEN_{LOG, RUN}_DIR

In reply to Wei Liu

---
Cc: Ian Jackson <[email protected]>
Cc: Roger Pau Monné <[email protected]>

---
 tools/hotplug/NetBSD/rc.d/xencommons.in | 14 +++++++-------
 1 file changed, 7 insertions(+), 7 deletions(-)
tools/hotplug/NetBSD/rc.d/xencommons.in +7 -7
index d7552cd..886a2e2 100644
@@ -20,16 +20,16 @@ status_cmd="xen_status"
 extra_commands="status"
 required_files="/kern/xen/privcmd"
 
-XENSTORED_PIDFILE="/var/run/xenstored.pid"
-XENCONSOLED_PIDFILE="/var/run/xenconsoled.pid"
-XENBACKENDD_PIDFILE="/var/run/xenbackendd.pid"
+XENSTORED_PIDFILE="@XEN_RUN_DIR@/xenstored.pid"
+XENCONSOLED_PIDFILE="@XEN_RUN_DIR@/xenconsoled.pid"
+XENBACKENDD_PIDFILE="@XEN_RUN_DIR@/xenbackendd.pid"
 #XENBACKENDD_DEBUG=1
-#XENCONSOLED_TRACE="/var/log/xen/xenconsole-trace.log"
-#XENSTORED_TRACE="/var/log/xen/xenstore-trace.log"
+#XENCONSOLED_TRACE="@XEN_LOG_DIR@/xenconsole-trace.log"
+#XENSTORED_TRACE="@XEN_LOG_DIR@/xenstore-trace.log"
 
 xen_precmd()
 {
-	mkdir -p /var/run/xenstored || exit 1
+	mkdir -p @XEN_RUN_DIR@/xenstored || exit 1
 }
 
 xen_startcmd()
@@ -47,7 +47,7 @@ xen_startcmd()
 		printf "Starting xenservices: xenstored, xenconsoled."
 		XENSTORED_ARGS=" --pid-file ${XENSTORED_PIDFILE}"
 		if [ -n "${XENSTORED_TRACE}" ]; then
-			XENSTORED_ARGS="${XENSTORED_ARGS} -T /var/log/xen/xenstored-trace.log"
+			XENSTORED_ARGS="${XENSTORED_ARGS} -T @XEN_LOG_DIR@/xenstored-trace.log"
 		fi
 		${sbindir}/xenstored ${XENSTORED_ARGS}
 		while [ $time -lt $timeout ] && ! `${bindir}/xenstore-read -s / >/dev/null 2>&1` ; do
Signature · 7 lines
2.1.4


_______________________________________________
Xen-devel mailing list
[email protected]
http://lists.xen.org/xen-devel
#25 lore raw
In reply to Wei Liu
Quoted 10 lines · Wei Liu

Wei Liu (11):
Config.mk: add XEN_LOG_DIR to BUILD_MAKE_VARS
docs: use XEN_LOG_DIR in log file location
tools: install XEN_{LOG,RUN}_DIR
xenconsoled: honour XEN_LOG_DIR and remove hard-coded path
xenbackendd: honour XEN_{RUN,LOG}_DIR
libxc: honour XEN_LOG_DIR in xc_dom_core.c hotplug/FreeBSD: honour XEN_{LOG,RUN}_DIR hotplug/Linux: honour XEN_LOG_DIR hotplug/NetBSD: honour XEN_{LOG,RUN}_DIR

I appear to be missing patches 10 and 11, so can't comment on them yet, but Reviewed-by: Andrew Cooper <[email protected]> for 1..9

~Andrew

_______________________________________________
Xen-devel mailing list
[email protected]
http://lists.xen.org/xen-devel

author
#26 lore raw

PATCH 10/11 libxl: honour XEN_LOG_DIR

In reply to Wei Liu

---
Cc: Ian Jackson <[email protected]>

---
 tools/libxl/libxl_utils.c | 13 +++++++------
 1 file changed, 7 insertions(+), 6 deletions(-)
tools/libxl/libxl_utils.c +7 -6
index 4ca6bcb..6108d4b 100644
@@ -18,6 +18,7 @@
 #include <ctype.h>
 
 #include "libxl_internal.h"
+#include "_paths.h"
 
 #ifndef LIBXL_HAVE_NONCONST_LIBXL_BASENAME_RETURN_VALUE
 const
@@ -261,20 +262,20 @@ int libxl_create_logfile(libxl_ctx *ctx, const char *name, char **full_name)
     char *logfile, *logfile_new;
     int i, rc;
 
-    logfile = GCSPRINTF("/var/log/xen/%s.log", name);
+    logfile = GCSPRINTF(XEN_LOG_DIR "/%s.log", name);
     if (stat(logfile, &stat_buf) == 0) {
         /* file exists, rotate */
-        logfile = GCSPRINTF("/var/log/xen/%s.log.10", name);
+        logfile = GCSPRINTF(XEN_LOG_DIR "/%s.log.10", name);
         unlink(logfile);
         for (i = 9; i > 0; i--) {
-            logfile = GCSPRINTF("/var/log/xen/%s.log.%d", name, i);
-            logfile_new = GCSPRINTF("/var/log/xen/%s.log.%d", name, i + 1);
+            logfile = GCSPRINTF(XEN_LOG_DIR "/%s.log.%d", name, i);
+            logfile_new = GCSPRINTF(XEN_LOG_DIR "/%s.log.%d", name, i + 1);
             rc = logrename(gc, logfile, logfile_new);
             if (rc)
                 goto out;
         }
-        logfile = GCSPRINTF("/var/log/xen/%s.log", name);
-        logfile_new = GCSPRINTF("/var/log/xen/%s.log.1", name);
+        logfile = GCSPRINTF(XEN_LOG_DIR "/%s.log", name);
+        logfile_new = GCSPRINTF(XEN_LOG_DIR "/%s.log.1", name);
 
         rc = logrename(gc, logfile, logfile_new);
         if (rc)
Signature · 7 lines
2.1.4


_______________________________________________
Xen-devel mailing list
[email protected]
http://lists.xen.org/xen-devel
author
#28 lore raw

PATCH 11/11 oxenstored: honour XEN_{LOG, RUN}_DIR in oxenstored.conf

In reply to Wei Liu

Generate oxenstored.conf with configure. This involves modifying tools/configure.ac and rerun autogen.sh.

---
Cc: Ian Jackson <[email protected]>
Cc: David Scott <[email protected]>

There are two hard-coded paths in logging.ml, but I'm not sure if generate an ocaml _Path module is the right thing to do.

---
 .gitignore                                                    | 1 +
 tools/configure                                               | 3 ++-
 tools/configure.ac                                            | 1 +
 tools/ocaml/xenstored/{oxenstored.conf => oxenstored.conf.in} | 6 +++---
 4 files changed, 7 insertions(+), 4 deletions(-)
 rename tools/ocaml/xenstored/{oxenstored.conf => oxenstored.conf.in} (84%)
.gitignore +1 -0
index af0e0a8..39deb2d 100644
@@ -346,6 +346,7 @@ tools/ocaml/libs/xentoollog/_xtl_levels.*
 tools/ocaml/libs/xentoollog/xentoollog.ml
 tools/ocaml/libs/xentoollog/xentoollog.mli
 tools/ocaml/xenstored/oxenstored
+tools/ocaml/xenstored/oxenstored.conf
 tools/ocaml/test/xtl
 tools/ocaml/test/send_debug_keys
 tools/ocaml/test/list_domains
tools/configure +2 -1
index a80f132..42e07a6 100755
@@ -2408,7 +2408,7 @@ ac_compiler_gnu=$ac_cv_c_compiler_gnu
 
 
 
-ac_config_files="$ac_config_files ../config/Tools.mk hotplug/FreeBSD/rc.d/xencommons hotplug/FreeBSD/rc.d/xendriverdomain hotplug/Linux/init.d/sysconfig.xencommons hotplug/Linux/init.d/xen-watchdog hotplug/Linux/init.d/xencommons hotplug/Linux/init.d/xendomains hotplug/Linux/init.d/xendriverdomain hotplug/Linux/vif-setup hotplug/Linux/xen-hotplug-common.sh hotplug/Linux/xendomains hotplug/NetBSD/rc.d/xencommons hotplug/NetBSD/rc.d/xendriverdomain libxl/xenlight.pc.in libxl/xlutil.pc.in"
+ac_config_files="$ac_config_files ../config/Tools.mk hotplug/FreeBSD/rc.d/xencommons hotplug/FreeBSD/rc.d/xendriverdomain hotplug/Linux/init.d/sysconfig.xencommons hotplug/Linux/init.d/xen-watchdog hotplug/Linux/init.d/xencommons hotplug/Linux/init.d/xendomains hotplug/Linux/init.d/xendriverdomain hotplug/Linux/vif-setup hotplug/Linux/xen-hotplug-common.sh hotplug/Linux/xendomains hotplug/NetBSD/rc.d/xencommons hotplug/NetBSD/rc.d/xendriverdomain libxl/xenlight.pc.in libxl/xlutil.pc.in ocaml/xenstored/oxenstored.conf"
 
 ac_config_headers="$ac_config_headers config.h"
 
@@ -10374,6 +10374,7 @@ do
     "hotplug/NetBSD/rc.d/xendriverdomain") CONFIG_FILES="$CONFIG_FILES hotplug/NetBSD/rc.d/xendriverdomain" ;;
     "libxl/xenlight.pc.in") CONFIG_FILES="$CONFIG_FILES libxl/xenlight.pc.in" ;;
     "libxl/xlutil.pc.in") CONFIG_FILES="$CONFIG_FILES libxl/xlutil.pc.in" ;;
+    "ocaml/xenstored/oxenstored.conf") CONFIG_FILES="$CONFIG_FILES ocaml/xenstored/oxenstored.conf" ;;
     "config.h") CONFIG_HEADERS="$CONFIG_HEADERS config.h" ;;
     "hotplug/Linux/systemd/proc-xen.mount") CONFIG_FILES="$CONFIG_FILES hotplug/Linux/systemd/proc-xen.mount" ;;
     "hotplug/Linux/systemd/var-lib-xenstored.mount") CONFIG_FILES="$CONFIG_FILES hotplug/Linux/systemd/var-lib-xenstored.mount" ;;
tools/configure.ac +1 -0
index d0c9e63..2e5c95c 100644
@@ -21,6 +21,7 @@ hotplug/NetBSD/rc.d/xencommons
 hotplug/NetBSD/rc.d/xendriverdomain
 libxl/xenlight.pc.in
 libxl/xlutil.pc.in
+ocaml/xenstored/oxenstored.conf
 ])
 AC_CONFIG_HEADERS([config.h])
 AC_CONFIG_AUX_DIR([../])
tools/ocaml/xenstored/oxenstored.conf.in renamed from tools/ocaml/xenstored/oxenstored.conf +3 -3
similarity index 84%
rename from tools/ocaml/xenstored/oxenstored.conf
rename to tools/ocaml/xenstored/oxenstored.conf.in
index ac60f49..82117a9 100644
@@ -1,7 +1,7 @@
 # default xenstored config
 
 # Where the pid file is stored
-pid-file = /var/run/xenstored.pid
+pid-file = @XEN_RUN_DIR@/xenstored.pid
 
 # Randomly failed a transaction with EAGAIN. Used for testing Xs user
 test-eagain = false
@@ -24,12 +24,12 @@ quota-maxrequests = 1024
 persistent = false
 
 # Xenstored logs
-# xenstored-log-file = /var/log/xenstored.log
+# xenstored-log-file = @XEN_LOG_DIR@/xenstored.log
 # xenstored-log-level = null
 # xenstored-log-nb-files = 10
 
 # Xenstored access logs
-# access-log-file = /var/log/xenstored-access.log
+# access-log-file = @XEN_LOG_DIR@/xenstored-access.log
 # access-log-nb-lines = 13215
 # acesss-log-nb-chars = 180
 # access-log-special-ops = false
Signature · 7 lines
2.1.4


_______________________________________________
Xen-devel mailing list
[email protected]
http://lists.xen.org/xen-devel
Acked-by on v1 11/11
#29 lore raw

Re: [PATCH 11/11] oxenstored: honour XEN_{LOG, RUN}_DIR in oxenstored.conf

Wei Liu writes ("[PATCH 11/11] oxenstored: honour XEN_{LOG,RUN}_DIR in oxenstored.conf"):

Quoted 7 lines

Generate oxenstored.conf with configure. This involves modifying tools/configure.ac and rerun autogen.sh.

---
Cc: Ian Jackson <[email protected]>
Cc: David Scott <[email protected]>

You should mention that autogen.sh should be rerun.

Quoted 2 lines

There are two hard-coded paths in logging.ml, but I'm not sure if generate an ocaml _Path module is the right thing to do.

I would be interested to hear Dave's opinion.

Ian.

_______________________________________________
Xen-devel mailing list
[email protected]
http://lists.xen.org/xen-devel

#30 lore raw

Re: [PATCH 11/11] oxenstored: honour XEN_{LOG, RUN}_DIR in oxenstored.conf

Quoted 12 lines · Ian Jackson

Wei Liu writes ("[PATCH 11/11] oxenstored: honour XEN_{LOG,RUN}_DIR in oxenstored.conf"):

Quoted 7 lines

Generate oxenstored.conf with configure. This involves modifying tools/configure.ac and rerun autogen.sh.

---
Cc: Ian Jackson <[email protected]>
Cc: David Scott <[email protected]>

Quoted 8 lines

You should mention that autogen.sh should be rerun.

Quoted 2 lines

There are two hard-coded paths in logging.ml, but I'm not sure if generate an ocaml _Path module is the right thing to do.

I would be interested to hear Dave's opinion.

For reference the paths are:

let xenstored_log_destination = ref (File "/var/log/xenstored.log") let access_log_destination = ref (File "/var/log/xenstored-access.log”)

These correspond to the command line arguments:

  ("access-log-file", Config.String Logging.set_access_log_destination);
  ("xenstored-log-file", Config.String Logging.set_xenstored_log_destination);

I think if you want to remove these paths completely from the binary then generating a simple module would be fine. I guess other options would be

- make the paths into optional values, default to None, and interpret None as “don’t bother logging”. Might not be a good idea to encourage people to turn off logging though.
- make it mandatory to set the paths via the config file?

I don’t have a strong opinion though :-)

Cheers,
Dave
_______________________________________________
Xen-devel mailing list
[email protected]
http://lists.xen.org/xen-devel

author
#31 lore raw

Re: [PATCH 11/11] oxenstored: honour XEN_{LOG, RUN}_DIR in oxenstored.conf

Quoted 31 lines · David Scott
Quoted 12 lines · Ian Jackson

Wei Liu writes ("[PATCH 11/11] oxenstored: honour XEN_{LOG,RUN}_DIR in oxenstored.conf"):

Quoted 7 lines

Generate oxenstored.conf with configure. This involves modifying tools/configure.ac and rerun autogen.sh.

---
Cc: Ian Jackson <[email protected]>
Cc: David Scott <[email protected]>

Quoted 8 lines

You should mention that autogen.sh should be rerun.

Quoted 2 lines

There are two hard-coded paths in logging.ml, but I'm not sure if generate an ocaml _Path module is the right thing to do.

I would be interested to hear Dave's opinion.

For reference the paths are:

let xenstored_log_destination = ref (File "/var/log/xenstored.log") let access_log_destination = ref (File "/var/log/xenstored-access.log”)

These correspond to the command line arguments:

  ("access-log-file", Config.String Logging.set_access_log_destination);
  ("xenstored-log-file", Config.String Logging.set_xenstored_log_destination);
Quoted 7 lines

I think if you want to remove these paths completely from the binary then generating a simple module would be fine. I guess other options would be

- make the paths into optional values, default to None, and interpret None as “don’t bother logging”. Might not be a good idea to encourage people to turn off logging though.
- make it mandatory to set the paths via the config file?

I don’t have a strong opinion though :-)

I think having a module generated is the best solution. That's something for another day though because my OCaml skill is pretty rusty now.

Wei.

Quoted 2 lines

Cheers,
Dave

_______________________________________________
Xen-devel mailing list
[email protected]
http://lists.xen.org/xen-devel

author
#32 lore raw

Re: [PATCH 11/11] oxenstored: honour XEN_{LOG, RUN}_DIR in oxenstored.conf

In reply to David Scott
Quoted 31 lines · David Scott
Quoted 12 lines · Ian Jackson

Wei Liu writes ("[PATCH 11/11] oxenstored: honour XEN_{LOG,RUN}_DIR in oxenstored.conf"):

Quoted 7 lines

Generate oxenstored.conf with configure. This involves modifying tools/configure.ac and rerun autogen.sh.

---
Cc: Ian Jackson <[email protected]>
Cc: David Scott <[email protected]>

Quoted 8 lines

You should mention that autogen.sh should be rerun.

Quoted 2 lines

There are two hard-coded paths in logging.ml, but I'm not sure if generate an ocaml _Path module is the right thing to do.

I would be interested to hear Dave's opinion.

For reference the paths are:

let xenstored_log_destination = ref (File "/var/log/xenstored.log") let access_log_destination = ref (File "/var/log/xenstored-access.log”)

These correspond to the command line arguments:

  ("access-log-file", Config.String Logging.set_access_log_destination);
  ("xenstored-log-file", Config.String Logging.set_xenstored_log_destination);
Quoted 7 lines

I think if you want to remove these paths completely from the binary then generating a simple module would be fine. I guess other options would be

- make the paths into optional values, default to None, and interpret None as “don’t bother logging”. Might not be a good idea to encourage people to turn off logging though.
- make it mandatory to set the paths via the config file?

I don’t have a strong opinion though :-)

I think this patch also requires an ack from you because this is under the ocaml directory.

I've hold off pushing this one.

Wei.

Quoted 2 lines

Cheers,
Dave

_______________________________________________
Xen-devel mailing list
[email protected]
http://lists.xen.org/xen-devel

author
#33 lore raw

cover Ocaml: get rid of hard-coded paths in source code

In reply to David Scott

This is the first attempt to address the problem properly. More patches will follow after we agree on how to proceed.

Wei.

Wei Liu (2):
oxenstored: generate a paths module
oxenstored: honour XEN_LOG_DIR defined by configure

 .gitignore                       |  1 +
 tools/ocaml/Makefile.rules       | 11 +++++++++++
 tools/ocaml/xenstored/Makefile   |  6 ++++++
 tools/ocaml/xenstored/logging.ml |  4 ++--
 4 files changed, 20 insertions(+), 2 deletions(-)
Signature · 7 lines
2.1.4


_______________________________________________
Xen-devel mailing list
[email protected]
http://lists.xen.org/xen-devel
author
#34 lore raw

PATCH 1/2 oxenstored: generate a paths module

That file includes all paths generated by configure. It will be used to get rid of hard-coded paths in code.

---
Cc: Ian Jackson <[email protected]>
Cc: David Scot <[email protected]>

The paths module is the first one in object list so that it gets built first. This seems to be the practice for managing dependency in oxenstored?

---
 .gitignore                     |  1 +
 tools/ocaml/Makefile.rules     | 11 +++++++++++
 tools/ocaml/xenstored/Makefile |  6 ++++++
 3 files changed, 18 insertions(+)
.gitignore +1 -0
index 1494c58..8e0a177 100644
@@ -350,6 +350,7 @@ tools/ocaml/libs/xentoollog/xentoollog.ml
 tools/ocaml/libs/xentoollog/xentoollog.mli
 tools/ocaml/xenstored/oxenstored
 tools/ocaml/xenstored/oxenstored.conf
+tools/ocaml/xenstored/paths.ml
 tools/ocaml/test/xtl
 tools/ocaml/test/send_debug_keys
 tools/ocaml/test/list_domains
tools/ocaml/Makefile.rules +11 -0
index 1796060..a893c42 100644
@@ -95,3 +95,14 @@ $(foreach lib,$(OCAML_LIBRARY),$(eval $(call OCAML_LIBRARY_template,$(lib))))
 $(foreach lib,$(OCAML_NOC_LIBRARY),$(eval $(call OCAML_NOC_LIBRARY_template,$(lib))))
 $(foreach p,$(OCAML_PROGRAM),$(eval $(call OCAML_PROGRAM_template,$(p))))
 $(foreach p,$(C_PROGRAM),$(eval $(call C_PROGRAM_template,$(p))))
+
+buildmakevars2module = $(eval $(call buildmakevars2module-closure,$(1)))
+define buildmakevars2module-closure
+    $(1): .phony
+	rm -f $(1).tmp; \
+	$(foreach var, $(BUILD_MAKE_VARS), \
+	          printf "let %s = \"%s\";;\n" \
+                      $(shell echo $(var) | tr '[:upper:]' '[:lower:]') \
+                      $($(var)) >>$(1).tmp;) \
+	$(call move-if-changed,$(1).tmp,$(1))
+endef
tools/ocaml/xenstored/Makefile +6 -0
index dce9e70..40aa288 100644
@@ -33,6 +33,7 @@ OCAML_LIBRARY += systemd
 LIBS_systemd += $(LDFLAGS-y)
 
 OBJS = define \
+	paths \
 	stdext \
 	trie \
 	config \
@@ -87,3 +88,8 @@ install: all
 	$(INSTALL_DATA) oxenstored.conf $(DESTDIR)$(XEN_CONFIG_DIR)
 
 include $(OCAML_TOPLEVEL)/Makefile.rules
+
+genpath-target = $(call buildmakevars2module,paths.ml)
+$(eval $(genpath-target))
+
+GENERATED_FILES += paths.ml
Signature · 7 lines
2.1.4


_______________________________________________
Xen-devel mailing list
[email protected]
http://lists.xen.org/xen-devel
Acked-by on v1 1/2
#35 lore raw

Re: [PATCH 1/2] oxenstored: generate a paths module

Looks fine to me:

Quoted 74 lines · Wei Liu

That file includes all paths generated by configure. It will be used to get rid of hard-coded paths in code.

---
Cc: Ian Jackson <[email protected]>
Cc: David Scot <[email protected]>

The paths module is the first one in object list so that it gets built first. This seems to be the practice for managing dependency in oxenstored?
---

.gitignore                     |  1 +
tools/ocaml/Makefile.rules     | 11 +++++++++++
tools/ocaml/xenstored/Makefile |  6 ++++++
3 files changed, 18 insertions(+)
.gitignore +0 -0
index 1494c58..8e0a177 100644
@@ -350,6 +350,7 @@ tools/ocaml/libs/xentoollog/xentoollog.ml

tools/ocaml/libs/xentoollog/xentoollog.mli
tools/ocaml/xenstored/oxenstored
tools/ocaml/xenstored/oxenstored.conf
+tools/ocaml/xenstored/paths.ml
tools/ocaml/test/xtl
tools/ocaml/test/send_debug_keys
tools/ocaml/test/list_domains

tools/ocaml/Makefile.rules +11 -0
index 1796060..a893c42 100644
@@ -95,3 +95,14 @@ $(foreach lib,$(OCAML_LIBRARY),$(eval $(call OCAML_LIBRARY_template,$(lib))))
 $(foreach lib,$(OCAML_NOC_LIBRARY),$(eval $(call OCAML_NOC_LIBRARY_template,$(lib))))
 $(foreach p,$(OCAML_PROGRAM),$(eval $(call OCAML_PROGRAM_template,$(p))))
 $(foreach p,$(C_PROGRAM),$(eval $(call C_PROGRAM_template,$(p))))
+
+buildmakevars2module = $(eval $(call buildmakevars2module-closure,$(1)))
+define buildmakevars2module-closure
+    $(1): .phony
+	rm -f $(1).tmp; \
+	$(foreach var, $(BUILD_MAKE_VARS), \
+	          printf "let %s = \"%s\";;\n" \
+                      $(shell echo $(var) | tr '[:upper:]' '[:lower:]') \
+                      $($(var)) >>$(1).tmp;) \
+	$(call move-if-changed,$(1).tmp,$(1))
+endef
tools/ocaml/xenstored/Makefile +1 -0
index dce9e70..40aa288 100644
@@ -33,6 +33,7 @@ OCAML_LIBRARY += systemd
 LIBS_systemd += $(LDFLAGS-y)
 
 OBJS = define \
+	paths \
 	stdext \
 	trie \
 	config \
@@ -87,3 +88,8 @@ install: all
 	$(INSTALL_DATA) oxenstored.conf $(DESTDIR)$(XEN_CONFIG_DIR)
 

include $(OCAML_TOPLEVEL)/Makefile.rules

tools/ocaml/xenstored/Makefile +5 -0
+
+genpath-target = $(call buildmakevars2module,paths.ml)
+$(eval $(genpath-target))
+
+GENERATED_FILES += paths.ml
Signature · 1 line
2.1.4

_______________________________________________
Xen-devel mailing list
[email protected]
http://lists.xen.org/xen-devel

author
#36 lore raw

PATCH 2/2 oxenstored: honour XEN_LOG_DIR defined by configure

In reply to Wei Liu

We generate a corresponding constant (in lower case) in paths.ml. Use that in source code to get rid of hard-coded path.

---
Cc: Ian Jackson <[email protected]>
Cc: David Scot <[email protected]>

---
 tools/ocaml/xenstored/logging.ml | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
tools/ocaml/xenstored/logging.ml +2 -2
index 4c90032..d05b2d4 100644
@@ -154,7 +154,7 @@ let make_syslog_logger facility =
 		Syslog.log facility level s in
 	{ stop = nothing; restart = nothing; rotate = nothing; write=write }
 
-let xenstored_log_destination = ref (File "/var/log/xenstored.log")
+let xenstored_log_destination = ref (File (String.concat "" [Paths.xen_log_dir; "/xenstored.log"]))
 let xenstored_log_level = ref Warn
 let xenstored_log_nb_files = ref 10
 let xenstored_log_nb_lines = ref 13215
@@ -262,7 +262,7 @@ let sanitize_data data =
 	String.escaped data
 
 let activate_access_log = ref true
-let access_log_destination = ref (File "/var/log/xenstored-access.log")
+let access_log_destination = ref (File (String.concat "" [Paths.xen_log_dir; "/xenstored-access.log"]))
 let access_log_nb_files = ref 20
 let access_log_nb_lines = ref 13215
 let access_log_nb_chars = ref 180
Signature · 7 lines
2.1.4


_______________________________________________
Xen-devel mailing list
[email protected]
http://lists.xen.org/xen-devel
author
#37 lore raw

Re: [PATCH 2/2] oxenstored: honour XEN_LOG_DIR defined by configure

CC Dave's correct email address.

Quoted 36 lines · Wei Liu

We generate a corresponding constant (in lower case) in paths.ml. Use that in source code to get rid of hard-coded path.

---
Cc: Ian Jackson <[email protected]>
Cc: David Scot <[email protected]>

---
 tools/ocaml/xenstored/logging.ml | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
tools/ocaml/xenstored/logging.ml +2 -2
index 4c90032..d05b2d4 100644
@@ -154,7 +154,7 @@ let make_syslog_logger facility =
 		Syslog.log facility level s in
 	{ stop = nothing; restart = nothing; rotate = nothing; write=write }
 
-let xenstored_log_destination = ref (File "/var/log/xenstored.log")
+let xenstored_log_destination = ref (File (String.concat "" [Paths.xen_log_dir; "/xenstored.log"]))
 let xenstored_log_level = ref Warn
 let xenstored_log_nb_files = ref 10
 let xenstored_log_nb_lines = ref 13215
@@ -262,7 +262,7 @@ let sanitize_data data =
 	String.escaped data
 
 let activate_access_log = ref true
-let access_log_destination = ref (File "/var/log/xenstored-access.log")
+let access_log_destination = ref (File (String.concat "" [Paths.xen_log_dir; "/xenstored-access.log"]))
 let access_log_nb_files = ref 20
 let access_log_nb_lines = ref 13215
 let access_log_nb_chars = ref 180
Signature · 1 line
2.1.4

_______________________________________________
Xen-devel mailing list
[email protected]
http://lists.xen.org/xen-devel

Acked-by
#38 lore raw

Re: [PATCH 2/2] oxenstored: honour XEN_LOG_DIR defined by configure

Hi,

Rather than

(String.concat “” [a; b])

it’s simpler to write

(a ^ b)

With that small change,

Cheers,
Dave

Quoted 32 lines · Wei Liu

CC Dave's correct email address.

Quoted 27 lines · Wei Liu

We generate a corresponding constant (in lower case) in paths.ml. Use that in source code to get rid of hard-coded path.

---
Cc: Ian Jackson <[email protected]>
Cc: David Scot <[email protected]>
---
tools/ocaml/xenstored/logging.ml | 4 ++--

1 file changed, 2 insertions(+), 2 deletions(-)
tools/ocaml/xenstored/logging.ml +1 -1
index 4c90032..d05b2d4 100644
@@ -154,7 +154,7 @@ let make_syslog_logger facility =
 		Syslog.log facility level s in
 	{ stop = nothing; restart = nothing; rotate = nothing; write=write }
 
-let xenstored_log_destination = ref (File "/var/log/xenstored.log")
+let xenstored_log_destination = ref (File (String.concat "" [Paths.xen_log_dir; "/xenstored.log"]))

let xenstored_log_level = ref Warn
let xenstored_log_nb_files = ref 10
let xenstored_log_nb_lines = ref 13215

tools/ocaml/xenstored/logging.ml +0 -0
@@ -262,7 +262,7 @@ let sanitize_data data =
 	String.escaped data
 
Quoted 10 lines
Quoted 9 lines

let activate_access_log = ref true

tools/ocaml/xenstored/logging.ml +1 -1
-let access_log_destination = ref (File "/var/log/xenstored-access.log")
+let access_log_destination = ref (File (String.concat "" [Paths.xen_log_dir; "/xenstored-access.log"]))

let access_log_nb_files = ref 20
let access_log_nb_lines = ref 13215
let access_log_nb_chars = ref 180

Signature · 1 line
2.1.4

_______________________________________________
Xen-devel mailing list
[email protected]
http://lists.xen.org/xen-devel

author
#39 lore raw

Re: [PATCH 2/2] oxenstored: honour XEN_LOG_DIR defined by configure

Quoted 4 lines · David Scott

Hi,

Rather than

Quoted 8 lines

(String.concat “” [a; b])

it’s simpler to write

(a ^ b)

With that small change,

Indeed, this looks better. I will update the patch accordingly.

Quoted 1 line

Thanks!

Wei.

_______________________________________________
Xen-devel mailing list
[email protected]
http://lists.xen.org/xen-devel

#40 lore raw
In reply to Wei Liu

There is also some /var/run hardcoded in here:
tools/hotplug/Linux/systemd/xenstored.socket.in tools/hotplug/Linux/systemd/xenstored_ro.socket.in

Signature · 6 lines
Anthony PERARD

_______________________________________________
Xen-devel mailing list
[email protected]
http://lists.xen.org/xen-devel
author
#41 lore raw
Quoted 3 lines · Anthony PERARD

There is also some /var/run hardcoded in here:
tools/hotplug/Linux/systemd/xenstored.socket.in tools/hotplug/Linux/systemd/xenstored_ro.socket.in

Thanks. I will send out follow-up patches for that.

Wei.

Quoted 4 lines
Signature · 2 lines
-- 
Anthony PERARD

_______________________________________________
Xen-devel mailing list
[email protected]
http://lists.xen.org/xen-devel