From mboxrd@z Thu Jan 1 00:00:00 1970 From: Konrad Rzeszutek Wilk Subject: Re: [PATCH v10 02/11] libxl: support SHUTDOWN_soft_reset shutdown reason Date: Tue, 11 Aug 2015 15:54:29 -0400 Message-ID: <20150811195429.GA7765@l.oracle.com> References: <1438090096-8297-1-git-send-email-vkuznets@redhat.com> <1438090096-8297-3-git-send-email-vkuznets@redhat.com> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Return-path: Received: from mail6.bemta3.messagelabs.com ([195.245.230.39]) by lists.xen.org with esmtp (Exim 4.72) (envelope-from ) id 1ZPFdI-0003jL-JT for xen-devel@lists.xenproject.org; Tue, 11 Aug 2015 19:54:48 +0000 Content-Disposition: inline In-Reply-To: <1438090096-8297-3-git-send-email-vkuznets@redhat.com> List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Sender: xen-devel-bounces@lists.xen.org Errors-To: xen-devel-bounces@lists.xen.org To: Vitaly Kuznetsov Cc: Wei Liu , Andrew Jones , Keir Fraser , Ian Campbell , Stefano Stabellini , Andrew Cooper , Julien Grall , Ian Jackson , Olaf Hering , Tim Deegan , David Vrabel , Jan Beulich , xen-devel@lists.xenproject.org, Daniel De Graaf List-Id: xen-devel@lists.xenproject.org On Tue, Jul 28, 2015 at 03:28:07PM +0200, Vitaly Kuznetsov wrote: > Use letter 'S' to indicate a domain in such state. Introduce new > 'on_soft_reset' action and default it to 'restart' for now. > > Signed-off-by: Vitaly Kuznetsov Reviewed-by: Konrad Rzeszutek Wilk > --- > Changes since v9: > - None > --- > docs/man/xl.cfg.pod.5 | 5 +++++ > tools/libxl/libxl_types.idl | 2 ++ > tools/libxl/xl_cmdimpl.c | 12 +++++++++++- > tools/python/xen/lowlevel/xl/xl.c | 1 + > 4 files changed, 19 insertions(+), 1 deletion(-) > > diff --git a/docs/man/xl.cfg.pod.5 b/docs/man/xl.cfg.pod.5 > index c78c3ba..69935d9 100644 > --- a/docs/man/xl.cfg.pod.5 > +++ b/docs/man/xl.cfg.pod.5 > @@ -364,6 +364,11 @@ Default is C. > > Action to take if the domain crashes. Default is C. > > +=item B > + > +Action to take if the domain performs 'soft reset' (e.g. does kexec). > +Default is C. > + > =back > > =head3 Direct Kernel Boot > diff --git a/tools/libxl/libxl_types.idl b/tools/libxl/libxl_types.idl > index ef346e7..9f6ec00 100644 > --- a/tools/libxl/libxl_types.idl > +++ b/tools/libxl/libxl_types.idl > @@ -192,6 +192,7 @@ libxl_shutdown_reason = Enumeration("shutdown_reason", [ > (2, "suspend"), > (3, "crash"), > (4, "watchdog"), > + (5, "soft_reset"), > ], init_val = "LIBXL_SHUTDOWN_REASON_UNKNOWN") > > libxl_vga_interface_type = Enumeration("vga_interface_type", [ > @@ -637,6 +638,7 @@ libxl_domain_config = Struct("domain_config", [ > ("on_reboot", libxl_action_on_shutdown), > ("on_watchdog", libxl_action_on_shutdown), > ("on_crash", libxl_action_on_shutdown), > + ("on_soft_reset", libxl_action_on_shutdown), > ], dir=DIR_IN) > > libxl_diskinfo = Struct("diskinfo", [ > diff --git a/tools/libxl/xl_cmdimpl.c b/tools/libxl/xl_cmdimpl.c > index d0bf0cb..fcd30e9 100644 > --- a/tools/libxl/xl_cmdimpl.c > +++ b/tools/libxl/xl_cmdimpl.c > @@ -1395,6 +1395,13 @@ static void parse_config_data(const char *config_source, > exit(1); > } > > + if (xlu_cfg_get_string (config, "on_soft_reset", &buf, 0)) > + buf = "restart"; > + if (!parse_action_on_shutdown(buf, &d_config->on_soft_reset)) { > + fprintf(stderr, "Unknown on_soft_reset action \"%s\" specified\n", buf); > + exit(1); > + } > + > /* libxl_get_required_shadow_memory() must be called after final values > * (default or specified) for vcpus and memory are set, because the > * calculation depends on those values. */ > @@ -2415,6 +2422,9 @@ static int handle_domain_death(uint32_t *r_domid, > case LIBXL_SHUTDOWN_REASON_WATCHDOG: > action = d_config->on_watchdog; > break; > + case LIBXL_SHUTDOWN_REASON_SOFT_RESET: > + action = d_config->on_soft_reset; > + break; > default: > LOG("Unknown shutdown reason code %d. Destroying domain.", > event->u.domain_shutdown.shutdown_reason); > @@ -3835,7 +3845,7 @@ static void list_domains(bool verbose, bool context, bool claim, bool numa, > bool cpupool, const libxl_dominfo *info, int nb_domain) > { > int i; > - static const char shutdown_reason_letters[]= "-rscw"; > + static const char shutdown_reason_letters[]= "-rscwS"; > libxl_bitmap nodemap; > libxl_physinfo physinfo; > > diff --git a/tools/python/xen/lowlevel/xl/xl.c b/tools/python/xen/lowlevel/xl/xl.c > index 32f982a..7c61160 100644 > --- a/tools/python/xen/lowlevel/xl/xl.c > +++ b/tools/python/xen/lowlevel/xl/xl.c > @@ -784,6 +784,7 @@ PyMODINIT_FUNC initxl(void) > _INT_CONST_LIBXL(m, SHUTDOWN_REASON_SUSPEND); > _INT_CONST_LIBXL(m, SHUTDOWN_REASON_CRASH); > _INT_CONST_LIBXL(m, SHUTDOWN_REASON_WATCHDOG); > + _INT_CONST_LIBXL(m, SHUTDOWN_REASON_SOFT_RESET); > > genwrap__init(m); > } > -- > 2.4.3 >