From mboxrd@z Thu Jan 1 00:00:00 1970 From: Yang Hongyang Subject: Re: [PATCH v5 04/14] libxc/migration: Pass checkpoint information into the save algorithm. Date: Thu, 14 May 2015 09:03:17 +0800 Message-ID: <5553F455.80202@cn.fujitsu.com> References: <1431482044-21286-1-git-send-email-yanghy@cn.fujitsu.com> <1431482044-21286-5-git-send-email-yanghy@cn.fujitsu.com> <1431532169.8263.343.camel@citrix.com> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii"; Format="flowed" Content-Transfer-Encoding: 7bit Return-path: In-Reply-To: <1431532169.8263.343.camel@citrix.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: Ian Campbell Cc: wei.liu2@citrix.com, eddie.dong@intel.com, wency@cn.fujitsu.com, andrew.cooper3@citrix.com, yunhong.jiang@intel.com, ian.jackson@eu.citrix.com, xen-devel@lists.xen.org, rshriram@cs.ubc.ca List-Id: xen-devel@lists.xenproject.org On 05/13/2015 11:49 PM, Ian Campbell wrote: > On Wed, 2015-05-13 at 09:53 +0800, Yang Hongyang wrote: >> From: Andrew Cooper > > OOI how was this signalled to the old code? The old code check the callbacks "postcopy & checkpoint", if the callbacks exists, it will call them which I think is unreliable, so I add this flag to explicitly indicate a checkpointed stream in the new code. However, it is backward compatible, the legacy migration just don't know this flag and will ignore it. > >> >> Signed-off-by: Andrew Cooper >> CC: Ian Campbell >> CC: Ian Jackson >> CC: Wei Liu >> CC: Yang Hongyang >> --- >> tools/libxc/include/xenguest.h | 1 + >> tools/libxc/xc_sr_common.h | 3 +++ >> tools/libxc/xc_sr_save.c | 3 +++ >> tools/libxl/libxl_dom.c | 1 + >> 4 files changed, 8 insertions(+) >> >> diff --git a/tools/libxc/include/xenguest.h b/tools/libxc/include/xenguest.h >> index 8e39075..7581263 100644 >> --- a/tools/libxc/include/xenguest.h >> +++ b/tools/libxc/include/xenguest.h >> @@ -30,6 +30,7 @@ >> #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 >> diff --git a/tools/libxc/xc_sr_common.h b/tools/libxc/xc_sr_common.h >> index c4fe92c..c0f90d4 100644 >> --- a/tools/libxc/xc_sr_common.h >> +++ b/tools/libxc/xc_sr_common.h >> @@ -174,6 +174,9 @@ struct xc_sr_context >> /* Live migrate vs non live suspend. */ >> bool live; >> >> + /* Plain VM, or checkpoints over time. */ >> + bool 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 66fcd3e..caa727d 100644 >> --- a/tools/libxc/xc_sr_save.c >> +++ b/tools/libxc/xc_sr_save.c >> @@ -732,6 +732,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); >> >> /* >> * TODO: Find some time to better tweak the live migration algorithm. >> @@ -745,6 +746,8 @@ int xc_domain_save2(xc_interface *xch, int io_fd, uint32_t dom, >> /* Sanity checks for callbacks. */ >> if ( hvm ) >> assert(callbacks->switch_qemu_logdirty); >> + if ( ctx.save.checkpointed ) >> + assert(callbacks->checkpoint && callbacks->postcopy); >> >> IPRINTF("In experimental %s", __func__); >> DPRINTF("fd %d, dom %u, max_iters %u, max_factor %u, flags %u, hvm %d", >> diff --git a/tools/libxl/libxl_dom.c b/tools/libxl/libxl_dom.c >> index f408646..a0c9850 100644 >> --- a/tools/libxl/libxl_dom.c >> +++ b/tools/libxl/libxl_dom.c >> @@ -2003,6 +2003,7 @@ void libxl__domain_suspend(libxl__egc *egc, libxl__domain_suspend_state *dss) >> >> if (r_info != NULL) { >> dss->interval = r_info->interval; >> + dss->xcflags |= XCFLAGS_CHECKPOINTED; >> if (libxl_defbool_val(r_info->compression)) >> dss->xcflags |= XCFLAGS_CHECKPOINT_COMPRESS; >> } > > > . > -- Thanks, Yang.