From mboxrd@z Thu Jan 1 00:00:00 1970 From: Isaku Yamahata Subject: Re: [PATCH 21/21] postcopy: implement postcopy livemigration Date: Wed, 4 Jan 2012 12:29:34 +0900 Message-ID: <20120104032934.GM19274@valinux.co.jp> References: <4EFC8FF2.4050702@redhat.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Cc: t.hirofuchi@aist.go.jp, qemu-devel@nongnu.org, kvm@vger.kernel.org, satoshi.itoh@aist.go.jp To: Avi Kivity Return-path: Content-Disposition: inline In-Reply-To: <4EFC8FF2.4050702@redhat.com> List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+gceq-qemu-devel=gmane.org@nongnu.org Sender: qemu-devel-bounces+gceq-qemu-devel=gmane.org@nongnu.org List-Id: kvm.vger.kernel.org On Thu, Dec 29, 2011 at 06:06:10PM +0200, Avi Kivity wrote: > On 12/29/2011 03:26 AM, Isaku Yamahata wrote: > > This patch implements postcopy livemigration. > > > > > > +/* RAM is allocated via umem for postcopy incoming mode */ > > +#define RAM_POSTCOPY_UMEM_MASK (1 << 1) > > + > > typedef struct RAMBlock { > > uint8_t *host; > > ram_addr_t offset; > > @@ -485,6 +488,10 @@ typedef struct RAMBlock { > > #if defined(__linux__) && !defined(TARGET_S390X) > > int fd; > > #endif > > + > > +#ifdef CONFIG_POSTCOPY > > + UMem *umem; /* for incoming postcopy mode */ > > +#endif > > } RAMBlock; > > Is it possible to implement this via the MemoryListener API (which > replaces CPUPhysMemoryClient)? This is how kvm, vhost, and xen manage > their memory tables. I'm afraid no. Those three you listed above are for outgoing part, but this case is for incoming part. The requirement is quite different from those three. What is needed is - get the corresponding RAMBlock and UMem from (id, idlen) - hook ram_alloc/ram_free (or RAM api corresponding) thanks, -- yamahata From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([140.186.70.92]:41037) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1RiHXn-0004CV-Ae for qemu-devel@nongnu.org; Tue, 03 Jan 2012 22:29:40 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1RiHXm-0007mj-Cy for qemu-devel@nongnu.org; Tue, 03 Jan 2012 22:29:39 -0500 Received: from mail.valinux.co.jp ([210.128.90.3]:37033) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1RiHXm-0007md-2K for qemu-devel@nongnu.org; Tue, 03 Jan 2012 22:29:38 -0500 Date: Wed, 4 Jan 2012 12:29:34 +0900 From: Isaku Yamahata Message-ID: <20120104032934.GM19274@valinux.co.jp> References: <4EFC8FF2.4050702@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <4EFC8FF2.4050702@redhat.com> Subject: Re: [Qemu-devel] [PATCH 21/21] postcopy: implement postcopy livemigration List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Avi Kivity Cc: t.hirofuchi@aist.go.jp, qemu-devel@nongnu.org, kvm@vger.kernel.org, satoshi.itoh@aist.go.jp On Thu, Dec 29, 2011 at 06:06:10PM +0200, Avi Kivity wrote: > On 12/29/2011 03:26 AM, Isaku Yamahata wrote: > > This patch implements postcopy livemigration. > > > > > > +/* RAM is allocated via umem for postcopy incoming mode */ > > +#define RAM_POSTCOPY_UMEM_MASK (1 << 1) > > + > > typedef struct RAMBlock { > > uint8_t *host; > > ram_addr_t offset; > > @@ -485,6 +488,10 @@ typedef struct RAMBlock { > > #if defined(__linux__) && !defined(TARGET_S390X) > > int fd; > > #endif > > + > > +#ifdef CONFIG_POSTCOPY > > + UMem *umem; /* for incoming postcopy mode */ > > +#endif > > } RAMBlock; > > Is it possible to implement this via the MemoryListener API (which > replaces CPUPhysMemoryClient)? This is how kvm, vhost, and xen manage > their memory tables. I'm afraid no. Those three you listed above are for outgoing part, but this case is for incoming part. The requirement is quite different from those three. What is needed is - get the corresponding RAMBlock and UMem from (id, idlen) - hook ram_alloc/ram_free (or RAM api corresponding) thanks, -- yamahata