From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:59556) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Us85I-0004xS-JG for qemu-devel@nongnu.org; Thu, 27 Jun 2013 05:01:46 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Us85H-0003K6-GR for qemu-devel@nongnu.org; Thu, 27 Jun 2013 05:01:44 -0400 Received: from mail-wi0-x22e.google.com ([2a00:1450:400c:c05::22e]:49987) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Us85H-0003Jx-B9 for qemu-devel@nongnu.org; Thu, 27 Jun 2013 05:01:43 -0400 Received: by mail-wi0-f174.google.com with SMTP id k10so2853846wiv.7 for ; Thu, 27 Jun 2013 02:01:42 -0700 (PDT) Date: Thu, 27 Jun 2013 11:01:39 +0200 From: Stefan Hajnoczi Message-ID: <20130627090139.GC14351@stefanha-thinkpad.redhat.com> References: <51C2C465.1090701@linux.vnet.ibm.com> <20130625091300.GA26177@stefanha-thinkpad.redhat.com> <51C97B8B.2010304@linux.vnet.ibm.com> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: <51C97B8B.2010304@linux.vnet.ibm.com> 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: Wenchao Xia Cc: Kevin Wolf , Anthony Liguori , qemu-devel , Paolo Bonzini , Dietmar Maurer On Tue, Jun 25, 2013 at 07:14:19PM +0800, Wenchao Xia wrote: > 于 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. Copying all the data out into external files in order to get is_allocated information seems very inefficient. We've discussed dirty block tracking APIs on the list several times. This seems related. Maybe it's time to tackle this properly for both external and internal snapshots. The reason why a dirty block tracking API is also helpful is that not all tools want to learn how to open different image file formats. (Even with libqblock.) The drity block tracking API gives them information which they can use together with a single interface like NBD or a libvirt block pread-style interface to read out dirty blocks. BTW we already have qemu-io -c map which prints out allocation information for an image file. If that command is extended to support -s then you can get your info easily. Stefan