From mboxrd@z Thu Jan 1 00:00:00 1970 From: Yang Hongyang Subject: Re: [PATCH v3 COLOPre 18/26] tools/libx{l, c}: add postcopy/suspend callback to restore side Date: Wed, 1 Jul 2015 10:48:45 +0800 Message-ID: <5593550D.9040905@cn.fujitsu.com> References: <1435213552-10556-1-git-send-email-yanghy@cn.fujitsu.com> <1435213552-10556-19-git-send-email-yanghy@cn.fujitsu.com> <1435659694.21469.76.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: <1435659694.21469.76.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, 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@eu.citrix.com List-Id: xen-devel@lists.xenproject.org On 06/30/2015 06:21 PM, Ian Campbell wrote: > On Thu, 2015-06-25 at 14:25 +0800, Yang Hongyang wrote: >> Secondary(restore side) is running under COLO, we also need >> postcopy/suspend callbacks. > > I wonder if this and the previous patch ought to be folded into the > patches which introduce the actual use of the callback? No problem, will squash these 2 patches. >> >> Signed-off-by: Yang Hongyang >> --- >> tools/libxc/include/xenguest.h | 10 ++++++++++ >> tools/libxl/libxl_save_msgs_gen.pl | 4 ++-- >> 2 files changed, 12 insertions(+), 2 deletions(-) >> >> diff --git a/tools/libxc/include/xenguest.h b/tools/libxc/include/xenguest.h >> index e804a1d..dcc441a 100644 >> --- a/tools/libxc/include/xenguest.h >> +++ b/tools/libxc/include/xenguest.h >> @@ -114,6 +114,16 @@ struct restore_callbacks { >> int (*toolstack_restore)(uint32_t domid, const uint8_t *buf, >> uint32_t size, void* data); >> >> + /* Called after a new checkpoint to suspend the guest. >> + */ >> + int (*suspend)(void* data); >> + >> + /* Called after the secondary vm is ready to resume. >> + * Callback function resumes the guest & the device model, >> + * returns to xc_domain_restore. >> + */ >> + int (*postcopy)(void* data); >> + >> /* A checkpoint record has been found in the stream */ >> int (*checkpoint)(void* data); >> >> diff --git a/tools/libxl/libxl_save_msgs_gen.pl b/tools/libxl/libxl_save_msgs_gen.pl >> index 7284975..86cd395 100755 >> --- a/tools/libxl/libxl_save_msgs_gen.pl >> +++ b/tools/libxl/libxl_save_msgs_gen.pl >> @@ -23,8 +23,8 @@ our @msgs = ( >> STRING doing_what), >> 'unsigned long', 'done', >> 'unsigned long', 'total'] ], >> - [ 3, 'scxA', "suspend", [] ], >> - [ 4, 'scxA', "postcopy", [] ], >> + [ 3, 'srcxA', "suspend", [] ], >> + [ 4, 'srcxA', "postcopy", [] ], >> [ 5, 'srcxA', "checkpoint", [] ], >> [ 6, 'srcxA', "should_checkpoint", [] ], >> [ 7, 'scxA', "switch_qemu_logdirty", [qw(int domid > > > . > -- Thanks, Yang.