tools: add configure --with-dumpdir=DIR option
authorOlaf Hering <olaf@aepfle.de>
Mon, 11 May 2015 15:33:51 +0000 (15:33 +0000)
committerIan Campbell <ian.campbell@citrix.com>
Thu, 21 May 2015 14:57:26 +0000 (15:57 +0100)
The current base directory /var/xen/dump for domU dumps will be patched
to /var/lib/xen/dump by most distros to follow FHS.

This change does three things:
 - change the default from /var/xen/dump to /var/lib/xen/dump
 - provide a configure option to avoid patching the source.
 - update docs to refer to the new default location

Signed-off-by: Olaf Hering <olaf@aepfle.de>
Cc: Ian Jackson <ian.jackson@eu.citrix.com>
Cc: Stefano Stabellini <stefano.stabellini@eu.citrix.com>
Cc: Ian Campbell <ian.campbell@citrix.com>
Cc: Wei Liu <wei.liu2@citrix.com>
Acked-by: Wei Liu <wei.liu2@citrix.com>
Acked-by: Ian Campbell <ian.campbell@citrix.com>
[ ijc -- s,/var,LOCALSTATEDIR, in help test, ran autogen.sh ]

Config.mk
INSTALL
config/Paths.mk.in
configure
docs/man/xl.cfg.pod.5
docs/man/xl.pod.1
m4/paths.m4
tools/Makefile
tools/configure
tools/libxl/xl_cmdimpl.c

index 46928ca36e3d46461621ec22dfdee6c4eb7059d6..b21ccaa25cecc4fdc6691f7ee2ba3ecd65108680 100644 (file)
--- a/Config.mk
+++ b/Config.mk
@@ -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
diff --git a/INSTALL b/INSTALL
index a0f2e7b1871f16917176b809e37474562318ac57..10cf879c8d7558246dc8281de34ed4bdd2866a68 100644 (file)
--- a/INSTALL
+++ b/INSTALL
@@ -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
index ddd72dfb6f7ed4398cd4df8d767211b3f4d6897c..d36504f25f481139939dc39c9fe717f3648395de 100644 (file)
@@ -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@
 
index 8a084c8942764ecedfa780cfb8256afbb82b3048..80b27d60fb52a01cee14da3ace7145a1fc250a22 100755 (executable)
--- a/configure
+++ b/configure
@@ -594,6 +594,7 @@ stubdom
 tools
 xen
 subdirs
+XEN_DUMP_DIR
 XEN_PAGING_DIR
 XEN_LOCK_DIR
 XEN_SCRIPT_DIR
@@ -658,6 +659,7 @@ ac_user_opts='
 enable_option_checking
 with_initddir
 with_sysconfig_leaf_dir
+with_xen_dumpdir
 enable_xen
 enable_tools
 enable_stubdom
@@ -1297,6 +1299,8 @@ Optional Packages:
                           options for runlevel scripts and daemons such as
                           xenstored. This should be either "sysconfig" or
                           "default". [sysconfig]
+  --with-xen-dumpdir=DIR  Path to directory for domU crash dumps.
+                          [LOCALSTATEDIR/lib/xen/dump]
 
 Report bugs to <xen-devel@lists.xen.org>.
 Xen Hypervisor home page: <http://www.xen.org/>.
@@ -1919,6 +1923,15 @@ fi
 CONFIG_LEAF_DIR=$config_leaf_dir
 
 
+
+# Check whether --with-xen-dumpdir was given.
+if test "${with_xen_dumpdir+set}" = set; then :
+  withval=$with_xen_dumpdir; xen_dumpdir_path=$withval
+else
+  xen_dumpdir_path=$localstatedir/lib/xen/dump
+fi
+
+
 if test "$libexecdir" = '${exec_prefix}/libexec' ; then
     case "$host_os" in
          *netbsd*) ;;
@@ -1968,6 +1981,9 @@ esac
 XEN_PAGING_DIR=$localstatedir/lib/xen/xenpaging
 
 
+XEN_DUMP_DIR=$xen_dumpdir_path
+
+
 
 case "$host_cpu" in
     i[3456]86|x86_64)
