From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([140.186.70.92]:38610) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1QcIYK-0006qu-Oq for qemu-devel@nongnu.org; Thu, 30 Jun 2011 10:49:13 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1QcIYJ-0004dj-0V for qemu-devel@nongnu.org; Thu, 30 Jun 2011 10:49:12 -0400 Received: from mx1.redhat.com ([209.132.183.28]:28353) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1QcIYI-0004dd-HJ for qemu-devel@nongnu.org; Thu, 30 Jun 2011 10:49:10 -0400 Message-ID: <4E0C8D90.8050305@redhat.com> Date: Thu, 30 Jun 2011 16:52:00 +0200 From: Kevin Wolf MIME-Version: 1.0 References: <20110628194106.GA17443@amt.cnet> <4E0ADAE0.6040204@redhat.com> <20110629154134.GA6631@amt.cnet> <20110630143620.GA4366@amt.cnet> In-Reply-To: <20110630143620.GA4366@amt.cnet> Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Subject: Re: [Qemu-devel] KVM call agenda for June 28 List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Marcelo Tosatti Cc: Chris Wright , KVM devel mailing list , quintela@redhat.com, Stefan Hajnoczi , Dor Laor , qemu-devel@nongnu.org, Avi Kivity Am 30.06.2011 16:36, schrieb Marcelo Tosatti: >> 4. Live block copy API and high-level control - the main code that >> adds the live block copy feature. Existing patches by Marcelo, can be >> restructured to use common core by Marcelo. > > Can use your proposed block_stream interface, with a "block_switch" > command on top, so: > > 1) management creates copy.img with backing file current.img, allows > access > 2) management issues "block_switch dev copy.img" > 3) management issues "block_stream dev base" Isn't this block_switch command the same as the existing snapshot_blkdev? > Thought of implementing "block_stream" command by reopening device with > > blkstream:imagename.img > > Then: > > AIO_READ: > - for each cluster in request: > - if allocated-or-in-final-base, read. > - check write queue, if present wait on it, if not, add "copy" > entry to write queue. > - issue cluster sized read from source. > - on completion: > - copy data to original read buffer, complete it. > - if not cancelled, write cluster to destination. > > AIO_WRITE > for each cluster in request: > - check write queue, cancel/wait for "copy" entry. > - add "guest" entry to write queue. > - issue write to destination. > - on completion: > - remove write queue entry. > > > With the 0...END background read, once it completes write final base > file for image. > > So block_stream/block_stream_cancel/block_stream_status commands, the > background read and the rebase -u update can be separate from the block > driver. The way how it works looks good to me, I'm just not entirely sure about the right place to implement it. I think request queueing and copy on read could be useful outside blkstream, too. Kevin