xen-devel.lists.xenproject.org archive mirror
 help / color / mirror / Atom feed
From: Wei Liu <wei.liu2@citrix.com>
To: Wen Congyang <wency@cn.fujitsu.com>
Cc: Lars Kurth <lars.kurth@citrix.com>,
	Changlong Xie <xiecl.fnst@cn.fujitsu.com>,
	Wei Liu <wei.liu2@citrix.com>,
	Ian Campbell <ian.campbell@citrix.com>,
	Andrew Cooper <andrew.cooper3@citrix.com>,
	Jiang Yunhong <yunhong.jiang@intel.com>,
	Ian Jackson <ian.jackson@eu.citrix.com>,
	xen devel <xen-devel@lists.xen.org>,
	Dong Eddie <eddie.dong@intel.com>,
	Gui Jianfeng <guijianfeng@cn.fujitsu.com>,
	Shriram Rajagopalan <rshriram@cs.ubc.ca>,
	Yang Hongyang <hongyang.yang@easystack.cn>
Subject: Re: [PATCH v7 01/18] libxl/remus: init checkpoint_callback in Remus setup callback
Date: Wed, 3 Feb 2016 19:39:42 +0000	[thread overview]
Message-ID: <20160203193942.GQ23178@citrix.com> (raw)
In-Reply-To: <1454045254-3711-2-git-send-email-wency@cn.fujitsu.com>

