[PATCH v2] kexec: implemented XEN KEXEC STATUS to determine if an image is loaded

Daniel Kiper daniel.kiper at oracle.com
Mon Jan 23 00:34:02 PST 2017


On Sat, Jan 21, 2017 at 09:43:19AM +0800, Baoquan He wrote:
> Hi,
>
> I don't strongly oppose against this, but could you tell what you have
> met makes the kexec_loaded/kexec_crash_loaded checking not convenient to
> you?

kexec_loaded/kexec_crash_loaded exposes Linux kernel kexec/crash state.
It does not say anything about Xen kexec/crash state. So, we need a special
approach to get the latter. Though for compatibility we provide similar
functionality in kexec-tools for the former.

I hope that helps.

> On 01/20/17 at 11:03am, Eric DeVolder wrote:
> > Instead of the scripts having to poke at various fields we can
> > provide that functionality via the -S parameter.
> >
> > Returns 0 if the payload is loaded. Can be used in combination
> > with -l or -p to get the state of the proper kexec image.
> >
> > Signed-off-by: Konrad Rzeszutek Wilk <konrad.wilk at oracle.com>
> > Signed-off-by: Eric DeVolder <eric.devolder at oracle.com>
> > ---
> > Note: The corresponding Xen changes have been committed
> > to the Xen staging branch. Follow this thread:
> > https://lists.xenproject.org/archives/html/xen-devel/2017-01/msg01570.html
> >
> > CC: Andrew Cooper <andrew.cooper3 at citrix.com>
> > CC: kexec at lists.infradead.org
> > CC: xen-devel at lists.xenproject.org
> > CC: Daniel Kiper <daniel.kiper at oracle.com>
> >
> > v0: First version (internal product).
> > v1: Posted on kexec mailing list. Changed -s to -S
> > v2: Incorporated feedback from kexec mailing list
> > ---
> >  configure.ac      |  8 ++++++-
> >  kexec/kexec-xen.c | 26 +++++++++++++++++++++++
> >  kexec/kexec.8     |  6 ++++++
> >  kexec/kexec.c     | 62 ++++++++++++++++++++++++++++++++++++++++++++++++-------
> >  kexec/kexec.h     |  5 ++++-
> >  5 files changed, 98 insertions(+), 9 deletions(-)
> >
> > diff --git a/configure.ac b/configure.ac
> > index 3044185..c6e864b 100644
> > --- a/configure.ac
> > +++ b/configure.ac
> > @@ -165,8 +165,14 @@ fi
> >  dnl find Xen control stack libraries
> >  if test "$with_xen" = yes ; then
> >  	AC_CHECK_HEADER(xenctrl.h,
> > -		[AC_CHECK_LIB(xenctrl, xc_kexec_load, ,
> > +		[AC_CHECK_LIB(xenctrl, xc_kexec_load, [ have_xenctrl_h=yes ],
> >  		AC_MSG_NOTICE([Xen support disabled]))])
> > +if test "$have_xenctrl_h" = yes ; then
> > +	AC_CHECK_LIB(xenctrl, xc_kexec_status,
> > +		AC_DEFINE(HAVE_KEXEC_CMD_STATUS, 1,
> > +			[The kexec_status call is available]),
> > +		AC_MSG_NOTICE([The kexec_status call is not available]))
> > +fi

Eric, I have a feeling that you should add en extra indentation
for lines starting from "+if test "$have_xenctrl_h"..." and
ending at "+fi".

Daniel



More information about the kexec mailing list