From: Wei Liu Subject: Re: [PATCH 0/2] Bulk mem-share identical domains Date: Fri, 9 Oct 2015 13:35:06 +0100 Message-ID: <20151009123506.GF20846@zion.uk.xensource.com> References: <1443990339-19590-1-git-send-email-tamas@tklengyel.com> <1444141579.5302.199.camel@citrix.com> <20151007104834.GB13274@zion.uk.xensource.com> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Return-path: Received: from mail6.bemta5.messagelabs.com ([195.245.231.135]) by lists.xen.org with esmtp (Exim 4.72) (envelope-from ) id 1ZkWtC-0005KW-Jm for xen-devel@lists.xenproject.org; Fri, 09 Oct 2015 12:35:10 +0000 Content-Disposition: inline In-Reply-To: List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Sender: xen-devel-bounces@lists.xen.org Errors-To: xen-devel-bounces@lists.xen.org To: Tamas K Lengyel Cc: Wei Liu , Ian Campbell , Stefano Stabellini , George Dunlap , Andrew Cooper , Ian Jackson , Jan Beulich , Xen-devel , Keir Fraser List-Id: xen-devel@lists.xenproject.org On Thu, Oct 08, 2015 at 03:07:19PM -0600, Tamas K Lengyel wrote: > In case you miss it, there is now soft-reset support which dumps all > > memory plus various states from one domain to another, and toolstack > > will take care of QEMU and various userspace bits. This might be useful > > to you? > > > > To be clear, this is just FYI, not suggesting we block this series. > > > > Wei. > > > > Hi Wei, > it might be very useful but on a casual scan I couldn't really find much on > the soft-reset option (no xl cmdline option and only a single call to > xc_domain_soft_reset in libxl.c). For cloning I would need the origin > domain to remain loaded as before (at least the memory, qemu can be killed) > and then I would only need the QEMU setup bits from soft-reset. Any > pointers on how to go about this would be very helpful ;) > Soft-reset is in fact a slightly modified version of save / restore. I don't think you can directly use soft-reset to clone a domain. What I meant was you might be able to reuse some of the code in soft-reset, at least on toolstack side. For example, you can invent a hypercall to share all pages and transfer states from a guest to another. In toolstack, you create a new domain, save original domain's QEMU state, issue aforementioned hypercall (*), and restore QEMU. It would still require some coding to disentangle toolstack code to do what you need, but these different phases already exist in toolstack code for soft-reset except for the hypercall. What makes your need different from soft-reset is that, a) the hypercall is different b) you don't destroy the original domain afterwards. YMMV. Wei. > Thanks, > Tamas