On Fri, Jan 29, 2016 at 01:27:17PM +0800, Wen Congyang wrote:
> init stream {read/write} state checkpoint_callback in Remus setup callback.
> There's no functional change, it's just refactoring so that we can move
> all remus code into one file.
> 
> Signed-off-by: Yang Hongyang <hongyang.yang@easystack.cn>
> Signed-off-by: Wen Congyang <wency@cn.fujitsu.com>
> CC: Andrew Cooper <andrew.cooper3@citrix.com>
> CC: Ian Campbell <Ian.Campbell@citrix.com>
> CC: Ian Jackson <Ian.Jackson@eu.citrix.com>
> CC: Wei Liu <wei.liu2@citrix.com>
> Reviewed-by: Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>
> ---
>  tools/libxl/libxl.c          |  2 ++
>  tools/libxl/libxl_create.c   | 10 +++++++++-
>  tools/libxl/libxl_dom.c      |  5 +----
>  tools/libxl/libxl_internal.h |  4 ++++
>  4 files changed, 16 insertions(+), 5 deletions(-)
> 
> diff --git a/tools/libxl/libxl.c b/tools/libxl/libxl.c
> index 94b5656..5346a0c 100644
> --- a/tools/libxl/libxl.c
> +++ b/tools/libxl/libxl.c
> @@ -917,6 +917,8 @@ static void libxl__remus_setup(libxl__egc *egc,
>      rds->domid = dss->domid;
>      rds->callback = remus_setup_done;
>  
> +    dss->sws.checkpoint_callback = remus_checkpoint_stream_written;
> +
>      libxl__remus_devices_setup(egc, rds);
>      return;
>  
> diff --git a/tools/libxl/libxl_create.c b/tools/libxl/libxl_create.c
> index e491d83..8b1efe5 100644
> --- a/tools/libxl/libxl_create.c
> +++ b/tools/libxl/libxl_create.c
> @@ -718,6 +718,12 @@ static void remus_checkpoint_stream_done(
>      libxl__xc_domain_saverestore_async_callback_done(egc, &stream->shs, rc);
>  }
>  
> +static void libxl__remus_restore_setup(libxl__egc *egc,
> +                                       libxl__domain_create_state *dcs)
> +{
> +    dcs->srs.checkpoint_callback = remus_checkpoint_stream_done;
> +}
> +
>  /*----- main domain creation -----*/
>  
>  /* We have a linear control flow; only one event callback is
> @@ -1004,6 +1010,7 @@ static void domcreate_bootloader_done(libxl__egc *egc,
>      libxl__domain_build_state *const state = &dcs->build_state;
>      libxl__srm_restore_autogen_callbacks *const callbacks =
>          &dcs->srs.shs.callbacks.restore.a;
> +    const int checkpointed_stream = dcs->restore_params.checkpointed_stream;
>  
>      if (rc) {
>          domcreate_rebuild_done(egc, dcs, rc);
> @@ -1042,9 +1049,10 @@ static void domcreate_bootloader_done(libxl__egc *egc,

A few lines above in this function, there is a line like:

    /* Restore */
    callbacks->checkpoint = libxl__remus_domain_restore_checkpoint_callback;

Do you not need to move this into libxl__remus_restore_setup as well? As
far as I can tell that's only useful for remus.

>      dcs->srs.fd = restore_fd;
>      dcs->srs.legacy = (dcs->restore_params.stream_version == 1);
>      dcs->srs.completion_callback = domcreate_stream_done;
> -    dcs->srs.checkpoint_callback = remus_checkpoint_stream_done;
>  
>      if (restore_fd >= 0) {
> +        if (checkpointed_stream)
> +            libxl__remus_restore_setup(egc, dcs);
>          libxl__stream_read_start(egc, &dcs->srs);
>          return;
>      }
> diff --git a/tools/libxl/libxl_dom.c b/tools/libxl/libxl_dom.c
> index 2269998..9e28bc4 100644
> --- a/tools/libxl/libxl_dom.c
> +++ b/tools/libxl/libxl_dom.c
> @@ -1569,8 +1569,6 @@ out:
>  
>  /*----- remus asynchronous checkpoint callback -----*/
>  
> -static void remus_checkpoint_stream_written(
> -    libxl__egc *egc, libxl__stream_write_state *sws, int rc);
>  static void remus_devices_commit_cb(libxl__egc *egc,
>                                      libxl__remus_devices_state *rds,
>                                      int rc);
> @@ -1588,7 +1586,7 @@ static void libxl__remus_domain_save_checkpoint_callback(void *data)
>      libxl__stream_write_start_checkpoint(egc, &dss->sws);
>  }
>  
> -static void remus_checkpoint_stream_written(
> +void remus_checkpoint_stream_written(
>      libxl__egc *egc, libxl__stream_write_state *sws, int rc)
>  {
>      libxl__domain_suspend_state *dss = CONTAINER_OF(sws, *dss, sws);
> @@ -1761,7 +1759,6 @@ void libxl__domain_save(libxl__egc *egc, libxl__domain_suspend_state *dss)
>          callbacks->suspend = libxl__remus_domain_suspend_callback;
>          callbacks->postcopy = libxl__remus_domain_resume_callback;
>          callbacks->checkpoint = libxl__remus_domain_save_checkpoint_callback;

Do you not want to move this to libxl__remus_setup?


Wei.

  reply	other threads:[~2016-02-03 19:39 UTC|newest]

Thread overview: 56+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-01-29  5:27 [PATCH v7 00/18] Prerequisite patches for COLO Wen Congyang
2016-01-29  5:27 ` [PATCH v7 01/18] libxl/remus: init checkpoint_callback in Remus setup callback Wen Congyang
2016-02-03 19:39   ` Wei Liu [this message]
2016-02-04  5:17     ` Wen Congyang
2016-01-29  5:27 ` [PATCH v7 02/18] tools/libxl: move remus code into libxl_remus.c Wen Congyang
2016-01-29 16:29   ` Konrad Rzeszutek Wilk
2016-02-03 19:39   ` Wei Liu
2016-01-29  5:27 ` [PATCH v7 03/18] tools/libxl: move save/restore code into libxl_dom_save.c Wen Congyang
2016-01-29 16:30   ` Konrad Rzeszutek Wilk
2016-02-03 19:39   ` Wei Liu
2016-01-29  5:27 ` [PATCH v7 04/18] libxl/save: Refactor libxl__domain_suspend_state Wen Congyang
2016-01-29 16:31   ` Konrad Rzeszutek Wilk
2016-02-03 19:39   ` Wei Liu
2016-01-29  5:27 ` [PATCH v7 05/18] tools/libxc: support to resume uncooperative HVM guests Wen Congyang
2016-01-29 16:30   ` Konrad Rzeszutek Wilk
2016-02-03 19:40   ` Wei Liu
2016-02-04  5:30     ` Wen Congyang
2016-01-29  5:27 ` [PATCH v7 06/18] tools/libxl: introduce enum type libxl_checkpointed_stream Wen Congyang
2016-01-29 16:34   ` Konrad Rzeszutek Wilk
2016-02-03 19:40   ` Wei Liu
2016-01-29  5:27 ` [PATCH v7 07/18] migration/save: pass checkpointed_stream from libxl to libxc Wen Congyang
2016-01-29 16:35   ` Konrad Rzeszutek Wilk
2016-02-03 19:40   ` Wei Liu
2016-02-04  5:18     ` Wen Congyang
2016-01-29  5:27 ` [PATCH v7 08/18] tools/libxl: introduce libxl__domain_restore_device_model to load qemu state Wen Congyang
2016-01-29 16:34   ` Konrad Rzeszutek Wilk
2016-02-03 19:40   ` Wei Liu
2016-02-04  5:24     ` Wen Congyang
2016-02-04  9:41       ` Wei Liu
2016-02-04  9:46         ` Wei Liu
2016-01-29  5:27 ` [PATCH v7 09/18] tools/libxl: introduce libxl__domain_common_switch_qemu_logdirty() Wen Congyang
2016-01-29 16:34   ` Konrad Rzeszutek Wilk
2016-02-03 19:40   ` Wei Liu
2016-01-29  5:27 ` [PATCH v7 10/18] tools/libxl: export logdirty_init Wen Congyang
2016-02-03 19:40   ` Wei Liu
2016-01-29  5:27 ` [PATCH v7 11/18] tools/libxl: Add back channel to allow migration target send data back Wen Congyang
2016-02-03 19:40   ` Wei Liu
2016-01-29  5:27 ` [PATCH v7 12/18] tools/libx{l, c}: add back channel to libxc Wen Congyang
2016-01-29 16:38   ` Konrad Rzeszutek Wilk
2016-02-01  5:39     ` Wen Congyang
2016-02-03 19:40   ` Wei Liu
2016-02-04  5:28     ` Wen Congyang
2016-02-04  9:25       ` Wei Liu
2016-01-29  5:27 ` [PATCH v7 13/18] tools/libxl: rename remus device to checkpoint device Wen Congyang
2016-02-03 19:40   ` Wei Liu
2016-01-29  5:27 ` [PATCH v7 14/18] tools/libxl: fix backword compatibility after the automatic renaming Wen Congyang
2016-01-29 16:32   ` Konrad Rzeszutek Wilk
2016-01-29  5:27 ` [PATCH v7 15/18] tools/libxl: adjust the indentation Wen Congyang
2016-02-03 19:40   ` Wei Liu
2016-01-29  5:27 ` [PATCH v7 16/18] tools/libxl: store remus_ops in checkpoint device state Wen Congyang
2016-02-03 19:40   ` Wei Liu
2016-01-29  5:27 ` [PATCH v7 17/18] tools/libxl: move remus state into a seperate structure Wen Congyang
2016-02-03 19:41   ` Wei Liu
2016-01-29  5:27 ` [PATCH v7 18/18] tools/libxl: seperate device init/cleanup from checkpoint device layer Wen Congyang
2016-02-03 19:41   ` Wei Liu
2016-01-29 16:43 ` [PATCH v7 00/18] Prerequisite patches for COLO Konrad Rzeszutek Wilk

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20160203193942.GQ23178@citrix.com \
    --to=wei.liu2@citrix.com \
    --cc=andrew.cooper3@citrix.com \
    --cc=eddie.dong@intel.com \
    --cc=guijianfeng@cn.fujitsu.com \
    --cc=hongyang.yang@easystack.cn \
    --cc=ian.campbell@citrix.com \
    --cc=ian.jackson@eu.citrix.com \
    --cc=lars.kurth@citrix.com \
    --cc=rshriram@cs.ubc.ca \
    --cc=wency@cn.fujitsu.com \
    --cc=xen-devel@lists.xen.org \
    --cc=xiecl.fnst@cn.fujitsu.com \
    --cc=yunhong.jiang@intel.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).