From: Ian Campbell <ian.campbell@citrix.com>
To: Yang Hongyang <yanghy@cn.fujitsu.com>
Cc: wei.liu2@citrix.com, wency@cn.fujitsu.com,
andrew.cooper3@citrix.com, yunhong.jiang@intel.com,
eddie.dong@intel.com, xen-devel@lists.xen.org,
guijianfeng@cn.fujitsu.com, rshriram@cs.ubc.ca,
Ian Jackson <Ian.Jackson@eu.citrix.com>
Subject: Re: [PATCH v3 COLOPre 10/26] migration/save: pass checkpointed_stream from libxl to libxc
Date: Mon, 29 Jun 2015 17:33:18 +0100 [thread overview]
Message-ID: <1435595598.32500.385.camel@citrix.com> (raw)
In-Reply-To: <1435213552-10556-11-git-send-email-yanghy@cn.fujitsu.com>
On Thu, 2015-06-25 at 14:25 +0800, Yang Hongyang wrote:
> Pass checkpointed_stream from libxl to libxc.
Hrm, so now we seem to have a purely libxl internal usage of this new
enum, but still nothing crossing the libxl.h boundary. I suspect I've
missed something!
> It won't affact legacy migration because legacy migration
> won't use this param.
>
> Signed-off-by: Yang Hongyang <yanghy@cn.fujitsu.com>
> CC: Ian Campbell <Ian.Campbell@citrix.com>
> CC: Ian Jackson <Ian.Jackson@eu.citrix.com>
> CC: Wei Liu <wei.liu2@citrix.com>
> CC: Andrew Cooper <andrew.cooper3@citrix.com>
> ---
> tools/libxc/include/xenguest.h | 9 ++++++---
> tools/libxc/xc_domain_save.c | 6 ++++--
> tools/libxc/xc_nomigrate.c | 3 ++-
> tools/libxc/xc_sr_common.h | 2 +-
> tools/libxc/xc_sr_save.c | 5 +++--
> tools/libxl/libxl.c | 2 ++
> tools/libxl/libxl_dom_save.c | 12 +++++++++---
> tools/libxl/libxl_internal.h | 1 +
> tools/libxl/libxl_save_callout.c | 2 +-
> tools/libxl/libxl_save_helper.c | 3 ++-
> 10 files changed, 31 insertions(+), 14 deletions(-)
>
> diff --git a/tools/libxc/include/xenguest.h b/tools/libxc/include/xenguest.h
> index b0d27ed..d7c8fe4 100644
> --- a/tools/libxc/include/xenguest.h
> +++ b/tools/libxc/include/xenguest.h
> @@ -30,7 +30,6 @@
> #define XCFLAGS_HVM (1 << 2)
> #define XCFLAGS_STDVGA (1 << 3)
> #define XCFLAGS_CHECKPOINT_COMPRESS (1 << 4)
> -#define XCFLAGS_CHECKPOINTED (1 << 5)
>
> #define X86_64_B_SIZE 64
> #define X86_32_B_SIZE 32
> @@ -85,16 +84,20 @@ struct save_callbacks {
> * @parm xch a handle to an open hypervisor interface
> * @parm fd the file descriptor to save a domain to
> * @parm dom the id of the domain
> + * @parm checkpointed_stream non-zero if the far end of the stream is using
> + * checkpointing
> * @return 0 on success, -1 on failure
> */
> int xc_domain_save(xc_interface *xch, int io_fd, uint32_t dom, uint32_t max_iters,
> uint32_t max_factor, uint32_t flags /* XCFLAGS_xxx */,
> - struct save_callbacks* callbacks, int hvm);
> + struct save_callbacks* callbacks, int hvm,
> + int checkpointed_stream);
>
> /* Domain Save v2 */
> int xc_domain_save2(xc_interface *xch, int io_fd, uint32_t dom, uint32_t max_iters,
> uint32_t max_factor, uint32_t flags,
> - struct save_callbacks* callbacks, int hvm);
> + struct save_callbacks* callbacks, int hvm,
> + int checkpointed_stream);
>
> /* callbacks provided by xc_domain_restore */
> struct restore_callbacks {
> diff --git a/tools/libxc/xc_domain_save.c b/tools/libxc/xc_domain_save.c
> index 301e770..c76980e 100644
> --- a/tools/libxc/xc_domain_save.c
> +++ b/tools/libxc/xc_domain_save.c
> @@ -802,7 +802,8 @@ static int save_tsc_info(xc_interface *xch, uint32_t dom, int io_fd)
>
> int xc_domain_save(xc_interface *xch, int io_fd, uint32_t dom, uint32_t max_iters,
> uint32_t max_factor, uint32_t flags,
> - struct save_callbacks* callbacks, int hvm)
> + struct save_callbacks* callbacks, int hvm,
> + int checkpointed_stream)
> {
> xc_dominfo_t info;
> DECLARE_DOMCTL;
> @@ -897,7 +898,8 @@ int xc_domain_save(xc_interface *xch, int io_fd, uint32_t dom, uint32_t max_iter
> if ( getenv("XG_MIGRATION_V2") )
> {
> return xc_domain_save2(xch, io_fd, dom, max_iters,
> - max_factor, flags, callbacks, hvm);
> + max_factor, flags, callbacks, hvm,
> + checkpointed_stream);
> }
>
> DPRINTF("%s: starting save of domid %u", __func__, dom);
> diff --git a/tools/libxc/xc_nomigrate.c b/tools/libxc/xc_nomigrate.c
> index 76978a0..374d5bf 100644
> --- a/tools/libxc/xc_nomigrate.c
> +++ b/tools/libxc/xc_nomigrate.c
> @@ -23,7 +23,8 @@
>
> int xc_domain_save(xc_interface *xch, int io_fd, uint32_t dom, uint32_t max_iters,
> uint32_t max_factor, uint32_t flags,
> - struct save_callbacks* callbacks, int hvm)
> + struct save_callbacks* callbacks, int hvm,
> + int checkpointed_stream)
> {
> errno = ENOSYS;
> return -1;
> diff --git a/tools/libxc/xc_sr_common.h b/tools/libxc/xc_sr_common.h
> index 42af55b..04f32f5 100644
> --- a/tools/libxc/xc_sr_common.h
> +++ b/tools/libxc/xc_sr_common.h
> @@ -175,7 +175,7 @@ struct xc_sr_context
> bool live;
>
> /* Plain VM, or checkpoints over time. */
> - bool checkpointed;
> + int checkpointed;
>
> /* Further debugging information in the stream. */
> bool debug;
> diff --git a/tools/libxc/xc_sr_save.c b/tools/libxc/xc_sr_save.c
> index d63b783..6102b66 100644
> --- a/tools/libxc/xc_sr_save.c
> +++ b/tools/libxc/xc_sr_save.c
> @@ -820,7 +820,8 @@ static int save(struct xc_sr_context *ctx, uint16_t guest_type)
>
> int xc_domain_save2(xc_interface *xch, int io_fd, uint32_t dom,
> uint32_t max_iters, uint32_t max_factor, uint32_t flags,
> - struct save_callbacks* callbacks, int hvm)
> + struct save_callbacks* callbacks, int hvm,
> + int checkpointed_stream)
> {
> xen_pfn_t nr_pfns;
> struct xc_sr_context ctx =
> @@ -833,7 +834,7 @@ int xc_domain_save2(xc_interface *xch, int io_fd, uint32_t dom,
> ctx.save.callbacks = callbacks;
> ctx.save.live = !!(flags & XCFLAGS_LIVE);
> ctx.save.debug = !!(flags & XCFLAGS_DEBUG);
> - ctx.save.checkpointed = !!(flags & XCFLAGS_CHECKPOINTED);
> + ctx.save.checkpointed = checkpointed_stream;
>
> /*
> * TODO: Find some time to better tweak the live migration algorithm.
> diff --git a/tools/libxl/libxl.c b/tools/libxl/libxl.c
> index 8b63eff..2ca59ea 100644
> --- a/tools/libxl/libxl.c
> +++ b/tools/libxl/libxl.c
> @@ -837,6 +837,7 @@ int libxl_domain_remus_start(libxl_ctx *ctx, libxl_domain_remus_info *info,
> dss->live = 1;
> dss->debug = 0;
> dss->remus = info;
> + dss->checkpointed_stream = LIBXL_CHECKPOINTED_STREAM_REMUS;
>
> assert(info);
>
> @@ -891,6 +892,7 @@ int libxl_domain_suspend(libxl_ctx *ctx, uint32_t domid, int fd, int flags,
> dss->type = type;
> dss->live = flags & LIBXL_SUSPEND_LIVE;
> dss->debug = flags & LIBXL_SUSPEND_DEBUG;
> + dss->checkpointed_stream = LIBXL_CHECKPOINTED_STREAM_NONE;
>
> libxl__domain_save(egc, dss);
> return AO_INPROGRESS;
> diff --git a/tools/libxl/libxl_dom_save.c b/tools/libxl/libxl_dom_save.c
> index 93061c7..8fe1625 100644
> --- a/tools/libxl/libxl_dom_save.c
> +++ b/tools/libxl/libxl_dom_save.c
> @@ -357,6 +357,13 @@ void libxl__domain_save(libxl__egc *egc, libxl__domain_save_state *dss)
> &dss->shs.callbacks.save.a;
> libxl__domain_suspend_state *dsps = &dss->dsps;
>
> + if (dss->checkpointed_stream && !r_info) {
> + LOG(ERROR, "Migration stream is checkpointed, but there's no "
> + "checkpoint info!");
> + rc = ERROR_FAIL;
> + goto out;
> + }
> +
> logdirty_init(&dss->logdirty);
> libxl__xswait_init(&dsps->pvcontrol);
> libxl__ev_evtchn_init(&dsps->guest_evtchn);
> @@ -388,9 +395,8 @@ void libxl__domain_save(libxl__egc *egc, libxl__domain_save_state *dss)
> dsps->guest_responded = 0;
> dsps->dm_savefile = libxl__device_model_savefile(gc, domid);
>
> - if (r_info != NULL) {
> + if (dss->checkpointed_stream == LIBXL_CHECKPOINTED_STREAM_REMUS) {
> dss->interval = r_info->interval;
> - dss->xcflags |= XCFLAGS_CHECKPOINTED;
> if (libxl_defbool_val(r_info->compression))
> dss->xcflags |= XCFLAGS_CHECKPOINT_COMPRESS;
> }
> @@ -414,7 +420,7 @@ void libxl__domain_save(libxl__egc *egc, libxl__domain_save_state *dss)
> }
>
> memset(callbacks, 0, sizeof(*callbacks));
> - if (r_info != NULL) {
> + if (dss->checkpointed_stream == LIBXL_CHECKPOINTED_STREAM_REMUS) {
> callbacks->suspend = libxl__remus_domain_suspend_callback;
> callbacks->postcopy = libxl__remus_domain_resume_callback;
> callbacks->checkpoint = libxl__remus_domain_save_checkpoint_callback;
> diff --git a/tools/libxl/libxl_internal.h b/tools/libxl/libxl_internal.h
> index 4fdf9d8..573c844 100644
> --- a/tools/libxl/libxl_internal.h
> +++ b/tools/libxl/libxl_internal.h
> @@ -2941,6 +2941,7 @@ struct libxl__domain_save_state {
> libxl_domain_type type;
> int live;
> int debug;
> + int checkpointed_stream;
> const libxl_domain_remus_info *remus;
> /* private */
> libxl__domain_suspend_state dsps;
> diff --git a/tools/libxl/libxl_save_callout.c b/tools/libxl/libxl_save_callout.c
> index a5039e6..12cc57e 100644
> --- a/tools/libxl/libxl_save_callout.c
> +++ b/tools/libxl/libxl_save_callout.c
> @@ -83,7 +83,7 @@ void libxl__xc_domain_save(libxl__egc *egc, libxl__domain_save_state *dss)
>
> const unsigned long argnums[] = {
> dss->domid, 0, 0, dss->xcflags, dss->hvm,
> - cbflags,
> + cbflags, dss->checkpointed_stream,
> };
>
> dss->shs.ao = ao;
> diff --git a/tools/libxl/libxl_save_helper.c b/tools/libxl/libxl_save_helper.c
> index b8f0390..9d2cbf6 100644
> --- a/tools/libxl/libxl_save_helper.c
> +++ b/tools/libxl/libxl_save_helper.c
> @@ -248,6 +248,7 @@ int main(int argc, char **argv)
> uint32_t flags = strtoul(NEXTARG,0,10);
> int hvm = atoi(NEXTARG);
> unsigned cbflags = strtoul(NEXTARG,0,10);
> + int checkpointed_stream = strtoul(NEXTARG,0,10);
> assert(!*++argv);
>
> helper_setcallbacks_save(&helper_save_callbacks, cbflags);
> @@ -256,7 +257,7 @@ int main(int argc, char **argv)
> setup_signals(save_signal_handler);
>
> r = xc_domain_save2(xch, io_fd, dom, max_iters, max_factor, flags,
> - &helper_save_callbacks, hvm);
> + &helper_save_callbacks, hvm, checkpointed_stream);
> complete(r);
>
> } else if (!strcmp(mode,"--restore-domain")) {
next prev parent reply other threads:[~2015-06-29 16:33 UTC|newest]
Thread overview: 103+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-06-25 6:25 [PATCH v3 COLOPre 00/26] Prerequisite patches for COLO Yang Hongyang
2015-06-25 6:25 ` [PATCH v3 COLOPre 01/26] tools/libxl: rename libxl__domain_suspend to libxl__domain_save Yang Hongyang
2015-06-29 15:43 ` Ian Campbell
2015-06-30 9:32 ` Yang Hongyang
2015-06-25 6:25 ` [PATCH v3 COLOPre 02/26] tools/libxl: move domain suspend code into libxl_dom_suspend.c Yang Hongyang
2015-06-25 6:25 ` [PATCH v3 COLOPre 03/26] tools/libxl: move domain resume " Yang Hongyang
2015-06-29 15:44 ` Ian Campbell
2015-06-25 6:25 ` [PATCH v3 COLOPre 04/26] tools/libxl: move remus code into libxl_remus.c Yang Hongyang
2015-06-29 15:48 ` Ian Campbell
2015-06-30 9:36 ` Yang Hongyang
2015-06-25 6:25 ` [PATCH v3 COLOPre 05/26] tools/libxl: move save/restore code into libxl_dom_save.c Yang Hongyang
2015-06-29 15:49 ` Ian Campbell
2015-06-25 6:25 ` [PATCH v3 COLOPre 06/26] libxl/save: Refactor libxl__domain_suspend_state Yang Hongyang
2015-06-29 16:01 ` Ian Campbell
2015-06-30 9:43 ` Yang Hongyang
2015-06-30 9:50 ` Ian Campbell
2015-06-30 10:05 ` Yang Hongyang
2015-06-25 6:25 ` [PATCH v3 COLOPre 07/26] libxc/restore: fix error handle of process_record Yang Hongyang
2015-06-29 16:07 ` Ian Campbell
2015-06-30 9:45 ` Yang Hongyang
2015-07-03 3:12 ` Yang Hongyang
2015-06-25 6:25 ` [PATCH v3 COLOPre 08/26] tools/libxc: support to resume uncooperative HVM guests Yang Hongyang
2015-06-29 16:27 ` Ian Campbell
2015-06-30 10:08 ` Wen Congyang
2015-06-30 10:59 ` Ian Campbell
2015-06-25 6:25 ` [PATCH v3 COLOPre 09/26] tools/libxl: introduce enum type libxl_checkpointed_stream Yang Hongyang
2015-06-29 16:30 ` Ian Campbell
2015-06-30 9:53 ` Yang Hongyang
2015-06-30 10:52 ` Ian Campbell
2015-07-01 2:05 ` Yang Hongyang
2015-07-01 10:36 ` Ian Campbell
2015-07-01 13:43 ` Yang Hongyang
2015-07-01 14:09 ` Ian Campbell
2015-06-25 6:25 ` [PATCH v3 COLOPre 10/26] migration/save: pass checkpointed_stream from libxl to libxc Yang Hongyang
2015-06-29 16:33 ` Ian Campbell [this message]
2015-06-25 6:25 ` [PATCH v3 COLOPre 11/26] tools/libxl: introduce a new API libxl__domain_restore() to load qemu state Yang Hongyang
2015-06-29 16:38 ` Ian Campbell
2015-06-30 10:04 ` Yang Hongyang
2015-06-30 10:54 ` Ian Campbell
2015-06-25 6:25 ` [PATCH v3 COLOPre 12/26] tools/libxl: Update libxl_domain_unpause() to support qemu-xen Yang Hongyang
2015-06-30 10:00 ` Ian Campbell
2015-07-01 2:10 ` Yang Hongyang
2015-07-01 10:38 ` Ian Campbell
2015-07-01 13:38 ` Yang Hongyang
2015-06-25 6:25 ` [PATCH v3 COLOPre 13/26] tools/libxl: introduce libxl__domain_common_switch_qemu_logdirty() Yang Hongyang
2015-06-25 6:25 ` [PATCH v3 COLOPre 14/26] tools/libxl: export logdirty_init Yang Hongyang
2015-06-30 10:01 ` Ian Campbell
2015-06-25 6:25 ` [PATCH v3 COLOPre 15/26] tools/libxl: Add back channel to allow migration target send data back Yang Hongyang
2015-06-30 10:07 ` Ian Campbell
2015-07-01 2:28 ` Yang Hongyang
2015-07-01 10:40 ` Ian Campbell
2015-07-01 13:46 ` Yang Hongyang
2015-06-25 6:25 ` [PATCH v3 COLOPre 16/26] tools/libx{l, c}: add back channel to libxc Yang Hongyang
2015-06-30 10:10 ` Ian Campbell
2015-07-01 2:38 ` Yang Hongyang
2015-07-01 10:42 ` Ian Campbell
2015-07-01 11:01 ` Andrew Cooper
2015-07-01 11:21 ` Ian Campbell
2015-07-01 12:07 ` Ian Jackson
2015-07-01 13:56 ` Yang Hongyang
2015-07-01 13:58 ` Ian Jackson
2015-07-01 14:21 ` Ian Campbell
2015-07-01 13:54 ` Yang Hongyang
2015-07-01 14:03 ` Andrew Cooper
2015-06-30 10:17 ` Ian Campbell
2015-07-01 2:40 ` Yang Hongyang
2015-06-25 6:25 ` [PATCH v3 COLOPre 17/26] tools/libx{l, c}: introduce should_checkpoint callback Yang Hongyang
2015-06-30 10:19 ` Ian Campbell
2015-07-01 2:43 ` Yang Hongyang
2015-07-01 10:43 ` Ian Campbell
2015-07-01 13:58 ` Yang Hongyang
2015-06-25 6:25 ` [PATCH v3 COLOPre 18/26] tools/libx{l, c}: add postcopy/suspend callback to restore side Yang Hongyang
2015-06-30 10:21 ` Ian Campbell
2015-07-01 2:48 ` Yang Hongyang
2015-06-25 6:25 ` [PATCH v3 COLOPre 19/26] libxc/migration: Specification update for DIRTY_BITMAP records Yang Hongyang
2015-06-30 10:24 ` Ian Campbell
2015-07-01 3:07 ` Yang Hongyang
2015-07-01 10:16 ` Andrew Cooper
2015-07-01 10:27 ` Ian Campbell
2015-07-01 10:39 ` Andrew Cooper
2015-07-01 11:00 ` Ian Campbell
2015-07-03 14:25 ` Andrew Cooper
2015-07-03 14:41 ` Ian Campbell
2015-06-25 6:25 ` [PATCH v3 COLOPre 20/26] libxc/migration: export read_record for common use Yang Hongyang
2015-06-25 6:25 ` [PATCH v3 COLOPre 21/26] tools/libxl: refactor write stream to support back channel Yang Hongyang
2015-06-30 10:28 ` Ian Campbell
2015-07-01 5:33 ` Wen Congyang
2015-07-01 10:45 ` Ian Campbell
2015-07-01 11:09 ` Wen Congyang
2015-06-25 6:25 ` [PATCH v3 COLOPre 22/26] tools/libxl: refactor read " Yang Hongyang
2015-06-30 10:39 ` Ian Campbell
2015-06-25 6:25 ` [PATCH v3 COLOPre 23/26] docs/libxl: Introduce COLO_CONTEXT to support migration v2 colo streams Yang Hongyang
2015-06-30 10:42 ` Ian Campbell
2015-07-01 3:10 ` Yang Hongyang
2015-07-01 10:44 ` Ian Campbell
2015-07-01 14:05 ` Yang Hongyang
2015-06-25 6:25 ` [PATCH v3 COLOPre 24/26] tools/libxl: rename remus device to checkpoint device Yang Hongyang
2015-06-30 10:43 ` Ian Campbell
2015-07-01 3:11 ` Yang Hongyang
2015-06-25 6:25 ` [PATCH v3 COLOPre 25/26] tools/libxl: adjust the indentation Yang Hongyang
2015-06-25 6:25 ` [PATCH v3 COLOPre 26/26] tools/libxl: don't touch remus in checkpoint_device Yang Hongyang
2015-06-30 10:50 ` Ian Campbell
2015-07-01 3:11 ` Yang Hongyang
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=1435595598.32500.385.camel@citrix.com \
--to=ian.campbell@citrix.com \
--cc=Ian.Jackson@eu.citrix.com \
--cc=andrew.cooper3@citrix.com \
--cc=eddie.dong@intel.com \
--cc=guijianfeng@cn.fujitsu.com \
--cc=rshriram@cs.ubc.ca \
--cc=wei.liu2@citrix.com \
--cc=wency@cn.fujitsu.com \
--cc=xen-devel@lists.xen.org \
--cc=yanghy@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 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.