From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:47805) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZC5D2-0002FA-KD for qemu-devel@nongnu.org; Mon, 06 Jul 2015 08:09:17 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1ZC5Cx-0007gH-LS for qemu-devel@nongnu.org; Mon, 06 Jul 2015 08:09:16 -0400 Received: from mx1.redhat.com ([209.132.183.28]:59050) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZC5Cx-0007ft-Dk for qemu-devel@nongnu.org; Mon, 06 Jul 2015 08:09:11 -0400 References: <201507061620581832887@sangfor.com.cn> From: Max Reitz Message-ID: <559A6FDF.9050101@redhat.com> Date: Mon, 6 Jul 2015 14:09:03 +0200 MIME-Version: 1.0 In-Reply-To: <201507061620581832887@sangfor.com.cn> Content-Type: text/plain; charset=gbk; format=flowed Content-Transfer-Encoding: quoted-printable Subject: Re: [Qemu-devel] Can the backing file of qcow2 points to a snapshot of base file? List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: vt , qemu-devel , kwolf , stefanha On 06.07.2015 10:20, vt wrote: > Hi. > If a base qcow2 image snapshot chain like this: > base.qcow2: [A] -> [B] -> [C] > [C] is the current image where guest read/write to,usually we create a > new image base on the base.qcow2 like this > qemu-img create -f qcow2 -o backing_file=3D/path/base.qcow2 new.qcow2 > so the data of new.qcow2 is from [C] of base.qcow2, assuming the > new.qcow2 has not been write to since created. > What I want is that the data of new.qcow2 is from [B] of base.qcow2, > like this: > qemu-img create -f qcow2 -o > backing_file=3D/path/base.qcow2,backing_snapshot=3DB new.qcow2 > Can the qemu support it now? > Thanks > -----------------------------------------------------------------------= - > vt Hi vt, I don't think this is possible. For this to work, the snapshot would=20 have to be loaded temporarily, but the only place I can see in the qemu=20 code base where this is done is inside qemu-img and qemu-nbd, so qemu=20 itself appearently does not support this. What you can do is export the snapshot via qemu-nbd (-l) and then use=20 that NBD server as a backing file with qemu. This is not very nice, but=20 I don't suppose there are many people eager to implement the=20 functionality you'd like to have (although I don't think it would be too=20 difficult, frankly=A1=AD). Max