From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:33803) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1UrREP-0001xo-96 for qemu-devel@nongnu.org; Tue, 25 Jun 2013 07:16:19 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1UrREM-0001Vt-JE for qemu-devel@nongnu.org; Tue, 25 Jun 2013 07:16:16 -0400 Received: from e28smtp08.in.ibm.com ([122.248.162.8]:56763) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1UrREM-0001V8-2f for qemu-devel@nongnu.org; Tue, 25 Jun 2013 07:16:14 -0400 Received: from /spool/local by e28smtp08.in.ibm.com with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted for from ; Tue, 25 Jun 2013 16:37:31 +0530 Received: from d28relay01.in.ibm.com (d28relay01.in.ibm.com [9.184.220.58]) by d28dlp01.in.ibm.com (Postfix) with ESMTP id 226BDE0054 for ; Tue, 25 Jun 2013 16:45:40 +0530 (IST) Received: from d28av02.in.ibm.com (d28av02.in.ibm.com [9.184.220.64]) by d28relay01.in.ibm.com (8.13.8/8.13.8/NCO v10.0) with ESMTP id r5PBGMmI26935464 for ; Tue, 25 Jun 2013 16:46:22 +0530 Received: from d28av02.in.ibm.com (loopback [127.0.0.1]) by d28av02.in.ibm.com (8.14.4/8.13.1/NCO v10.0 AVout) with ESMTP id r5PBG7Ix003978 for ; Tue, 25 Jun 2013 21:16:07 +1000 Message-ID: <51C97B8B.2010304@linux.vnet.ibm.com> Date: Tue, 25 Jun 2013 19:14:19 +0800 From: Wenchao Xia MIME-Version: 1.0 References: <51C2C465.1090701@linux.vnet.ibm.com> <20130625091300.GA26177@stefanha-thinkpad.redhat.com> In-Reply-To: <20130625091300.GA26177@stefanha-thinkpad.redhat.com> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8bit Subject: Re: [Qemu-devel] [RFC] qemu-img: add option -d in convert List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Stefan Hajnoczi Cc: Kevin Wolf , Anthony Liguori , qemu-devel , Paolo Bonzini , Dietmar Maurer 于 2013-6-25 17:13, Stefan Hajnoczi 写道: > On Thu, Jun 20, 2013 at 04:59:17PM +0800, Wenchao Xia wrote: > > If I understand correctly, you have a backing chain with internal > snapshots: > >> imageA(sn0)->imageB(sn0,sn1)->imageC(sn0) > > And you want to convert this to a chain of external snapshots: > What it looks like is convert into external snapshots, actually requirement is get delta data from internal snapshot, external snapshots have delta data by nature so it is a way to orginize it. This patch will help get that delta data. >> imageA_sn0.qcow2-->imageA.qcow2-->imageB_sn0.qcow2-->imageB_sn1.qcow2- >> ->imageB.qcow2-->imageC_sn0.qcow2-->imageC.qcow2 > > You also want each image file to contain only data that is not in the > parent. So imageA.qcow2 would not contain identical clusters from > imageA_sn0.qcow2. > yes, it is the purpose, delta data. > The most efficient way of doing this is by looking into the L1/L2 tables > of the imageA(sn0) and imageA so that you know which clusters are > different. > There would be two steps I think: 1st is simply compare the cluster to get delta, 2nd is improve it: when 2 snapshots is in one qcow2, introduce a function to looking into L1/L2. > This is a weird operation. It also has a dual, converting the external > snapshot chain into a chain of image files with internal snapshots - > again sharing clusters instead of duplicating them. > Indeed, but converting external chain into internal snapshots, is not that useful as its revert, since in most case qemu-img can directly convert external chain back to restore a snapshot. It can be added if some case appear. > It's possible to implement this but I'm a little surprised that anyone > would want to do this. And I wonder if management tools can cope with > this mix of internal and external snapshots :). > I think it is useful: internal snapshot have advantage about performance, but disadvantage for delta data retrieving. This patch will help it. When it is online, the user, for example, libvirt, can retrieve internal/external ones very similar, it simply calls qemu-img to get the delta for both case. > Stefan > -- Best Regards Wenchao Xia