index 2267884766f9beca16daec7a017a43bb1cd8a798..a3e0e2e3afcf64442b0fde666cbd7403ba4e984d 100644 (file)
@@ -360,12 +360,12 @@ destroy`.
 
 =item B<coredump-destroy>
 
-write a "coredump" of the domain to F</var/xen/dump/NAME> and then
+write a "coredump" of the domain to F</var/lib/xen/dump/NAME> and then
 destroy the domain.
 
 =item B<coredump-restart>
 
-write a "coredump" of the domain to F</var/xen/dump/NAME> and then
+write a "coredump" of the domain to F</var/lib/xen/dump/NAME> and then
 restart the domain.
 
 =back
@@ -1707,7 +1707,7 @@ See L<qemu(1)> for more information.
 =head1 FILES
 
 F</etc/xen/NAME.cfg>
-F</var/xen/dump/NAME>
+F</var/lib/xen/dump/NAME>
 
 =head1 BUGS
 
index e16dbf72cdf3d3eb773672613879337462d1e96c..b2bc362656272cbeb7b59890283f228a8df27d8d 100644 (file)
@@ -280,7 +280,7 @@ Change the domain name of I<domain-id> to I<new-name>.
 Dumps the virtual machine's memory for the specified domain to the
 I<filename> specified, without pausing the domain.  The dump file will
 be written to a distribution specific directory for dump files.  Such
-as: /var/lib/xen/dump or /var/xen/dump.
+as: /var/lib/xen/dump.
 
 =item B<help> [I<--long>]
 
index db74f5533da650630ab5fa4b57ef115b7a3e1d85..63e0f6b4db5887e4656b8173f2b086780cb3d733 100644 (file)
@@ -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. [LOCALSTATEDIR/lib/xen/dump]]),
+    [xen_dumpdir_path=$withval],
+    [xen_dumpdir_path=$localstatedir/lib/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)
 ])
index 383d4ca59c937f342ac91df8277ce3697b07f80a..45cb4b24f44e269a1c0cb68f0ffbf7017b1d9db6 100644 (file)
@@ -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
 
index dfd8175ef095608093e3e0b53390e6cd860ccad0..4c2928dc7b286c7952968e8b6937f6c6f77faf0a 100755 (executable)
@@ -711,6 +711,7 @@ ocamltools
 monitors
 githttp
 rpath
+XEN_DUMP_DIR
 XEN_PAGING_DIR
 XEN_LOCK_DIR
 XEN_SCRIPT_DIR
@@ -785,6 +786,7 @@ enable_option_checking
 enable_largefile
 with_initddir
 with_sysconfig_leaf_dir
+with_xen_dumpdir
 enable_rpath
 enable_githttp
 enable_monitors
@@ -1487,6 +1489,8 @@ Optional Packages:
                           options for runlevel scripts and daemons such as
                           xenstored. This should be either "sysconfig" or
                           "default". [sysconfig]
+  --with-xen-dumpdir=DIR  Path to directory for domU crash dumps.
+                          [LOCALSTATEDIR/lib/xen/dump]
   --with-linux-backend-modules="mod1 mod2"
                           List of Linux backend module or modalias names to be
                           autoloaded on startup.
@@ -3883,6 +3887,15 @@ fi
 CONFIG_LEAF_DIR=$config_leaf_dir
 
 
+
+# Check whether --with-xen-dumpdir was given.
+if test "${with_xen_dumpdir+set}" = set; then :
+  withval=$with_xen_dumpdir; xen_dumpdir_path=$withval
+else
+  xen_dumpdir_path=$localstatedir/lib/xen/dump
+fi
+
+
 if test "$libexecdir" = '${exec_prefix}/libexec' ; then
     case "$host_os" in
          *netbsd*) ;;
@@ -3932,6 +3945,9 @@ esac
 XEN_PAGING_DIR=$localstatedir/lib/xen/xenpaging
 
 
+XEN_DUMP_DIR=$xen_dumpdir_path
+
+
 
 # Enable/disable options
 
index 186c4ddea91115615c4f30e0202827d8b1d604aa..c858068b397bd5ca964128fb620336058d2348f0 100644 (file)
@@ -2324,7 +2324,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);