All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH v2] tools: add configure --with-dumpdir=DIR option
@ 2015-05-06  7:08 Olaf Hering
  2015-05-07  8:01 ` Wei Liu
  0 siblings, 1 reply; 12+ messages in thread
From: Olaf Hering @ 2015-05-06  7:08 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>
Acked-by: Wei Liu <wei.liu2@citrix.com>
---

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

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] 12+ messages in thread

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

On Wed, May 06, 2015 at 07:08:44AM +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>
> ---
> 
> 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(-)

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.

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

* Re: [PATCH v2] tools: add configure --with-dumpdir=DIR option
  2015-05-07  8:01 ` Wei Liu
@ 2015-05-07  8:10   ` Olaf Hering
  2015-05-07  8:14     ` Wei Liu
  2015-05-07  9:22     ` Ian Campbell
  0 siblings, 2 replies; 12+ messages in thread
From: Olaf Hering @ 2015-05-07  8:10 UTC (permalink / raw)
  To: Wei Liu; +Cc: Stefano Stabellini, Ian Jackson, Ian Campbell, xen-devel

On Thu, May 07, Wei Liu wrote:

> On Wed, May 06, 2015 at 07:08:44AM +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.
> 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

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

* Re: [PATCH v2] tools: add configure --with-dumpdir=DIR option
  2015-05-07  8:10   ` Olaf Hering
@ 2015-05-07  8:14     ` Wei Liu
  2015-05-07  9:22     ` Ian Campbell
  1 sibling, 0 replies; 12+ messages in thread
From: Wei Liu @ 2015-05-07  8:14 UTC (permalink / raw)
  To: Olaf Hering
  Cc: Ian Jackson, Stefano Stabellini, Wei Liu, Ian Campbell, xen-devel

On Thu, May 07, 2015 at 10:10:51AM +0200, Olaf Hering wrote:
> On Thu, May 07, Wei Liu wrote:
> 
> > On Wed, May 06, 2015 at 07:08:44AM +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.
> > 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.

I mean to add a line here saying this is only the default location. The
location can be different from the default one.

Wei.

> m4/paths.m4:67:    [Path to directory for domU crash dumps. [/var/xen/dump]]),
> 
> Olaf

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

* Re: [PATCH v2] tools: add configure --with-dumpdir=DIR option
  2015-05-07  8:10   ` Olaf Hering
  2015-05-07  8:14     ` Wei Liu
@ 2015-05-07  9:22     ` Ian Campbell
  2015-05-08  6:54       ` Olaf Hering
  1 sibling, 1 reply; 12+ messages in thread
From: Ian Campbell @ 2015-05-07  9:22 UTC (permalink / raw)
  To: Olaf Hering; +Cc: Ian Jackson, Stefano Stabellini, Wei Liu, xen-devel

On Thu, 2015-05-07 at 10:10 +0200, Olaf Hering wrote:
> On Thu, May 07, Wei Liu wrote:
> 
> > On Wed, May 06, 2015 at 07:08:44AM +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.
> > 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?

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.

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

* Re: [PATCH v2] tools: add configure --with-dumpdir=DIR option
  2015-05-07  9:22     ` Ian Campbell
@ 2015-05-08  6:54       ` Olaf Hering
  2015-05-08  9:37         ` Ian Campbell
  0 siblings, 1 reply; 12+ messages in thread
From: Olaf Hering @ 2015-05-08  6:54 UTC (permalink / raw)
  To: Ian Campbell; +Cc: Ian Jackson, Stefano Stabellini, Wei Liu, xen-devel

On Thu, May 07, Ian Campbell wrote:

> On Thu, 2015-05-07 at 10:10 +0200, Olaf Hering wrote:
> > On Thu, May 07, Wei Liu wrote:
> > 
> > > On Wed, May 06, 2015 at 07:08:44AM +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.
> > > 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?
> 
> 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

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

* Re: [PATCH v2] tools: add configure --with-dumpdir=DIR option
  2015-05-08  6:54       ` Olaf Hering
@ 2015-05-08  9:37         ` Ian Campbell
  2015-05-11 14:17           ` Olaf Hering
  0 siblings, 1 reply; 12+ messages in thread
From: Ian Campbell @ 2015-05-08  9:37 UTC (permalink / raw)
  To: Olaf Hering; +Cc: Ian Jackson, Stefano Stabellini, Wei Liu, xen-devel

