From mboxrd@z Thu Jan 1 00:00:00 1970 From: Ian Campbell Subject: Re: [PATCH v3 COLOPre 11/26] tools/libxl: introduce a new API libxl__domain_restore() to load qemu state Date: Tue, 30 Jun 2015 11:54:18 +0100 Message-ID: <1435661658.21469.90.camel@citrix.com> References: <1435213552-10556-1-git-send-email-yanghy@cn.fujitsu.com> <1435213552-10556-12-git-send-email-yanghy@cn.fujitsu.com> <1435595895.32500.389.camel@citrix.com> <559269BC.7090507@cn.fujitsu.com> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Return-path: In-Reply-To: <559269BC.7090507@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, wency@cn.fujitsu.com, andrew.cooper3@citrix.com, yunhong.jiang@intel.com, eddie.dong@intel.com, xen-devel@lists.xen.org, Anthony Perard , guijianfeng@cn.fujitsu.com, rshriram@cs.ubc.ca, ian.jackson@eu.citrix.com List-Id: xen-devel@lists.xenproject.org On Tue, 2015-06-30 at 18:04 +0800, Yang Hongyang wrote: > > On 06/30/2015 12:38 AM, Ian Campbell wrote: > > On Thu, 2015-06-25 at 14:25 +0800, Yang Hongyang wrote: > >> Secondary vm is running in colo mode. So we will do > >> the following things again and again: > >> 1. suspend both primay vm and secondary vm > >> 2. sync the state > >> 3. resume both primary vm and secondary vm > >> We will send qemu's state each time in step2, and > >> slave's qemu should read it each time before resuming > >> secondary vm. Introduce a new API libxl__domain_restore() > >> to do it. This API should be called before resuming > >> secondary vm. > > > > I think before this patch the state was passed to qemu as a parameter > > when it was launched, is that correct? If so then that would be worth > > mentioning for completeness. > > Inaccurate I think. What you said before is the normal migration, in that > case, yes, the state was passed to qemu as a parameter. Which is what I think I said. > With COLO, the > first step is live migration, so the state is still passed to qemu as a > parameter when the live migration ended. The new introduced API only used > when we need to restore the DM state after a checkpoint, at this point, > guest QEMU already started, we can not pass the state as a parameter like > we do on first boot, so we introduce this API to restore the state after > QEMU has started. This sort of explanation would be good to have in the commit message, especially due to the subtlety around first and subsequent checkpoints. > >> +int libxl__domain_restore(libxl__gc *gc, uint32_t domid) > > > > We don't have any libxl__domain_save counterpart, but we do have > > libxl__domain_save_device_model, so I wonder if the upcoming callers > > ought to just call that direct? Especially given that this function > > isn't any kind of generic domain restore, but has rather specific > > functionality (in particular it fails for PV guests). > > Maybe we just introduce libxl__domain_restore_device_model() and call > this when needed, discard the new libxl__domain_restore() API, what do > you think? Yes, that's what I think I meant to say (but didn't). Ian.