tools: add configure --with-dumpdir=DIR option
PATCH v2 1/1 tools: add configure --with-dumpdir=DIR option
The current base directory /var/xen for domU dumps will be patched to /var/lib/xen by most distros. Provide a configure option to avoid patching the source.
If the option is not specified the default remains /var/xen/dump.
Please rerun autogen.sh after applying this patch.
---
v2:
- fix "conigure" typo in Subject line
Config.mk | 2 +- INSTALL | 4 ++++ config/Paths.mk.in | 1 + m4/paths.m4 | 9 +++++++++ tools/Makefile | 2 +- tools/libxl/xl_cmdimpl.c | 2 +- 6 files changed, 17 insertions(+), 3 deletions(-)
Config.mk +1 -1
@@ -159,7 +159,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_RUN_DIR XEN_PAGING_DIR XEN_DUMP_DIR buildmakevars2file = $(eval $(call buildmakevars2file-closure,$(1))) define buildmakevars2file-closure
INSTALL +4 -0
@@ -128,6 +128,10 @@ original xenstored will be used. Valid names are xenstored and oxenstored. --with-xenstored=name +The path where to store core dumps for domUs which are configured with +coredump-destroy or coredump-restart can be specified with this option. + --with-xen-dumpdir=DIR + Instead of starting the tools in dom0 with sysv runlevel scripts they can also be started by systemd. If this option is enabled xenstored will receive the communication socked directly from systemd. So starting it
config/Paths.mk.in +1 -0
@@ -48,6 +48,7 @@ CONFIG_LEAF_DIR := @CONFIG_LEAF_DIR@ BASH_COMPLETION_DIR := $(CONFIG_DIR)/bash_completion.d XEN_LOCK_DIR := @XEN_LOCK_DIR@ XEN_PAGING_DIR := @XEN_PAGING_DIR@ +XEN_DUMP_DIR := @XEN_DUMP_DIR@ XENFIRMWAREDIR := @XENFIRMWAREDIR@
m4/paths.m4 +9 -0
@@ -62,6 +62,12 @@ AC_ARG_WITH([sysconfig-leaf-dir], CONFIG_LEAF_DIR=$config_leaf_dir AC_SUBST(CONFIG_LEAF_DIR) +AC_ARG_WITH([xen-dumpdir], + AS_HELP_STRING([--with-xen-dumpdir=DIR], + [Path to directory for domU crash dumps. [/var/xen/dump]]), + [xen_dumpdir_path=$withval], + [xen_dumpdir_path=$localstatedir/xen/dump]) + if test "$libexecdir" = '${exec_prefix}/libexec' ; then case "$host_os" in *netbsd*) ;;
@@ -113,4 +119,7 @@ AC_SUBST(XEN_LOCK_DIR) XEN_PAGING_DIR=$localstatedir/lib/xen/xenpaging AC_SUBST(XEN_PAGING_DIR) + +XEN_DUMP_DIR=$xen_dumpdir_path +AC_SUBST(XEN_DUMP_DIR) ])
tools/Makefile +1 -1
@@ -58,7 +58,7 @@ build all: subdirs-all .PHONY: install install: subdirs-install - $(INSTALL_DIR) $(DESTDIR)/var/xen/dump + $(INSTALL_DIR) $(DESTDIR)$(XEN_DUMP_DIR) $(INSTALL_DIR) $(DESTDIR)/var/log/xen $(INSTALL_DIR) $(DESTDIR)/var/lib/xen
tools/libxl/xl_cmdimpl.c +1 -1
@@ -2301,7 +2301,7 @@ static int handle_domain_death(uint32_t *r_domid,char *corefile;int rc; -if (asprintf (&corefile,"/var/xen/dump/%s" , d_config->c_info.name) <0 ) { +if (asprintf (&corefile,XEN_DUMP_DIR "/%s" , d_config->c_info.name) <0 ) {LOG ("failed to construct core dump path" ); }else {LOG ("dumping core to %s" , corefile);
Quoted 19 lines · Olaf Hering
The current base directory
/var/xenfor domU dumps will be patched to/var/lib/xenby most distros. Provide a configure option to avoid patching the source.If the option is not specified the default remains
/var/xen/dump.Please rerun
autogen.shafter applying this patch.Signed-off-by Olaf Hering <[email protected]>Cc Ian Jackson <[email protected]>Cc Stefano Stabellini <[email protected]>Cc Ian Campbell <[email protected]>Cc Wei Liu <[email protected]>Acked-by Wei Liu <[email protected]>---
v2:
- fix "conigure" typo in Subject line
Quoted 7 lines
Config.mk | 2 +- INSTALL | 4 ++++ config/Paths.mk.in | 1 + m4/paths.m4 | 9 +++++++++ tools/Makefile | 2 +- tools/libxl/xl_cmdimpl.c | 2 +- 6 files changed, 17 insertions(+), 3 deletions(-)
You have not patched docs. I think it still references /var/xen/dump.
I discovered this when I read the manpage of xl.cfg.
Sorry for not noticing this earlier.
Wei.
Quoted 9 lines · Wei Liu
Quoted 6 lines · Olaf Hering
The current base directory
/var/xenfor domU dumps will be patched to/var/lib/xenby most distros. Provide a configure option to avoid patching the source.If the option is not specified the default remains
/var/xen/dump.You have not patched docs. I think it still references
/var/xen/dump. I discovered this when I read the manpage of xl.cfg.
The default does not change. Last time I looked the docs refer to both /var/xen/dump and /var/lib/xen/dump. Do you want me to update the example in xl.cfg?
docs/man/xl.cfg.pod.5:363:write a "coredump" of the domain to F</var/xen/dump/NAME> and then docs/man/xl.cfg.pod.5:368:write a "coredump" of the domain to F</var/xen/dump/NAME> and then docs/man/xl.cfg.pod.5:1687:F</var/xen/dump/NAME>
docs/man/xl.pod.1:276:as: /var/lib/xen/dump or /var/xen/dump.
m4/paths.m4:67: [Path to directory for domU crash dumps. [/var/xen/dump]]),
Olaf
Quoted 17 lines · Olaf Hering
Quoted 9 lines · Wei Liu
Quoted 6 lines · Olaf Hering
The current base directory
/var/xenfor domU dumps will be patched to/var/lib/xenby most distros. Provide a configure option to avoid patching the source.If the option is not specified the default remains
/var/xen/dump.You have not patched docs. I think it still references
/var/xen/dump. I discovered this when I read the manpage of xl.cfg.The default does not change. Last time I looked the docs refer to both
/var/xen/dumpand/var/lib/xen/dump. Do you want me to update the example in xl.cfg?
Quoted 4 lines
docs/man/xl.cfg.pod.5:363:write a "coredump" of the domain to F</var/xen/dump/NAME> and then docs/man/xl.cfg.pod.5:368:write a "coredump" of the domain to F</var/xen/dump/NAME> and then docs/man/xl.cfg.pod.5:1687:F</var/xen/dump/NAME>
docs/man/xl.pod.1:276:as:/var/lib/xen/dumpor/var/xen/dump.
I mean to add a line here saying this is only the default location. The location can be different from the default one.
Wei.
Quoted 3 lines
m4/paths.m4:67: [Path to directory for domU crash dumps. [
/var/xen/dump]]),Olaf
Quoted 8 lines · Olaf Hering
Quoted 4 lines · Wei Liu
Quoted 3 lines · Olaf Hering
The current base directory
/var/xenfor domU dumps will be patched to/var/lib/xenby most distros. Provide a configure option to avoid patching the source.
Quoted 7 lines
Quoted 3 lines
Quoted 1 line
If the option is not specified the default remains
/var/xen/dump.You have not patched docs. I think it still references
/var/xen/dump. I discovered this when I read the manpage of xl.cfg.The default does not change. Last time I looked the docs refer to both
/var/xen/dumpand/var/lib/xen/dump. Do you want me to update the example in xl.cfg?
Does anyone actually use the non-FHS compliant current default of /var/xen/dump? Should we consider switching it to something more standard? Perhaps having done so making it configurable wouldn't be useful any more (although I'd be happy with it being so if desired).
FWIW Debian patches it to be /var/lib/xen/dump.
http://www.pathname.com/fhs/pub/fhs-2.3.html#VARCRASHSYSTEMCRASHDUMPS
also talks about /var/crash for system crash dumps, so it's not really a perfect fit for vm dumps
So /var/lib/xen/dump seems to be best.
Ian.
Quoted 13 lines · Ian Campbell
Quoted 12 lines · Olaf Hering
Quoted 9 lines · Wei Liu
Quoted 6 lines · Olaf Hering
The current base directory
/var/xenfor domU dumps will be patched to/var/lib/xenby most distros. Provide a configure option to avoid patching the source.If the option is not specified the default remains
/var/xen/dump.You have not patched docs. I think it still references
/var/xen/dump. I discovered this when I read the manpage of xl.cfg.
Quoted 8 lines
Quoted 3 lines
The default does not change. Last time I looked the docs refer to both
/var/xen/dumpand/var/lib/xen/dump. Do you want me to update the example in xl.cfg?Does anyone actually use the non-FHS compliant current default of
/var/xen/dump? Should we consider switching it to something more standard? Perhaps having done so making it configurable wouldn't be useful any more (although I'd be happy with it being so if desired).
Changing the default would work as well I think. Right now the path is hardcoded. Should I adjust the patch to honour --localstatedir= or leave the hardcoded path in the source?
Olaf
Quoted 19 lines · Olaf Hering
Quoted 17 lines · Ian Campbell
Quoted 15 lines · Olaf Hering
Quoted 9 lines · Wei Liu
Quoted 6 lines · Olaf Hering
The current base directory
/var/xenfor domU dumps will be patched to/var/lib/xenby most distros. Provide a configure option to avoid patching the source.If the option is not specified the default remains
/var/xen/dump.You have not patched docs. I think it still references
/var/xen/dump. I discovered this when I read the manpage of xl.cfg.The default does not change. Last time I looked the docs refer to both
/var/xen/dumpand/var/lib/xen/dump. Do you want me to update the example in xl.cfg?
Quoted 8 lines
Quoted 4 lines
Does anyone actually use the non-FHS compliant current default of
/var/xen/dump? Should we consider switching it to something more standard? Perhaps having done so making it configurable wouldn't be useful any more (although I'd be happy with it being so if desired).Changing the default would work as well I think. Right now the path is hardcoded. Should I adjust the patch to honour --localstatedir= or leave the hardcoded path in the source?
I don't mind really, but since you've already got the code for the former we may as well keep it but just change the default.
Ian.
Quoted 8 lines · Ian Campbell
Quoted 7 lines · Olaf Hering
Quoted 5 lines · Ian Campbell
On Thu, 2015-05-07 at 10:10 +0200, Olaf Hering wrote:
Does anyone actually use the non-FHS compliant current default of/var/xen/dump? Should we consider switching it to something more standard? Perhaps having done so making it configurable wouldn't be useful any more (although I'd be happy with it being so if desired).
Quoted 6 lines
Quoted 3 lines
Changing the default would work as well I think. Right now the path is hardcoded. Should I adjust the patch to honour --localstatedir= or leave the hardcoded path in the source?
I don't mind really, but since you've already got the code for the former we may as well keep it but just change the default.
Ok, so I will resend with the new configure knob, change the default to be /var/lib/xen/dump and adjust the docs to refer to the new default.
Olaf