On Fri, 2015-05-08 at 08:54 +0200, Olaf Hering wrote:
> On Thu, May 07, Ian Campbell wrote:
> 
> > On Thu, 2015-05-07 at 10:10 +0200, Olaf Hering wrote:
> > > On Thu, May 07, Wei Liu wrote:
> > > 
> > > > On Wed, May 06, 2015 at 07:08:44AM +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.
> > > > 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?
> > 
> > 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.

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

* Re: [PATCH v2] tools: add configure --with-dumpdir=DIR option
  2015-05-08  9:37         ` Ian Campbell
@ 2015-05-11 14:17           ` Olaf Hering
  0 siblings, 0 replies; 12+ messages in thread
From: Olaf Hering @ 2015-05-11 14:17 UTC (permalink / raw)
  To: Ian Campbell; +Cc: Ian Jackson, Stefano Stabellini, Wei Liu, xen-devel

On Fri, May 08, Ian Campbell wrote:

> On Fri, 2015-05-08 at 08:54 +0200, Olaf Hering wrote:
> > On Thu, May 07, Ian Campbell wrote:
> > 
> > > 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).
> > 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

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

* Re: [PATCH v2] tools: add configure --with-dumpdir=DIR option
  2015-05-21 14:27   ` Olaf Hering
@ 2015-05-21 15:23     ` Ian Campbell
  0 siblings, 0 replies; 12+ messages in thread
From: Ian Campbell @ 2015-05-21 15:23 UTC (permalink / raw)
  To: Olaf Hering; +Cc: Wei Liu, xen-devel, Ian Jackson, Stefano Stabellini

