From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([208.118.235.92]:40500) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1SdkfQ-0004Yd-KW for qemu-devel@nongnu.org; Sun, 10 Jun 2012 12:07:05 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1SdkfO-0008P2-Uu for qemu-devel@nongnu.org; Sun, 10 Jun 2012 12:07:04 -0400 Received: from mail-wi0-f175.google.com ([209.85.212.175]:53762) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1SdkfO-0008Oo-He for qemu-devel@nongnu.org; Sun, 10 Jun 2012 12:07:02 -0400 Received: by wibhn6 with SMTP id hn6so1717284wib.10 for ; Sun, 10 Jun 2012 09:07:00 -0700 (PDT) Sender: Paolo Bonzini Message-ID: <4FD4C622.3030702@redhat.com> Date: Sun, 10 Jun 2012 18:06:58 +0200 From: Paolo Bonzini MIME-Version: 1.0 References: <4FD0B759.8030002@redhat.com> <4FD1FBF1.10305@redhat.com> In-Reply-To: <4FD1FBF1.10305@redhat.com> Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Subject: Re: [Qemu-devel] CoW image commit+shrink(= make_empty) support List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: jcody@redhat.com Cc: Stefan Hajnoczi , Zhi Hui Li , Taisuke Yamada , qemu-devel@nongnu.org Il 08/06/2012 15:19, Jeff Cody ha scritto: >> > >> > This means copying allocated blocks from snap1.qcow2 and writing them >> > into vm001.img. Once this process is complete it is safe to delete >> > snap1.qcow2 since all data is now in vm001.img. > Yes, this is the same as what we are wanting to accomplish. The trick > here is open vm001.img r/w, in a safe manner (by safe, I mean able to > abort in case of error while keeping the guest running live). > > My thoughts on this has revolved around something similar to what was > done in bdrv_append(), where a duplicate BDS is created, a new file-open > performed with the appropriate access mode flags, and if successful > swapped out for the originally opened BDS for vm001.img. If there is an > error, the new BDS is abandoned without modifying the BDS list. > I haven't yet read the rest of the thread, but I'll drop here that indeed I have a bdrv_swap in my patches for block mirroring. A live commit of the topmost image is really just a mirroring operation, the only thing that changes is the mechanics of opening the target and perhaps also switching to it. Paolo