From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:54497) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1V9sL0-00053E-9i for qemu-devel@nongnu.org; Thu, 15 Aug 2013 03:51:27 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1V9sKr-0003bC-Bo for qemu-devel@nongnu.org; Thu, 15 Aug 2013 03:51:18 -0400 Received: from e28smtp02.in.ibm.com ([122.248.162.2]:35700) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1V9sKq-0003Zz-MV for qemu-devel@nongnu.org; Thu, 15 Aug 2013 03:51:09 -0400 Received: from /spool/local by e28smtp02.in.ibm.com with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted for from ; Thu, 15 Aug 2013 13:11:12 +0530 Received: from d28relay02.in.ibm.com (d28relay02.in.ibm.com [9.184.220.59]) by d28dlp03.in.ibm.com (Postfix) with ESMTP id E328A1258051 for ; Thu, 15 Aug 2013 13:20:39 +0530 (IST) Received: from d28av01.in.ibm.com (d28av01.in.ibm.com [9.184.220.63]) by d28relay02.in.ibm.com (8.13.8/8.13.8/NCO v10.0) with ESMTP id r7F7qNCT40960032 for ; Thu, 15 Aug 2013 13:22:23 +0530 Received: from d28av01.in.ibm.com (localhost [127.0.0.1]) by d28av01.in.ibm.com (8.14.4/8.14.4/NCO v10.0 AVout) with ESMTP id r7F7ouBX026579 for ; Thu, 15 Aug 2013 13:20:57 +0530 Message-ID: <520C8855.3020707@linux.vnet.ibm.com> Date: Thu, 15 Aug 2013 15:50:45 +0800 From: Wenchao Xia MIME-Version: 1.0 References: <1376413436-5424-1-git-send-email-kaveh@cs.vu.nl> <00D703C3BB04779367573E57@nimrod.local> <520B6D29.10507@cs.vu.nl> <74C74303-33D3-4E60-B999-5F96AEEFEB6F@alex.org.uk> <520B896E.8050704@cs.vu.nl> <520B937D.6060105@cs.vu.nl> <20130814153216.GN4583@dhcp-200-207.str.redhat.com> In-Reply-To: <20130814153216.GN4583@dhcp-200-207.str.redhat.com> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8bit Subject: Re: [Qemu-devel] [PATCH] Introduce cache images for the QCOW2 format List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Kevin Wolf Cc: Alex Bligh , Kaveh Razavi , qemu-devel@nongnu.org, Stefan Hajnoczi 于 2013-8-14 23:32, Kevin Wolf 写道: > Am 14.08.2013 um 16:26 hat Kaveh Razavi geschrieben: >> On 08/14/2013 03:50 PM, Alex Bligh wrote: >>> Assuming the cache quota is not exhausted, how do you know how that >>> a VM has finished 'creating' the cache? At any point it might >>> read a bit more from the backing image. >> >> I was assuming on shutdown. > > Wait, so you're not really changing the cache while it's used, but you > only create it once and then use it like a regular backing file? If so, > the only thing we need to talk about is the creation, because there's no > difference for using it. > > Creation can use the existing copy-on-read functionality, and the only > thing you need additionally is a way to turn copy-on-read off at the > right point. > > Or do I misunderstand what you're doing? > > Kevin > This cache capability seems have little to do with qcow2, but a general block function: start/stop copy on read for one BS in a backing chain. If so, suggest: 1 refine existing general copy on read code, not in qcow2.c but general block code, make it able to start/stop copy on read for a BDS in the chain. 2 add qmp interface for it. Then the work flow will be: step 1: prepare image, not related to qcow2 format. qemu-img create cache.img -b base.img qemu-img create vm1.img -b cache.img step 2: boot vm1, vm2: qemu -hda vm1.img -COR cache.img qemu -hda vm2.img -- Best Regards Wenchao Xia