From: Wei Liu Subject: Re: [RFC PATCH COLO v5 04/29] Update libxl__domain_suspend_common_switch_qemu_logdirty() for colo Date: Wed, 8 Apr 2015 19:12:08 +0100 Message-ID: <20150408181208.GS30811@zion.uk.xensource.com> References: <1427870525-18686-1-git-send-email-yanghy@cn.fujitsu.com> <1427870525-18686-5-git-send-email-yanghy@cn.fujitsu.com> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Return-path: Content-Disposition: inline In-Reply-To: <1427870525-18686-5-git-send-email-yanghy@cn.fujitsu.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: Yang Hongyang Cc: wei.liu2@citrix.com, ian.campbell@citrix.com, wency@cn.fujitsu.com, eddie.dong@intel.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 Wed, Apr 01, 2015 at 02:41:40PM +0800, Yang Hongyang wrote: > From: Wen Congyang > > Secondary vm is running in colo mode. So we need to > send secondary vm's dirty page information to master. > libxl__domain_suspend_common_switch_qemu_logdirty() is to enable > qemu logdirty. But it uses domain_suspend_state, and calls > libxl__xc_domain_saverestore_async_callback_done() > before exits. > > Introduce a new API libxl__domain_common_switch_qemu_logdirty(). > This API only uses libxl__logdirty_switch, and calls > lds->callback before exits. > I have some dumb questions. What is the purpose of this refactoring? How are the refactoring and new API related to your intended functionalities? You mention you need to send back secondary vm state to master, where is it done / will it be done? > Signed-off-by: Wen Congyang > --- [...] > > /*----- callbacks, called by xc_domain_save -----*/ > @@ -2001,6 +2019,7 @@ void libxl__domain_suspend(libxl__egc *egc, libxl__domain_suspend_state *dss) > libxl__domain_suspend_state2 *dss2 = &dss->dss2; > > logdirty_init(&dss->logdirty); > + dss->logdirty.ao = ao; > libxl__xswait_init(&dss2->pvcontrol); > libxl__ev_evtchn_init(&dss2->guest_evtchn); > libxl__ev_xswatch_init(&dss2->guest_watch); > diff --git a/tools/libxl/libxl_internal.h b/tools/libxl/libxl_internal.h > index 3b4e6c4..6470866 100644 > --- a/tools/libxl/libxl_internal.h > +++ b/tools/libxl/libxl_internal.h > @@ -2812,13 +2812,18 @@ typedef void libxl__domain_suspend_cb(libxl__egc*, > typedef void libxl__save_device_model_cb(libxl__egc*, > libxl__domain_suspend_state*, int rc); > > -typedef struct libxl__logdirty_switch { > +typedef struct libxl__logdirty_switch libxl__logdirty_switch; This change looks unnecessary. Wei.