From mboxrd@z Thu Jan 1 00:00:00 1970 From: Ian Campbell Subject: Re: [PATCH v7 10/10] (lib)xl: soft reset support Date: Tue, 2 Jun 2015 16:25:09 +0100 Message-ID: <1433258709.15036.322.camel@citrix.com> References: <1432740346-7887-1-git-send-email-vkuznets@redhat.com> <1432740346-7887-11-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 1Yzo43-0002FJ-27 for xen-devel@lists.xenproject.org; Tue, 02 Jun 2015 15:25:15 +0000 In-Reply-To: <1432740346-7887-11-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 , 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 Wed, 2015-05-27 at 17:25 +0200, Vitaly Kuznetsov wrote: > Perform soft reset when a domain did SHUTDOWN_soft_reset. Migrate the > content with xc_domain_soft_reset(), reload dm and toolstack. > > Signed-off-by: Vitaly Kuznetsov > --- > Changes in v7: > - Save toolstack earlier. > - Introduce LIBXL_HAVE_SOFT_RESET [Wei Liu] > --- > docs/man/xl.cfg.pod.5 | 12 +++++ > tools/libxl/libxl.c | 4 ++ > tools/libxl/libxl.h | 14 +++++ > tools/libxl/libxl_create.c | 119 +++++++++++++++++++++++++++++++++++++++---- > tools/libxl/libxl_internal.h | 26 ++++++++++ > tools/libxl/libxl_types.idl | 3 ++ > tools/libxl/xl.h | 1 + > tools/libxl/xl_cmdimpl.c | 33 +++++++++++- > 8 files changed, 201 insertions(+), 11 deletions(-) > > diff --git a/docs/man/xl.cfg.pod.5 b/docs/man/xl.cfg.pod.5 > index 8e4154f..ced5cc0 100644 > --- a/docs/man/xl.cfg.pod.5 > +++ b/docs/man/xl.cfg.pod.5 > @@ -368,6 +368,13 @@ destroy the domain. > write a "coredump" of the domain to F and then > restart the domain. > > +=item B > + > +create a new domain with the same configuration, reassign all the domain's > +memory to this new domain, kill the original domain, and continue execution s/this/a/ I think? > @@ -1529,20 +1545,67 @@ static void domcreate_destruction_cb(libxl__egc *egc, > typedef struct { > libxl__domain_create_state dcs; > uint32_t *domid_out; > + libxl__domain_destroy_state dds; > + uint8_t *toolstack_buf; > + uint32_t toolstack_len; I think a libxl__domain_soft_reset_state would be appropriate here, perhaps containing the app_domain_create_state rather than adding all the fields next to it. > } libxl__app_domain_create_state; > [...] > @@ -1550,12 +1613,34 @@ static int do_domain_create(libxl_ctx *ctx, libxl_domain_config *d_config, > libxl_domain_config_init(&cdcs->dcs.guest_config_saved); > libxl_domain_config_copy(ctx, &cdcs->dcs.guest_config_saved, d_config); > cdcs->dcs.restore_fd = restore_fd; > + cdcs->dcs.domid_soft_reset = domid_soft_reset; > cdcs->dcs.callback = domain_create_cb; > cdcs->dcs.checkpointed_stream = checkpointed_stream; > libxl__ao_progress_gethow(&cdcs->dcs.aop_console_how, aop_console_how); > cdcs->domid_out = domid; Since the backend of this function has very little in common between the create and soft/reset cases, perhaps refactor the first half into a new function to initialise a cdcs to be called by do_domain_create and the soft reset function, the latter of which would go on to do the body of the following if here. Ian.