All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] tools: add conigure --with-dumpdir=DIR option
@ 2015-04-30 14:24 Olaf Hering
  2015-05-05  8:39 ` Wei Liu
  0 siblings, 1 reply; 3+ messages in thread
From: Olaf Hering @ 2015-04-30 14:24 UTC (permalink / raw)
  To: xen-devel
  Cc: Wei Liu, Olaf Hering, Ian Jackson, Ian Campbell, Stefano Stabellini

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.

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>
---

 * The changes in Config.mk depend on "tools: remove private Makefile
   variables"
 * Only compile tested.

 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(-)

diff --git a/Config.mk b/Config.mk
index 46928ca..b21ccaa 100644
--- 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 a0f2e7b..10cf879 100644
--- 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
diff --git a/config/Paths.mk.in b/config/Paths.mk.in
index ddd72df..d36504f 100644
--- a/config/Paths.mk.in
+++ b/config/Paths.mk.in
@@ -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@
 
diff --git a/m4/paths.m4 b/m4/paths.m4
index db74f55..7ca318a 100644
--- a/m4/paths.m4
+++ b/m4/paths.m4
@@ -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)
 ])
diff --git a/tools/Makefile b/tools/Makefile
index 383d4ca..45cb4b2 100644
--- a/tools/Makefile
+++ b/tools/Makefile
@@ -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
 
diff --git a/tools/libxl/xl_cmdimpl.c b/tools/libxl/xl_cmdimpl.c
index 648ca08..b31f863 100644
--- a/tools/libxl/xl_cmdimpl.c
+++ b/tools/libxl/xl_cmdimpl.c
@@ -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);

^ permalink raw reply related	[flat|nested] 3+ messages in thread

* Re: [PATCH] tools: add conigure --with-dumpdir=DIR option
  2015-04-30 14:24 [PATCH] tools: add conigure --with-dumpdir=DIR option Olaf Hering
@ 2015-05-05  8:39 ` Wei Liu
  2015-05-06  7:07   ` Olaf Hering
  0 siblings, 1 reply; 3+ messages in thread
From: Wei Liu @ 2015-05-05  8:39 UTC (permalink / raw)
  To: Olaf Hering
  Cc: Wei Liu, Stefano Stabellini, Ian Jackson, Ian Campbell, xen-devel

On Thu, Apr 30, 2015 at 02:24:06PM +0000, Olaf Hering wrote:
> 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.
> 
> 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>

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [PATCH] tools: add conigure --with-dumpdir=DIR option
  2015-05-05  8:39 ` Wei Liu
@ 2015-05-06  7:07   ` Olaf Hering
  0 siblings, 0 replies; 3+ messages in thread
From: Olaf Hering @ 2015-05-06  7:07 UTC (permalink / raw)
  To: Wei Liu; +Cc: Stefano Stabellini, Ian Jackson, Ian Campbell, xen-devel

On Tue, May 05, Wei Liu wrote:

> On Thu, Apr 30, 2015 at 02:24:06PM +0000, Olaf Hering wrote:
> > 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.
> > 
> > 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>

Thanks, I will resend with the conigure typo fixed.

Olaf

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2015-05-06  7:07 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2015-04-30 14:24 [PATCH] tools: add conigure --with-dumpdir=DIR option Olaf Hering
2015-05-05  8:39 ` Wei Liu
2015-05-06  7:07   ` Olaf Hering

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.