From mboxrd@z Thu Jan 1 00:00:00 1970 From: Avi Kivity Subject: Re: [PATCH v5 4/5] Inter-VM shared memory PCI device Date: Mon, 10 May 2010 19:59:21 +0300 Message-ID: <4BE83B69.4040904@redhat.com> References: <1271872408-22842-1-git-send-email-cam@cs.ualberta.ca> <1271872408-22842-2-git-send-email-cam@cs.ualberta.ca> <1271872408-22842-3-git-send-email-cam@cs.ualberta.ca> <1271872408-22842-4-git-send-email-cam@cs.ualberta.ca> <1271872408-22842-5-git-send-email-cam@cs.ualberta.ca> <4BE7F517.5010707@redhat.com> <4BE82623.4000905@redhat.com> <4BE82877.1040408@codemonkey.ws> Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Cc: Cam Macdonell , kvm@vger.kernel.org, qemu-devel@nongnu.org To: Anthony Liguori Return-path: Received: from mx1.redhat.com ([209.132.183.28]:10659 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751187Ab0EJQ71 (ORCPT ); Mon, 10 May 2010 12:59:27 -0400 In-Reply-To: <4BE82877.1040408@codemonkey.ws> Sender: kvm-owner@vger.kernel.org List-ID: On 05/10/2010 06:38 PM, Anthony Liguori wrote: > >>> Otherwise, if the BAR is allocated during initialization, I would have >>> to use MAP_FIXED to mmap the memory. This is what I did before the >>> qemu_ram_mmap() function was added. >> >> What would happen to any data written to the BAR before the the >> handshake completed? I think it would disappear. > > You don't have to do MAP_FIXED. You can allocate a ram area and map > that in when disconnected. When you connect, you create another ram > area and memcpy() the previous ram area to the new one. You then map > the second ram area in. But it's a shared memory area. Other peers could have connected and written some data in. The memcpy() would destroy their data. > > From the guest's perspective, it's totally transparent. For the > backend, I'd suggest having an explicit "initialized" ack or something > so that it knows that the data is now mapped to the guest. From the peers' perspective, it's non-transparent :( Also it doubles the transient memory requirement. > > If you're doing just a ring queue in shared memory, it should allow > disconnect/reconnect during live migration asynchronously to the > actual qemu live migration. > Live migration of guests using shared memory is interesting. You'd need to freeze all peers on one node, disconnect, reconnect, and restart them on the other node. -- error compiling committee.c: too many arguments to function