From: Wei Liu Date: Thu, 9 Jun 2016 12:57:35 +0000 (+0100) Subject: xenconsoled: honour XEN_LOG_DIR and remove hard-coded path X-Git-Tag: archive/raspbian/4.8.0-1+rpi1~1^2~978 X-Git-Url: https://dgit.raspbian.org/?a=commitdiff_plain;h=15574254d21228a030dfc5ffc641d053bc62c9c0;p=xen.git xenconsoled: honour XEN_LOG_DIR and remove hard-coded path Make a _paths.h for xenconsoled as well and use that to generate a default path for log file directory. Signed-off-by: Wei Liu Reviewed-by: Andrew Cooper Acked-by: Ian Jackson --- diff --git a/.gitignore b/.gitignore index 73478014ad..b014509499 100644 --- a/.gitignore +++ b/.gitignore @@ -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 diff --git a/tools/console/Makefile b/tools/console/Makefile index a7bec7534d..c8b030038b 100644 --- a/tools/console/Makefile +++ b/tools/console/Makefile @@ -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) diff --git a/tools/console/daemon/main.c b/tools/console/daemon/main.c index 23860d3e57..20e35131e4 100644 --- a/tools/console/daemon/main.c +++ b/tools/console/daemon/main.c @@ -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) {