On Thu, 2015-05-21 at 16:27 +0200, Olaf Hering wrote:
> On Thu, May 21, Ian Campbell wrote:
> 
> > On Mon, 2015-05-11 at 15:33 +0000, Olaf Hering wrote:
> > [...]
> > > +AC_ARG_WITH([xen-dumpdir],
> > > +    AS_HELP_STRING([--with-xen-dumpdir=DIR],
> > > +    [Path to directory for domU crash dumps. [/var/lib/xen/dump]]),
> > 
> > Should this say $localstatedir/lib/xen/dump as below?
> 
> This is the help output, the line below is a variable assignment.
> I think its ok as it is. Perhaps /var can be replaced with LOCALSTATEDIR
> to make it clearer.

Based on the other things in configure --help I think that's right. Ive
applied making that change, thanks.

> configure --help suggests that --localestatedir is PREFIX/var, but we
> force it to be /var. Too bad that can not be changed because it comes
> from generic code, I think.

I vaguely recall coming to the same conclusion when I looked at this :-(

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

* Re: [PATCH v2] tools: add configure --with-dumpdir=DIR option
  2015-05-21 14:09 ` Ian Campbell
@ 2015-05-21 14:27   ` Olaf Hering
  2015-05-21 15:23     ` Ian Campbell
  0 siblings, 1 reply; 12+ messages in thread
From: Olaf Hering @ 2015-05-21 14:27 UTC (permalink / raw)
  To: Ian Campbell; +Cc: Ian Jackson, Stefano Stabellini, Wei Liu, xen-devel

On Thu, May 21, Ian Campbell wrote:

> On Mon, 2015-05-11 at 15:33 +0000, Olaf Hering wrote:
> [...]
> > +AC_ARG_WITH([xen-dumpdir],
> > +    AS_HELP_STRING([--with-xen-dumpdir=DIR],
> > +    [Path to directory for domU crash dumps. [/var/lib/xen/dump]]),
> 
> Should this say $localstatedir/lib/xen/dump as below?

This is the help output, the line below is a variable assignment.
I think its ok as it is. Perhaps /var can be replaced with LOCALSTATEDIR
to make it clearer.

configure --help suggests that --localestatedir is PREFIX/var, but we
force it to be /var. Too bad that can not be changed because it comes
from generic code, I think.

Olaf

> Other than that:
>         Acked-by: Ian Campbell <ian.campbell@citrix.com>
>         
> If you say so I can make that tweak as I apply.
> 
> > +    [xen_dumpdir_path=$withval],
> > +    [xen_dumpdir_path=$localstatedir/lib/xen/dump])
> > +
> >  if test "$libexecdir" = '${exec_prefix}/libexec' ; then
> >      case "$host_os" in
> >           *netbsd*) ;;
> 
> 

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

* Re: [PATCH v2] tools: add configure --with-dumpdir=DIR option
  2015-05-11 15:33 Olaf Hering
@ 2015-05-21 14:09 ` Ian Campbell
  2015-05-21 14:27   ` Olaf Hering
  0 siblings, 1 reply; 12+ messages in thread
From: Ian Campbell @ 2015-05-21 14:09 UTC (permalink / raw)
  To: Olaf Hering; +Cc: Ian Jackson, Stefano Stabellini, Wei Liu, xen-devel

On Mon, 2015-05-11 at 15:33 +0000, Olaf Hering wrote:
[...]
> +AC_ARG_WITH([xen-dumpdir],
> +    AS_HELP_STRING([--with-xen-dumpdir=DIR],
> +    [Path to directory for domU crash dumps. [/var/lib/xen/dump]]),

Should this say $localstatedir/lib/xen/dump as below?

Other than that:
        Acked-by: Ian Campbell <ian.campbell@citrix.com>
        
If you say so I can make that tweak as I apply.

> +    [xen_dumpdir_path=$withval],
> +    [xen_dumpdir_path=$localstatedir/lib/xen/dump])
> +
>  if test "$libexecdir" = '${exec_prefix}/libexec' ; then
>      case "$host_os" in
>           *netbsd*) ;;

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

* [PATCH v2] tools: add configure --with-dumpdir=DIR option
@ 2015-05-11 15:33 Olaf Hering
  2015-05-21 14:09 ` Ian Campbell
  0 siblings, 1 reply; 12+ messages in thread
From: Olaf Hering @ 2015-05-11 15:33 UTC (permalink / raw)
  To: xen-devel
  Cc: Wei Liu, Olaf Hering, Ian Jackson, Ian Campbell, Stefano Stabellini

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

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

This depends on the PRIVATE vs. automake variable series, unless
sbindir, bindir and libdir gets changed to uppercase before applying.

v2:
 - change default to /var/lib/xen/dump
 - update also docs


 Config.mk                | 2 +-
 INSTALL                  | 4 ++++
 config/Paths.mk.in       | 1 +
 docs/man/xl.cfg.pod.5    | 6 +++---
 docs/man/xl.pod.1        | 2 +-
 m4/paths.m4              | 9 +++++++++
 tools/Makefile           | 2 +-
 tools/libxl/xl_cmdimpl.c | 2 +-
 8 files changed, 21 insertions(+), 7 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/docs/man/xl.cfg.pod.5 b/docs/man/xl.cfg.pod.5
index 8e4154f..5bff236 100644
--- a/docs/man/xl.cfg.pod.5
+++ b/docs/man/xl.cfg.pod.5
@@ -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
@@ -1692,7 +1692,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
 
diff --git a/docs/man/xl.pod.1 b/docs/man/xl.pod.1
index 16783c8..b8f244b 100644
--- a/docs/man/xl.pod.1
+++ b/docs/man/xl.pod.1
@@ -273,7 +273,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>]
 
diff --git a/m4/paths.m4 b/m4/paths.m4
index db74f55..57d86c5 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/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)
 ])
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 526a1f6..a36ad61 100644
--- a/tools/libxl/xl_cmdimpl.c
+++ b/tools/libxl/xl_cmdimpl.c
@@ -2303,7 +2303,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] 12+ messages in thread

end of thread, other threads:[~2015-05-21 15:23 UTC | newest]

Thread overview: 12+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2015-05-06  7:08 [PATCH v2] tools: add configure --with-dumpdir=DIR option Olaf Hering
2015-05-07  8:01 ` Wei Liu
2015-05-07  8:10   ` Olaf Hering
2015-05-07  8:14     ` Wei Liu
2015-05-07  9:22     ` Ian Campbell
2015-05-08  6:54       ` Olaf Hering
2015-05-08  9:37         ` Ian Campbell
2015-05-11 14:17           ` Olaf Hering
2015-05-11 15:33 Olaf Hering
2015-05-21 14:09 ` Ian Campbell
2015-05-21 14:27   ` Olaf Hering
2015-05-21 15:23     ` Ian Campbell

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.