From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:45377) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Wmb6x-0007O7-Gb for qemu-devel@nongnu.org; Mon, 19 May 2014 23:53:12 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Wmb6s-0001l9-Lt for qemu-devel@nongnu.org; Mon, 19 May 2014 23:53:07 -0400 Received: from mx1.redhat.com ([209.132.183.28]:60341) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Wmb6s-0001jr-EN for qemu-devel@nongnu.org; Mon, 19 May 2014 23:53:02 -0400 Received: from int-mx09.intmail.prod.int.phx2.redhat.com (int-mx09.intmail.prod.int.phx2.redhat.com [10.5.11.22]) by mx1.redhat.com (8.14.4/8.14.4) with ESMTP id s4K3r1Gf011038 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK) for ; Mon, 19 May 2014 23:53:01 -0400 Date: Tue, 20 May 2014 11:53:12 +0800 From: Fam Zheng Message-ID: <20140520035312.GE7688@T430.nay.redhat.com> References: <1399858555-9672-1-git-send-email-famz@redhat.com> <1399858555-9672-10-git-send-email-famz@redhat.com> <537A5DCC.3030101@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <537A5DCC.3030101@redhat.com> Subject: Re: [Qemu-devel] [PATCH v19 09/16] block: Support dropping active in bdrv_drop_intermediate List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Eric Blake Cc: kwolf@redhat.com, rjones@redhat.com, jcody@redhat.com, hbrock@redhat.com, armbru@redhat.com, qemu-devel@nongnu.org, imain@redhat.com, stefanha@redhat.com, pbonzini@redhat.com On Mon, 05/19 13:38, Eric Blake wrote: > On 05/11/2014 07:35 PM, Fam Zheng wrote: > > Dropping intermediate could be useful both for commit and stream, and > > BDS refcnt plus bdrv_swap could do most of the job nicely. It also needs > > to work with op blockers. > > > > Signed-off-by: Fam Zheng > > --- > > block.c | 139 ++++++++++++++++++++++++++++----------------------------- > > block/commit.c | 2 +- > > 2 files changed, 70 insertions(+), 71 deletions(-) > > > > > - > > /* > > - * Drops images above 'base' up to and including 'top', and sets the image > > - * above 'top' to have base as its backing file. > > + * Drops images above 'base' up to and including 'top', and sets new 'base' as > > + * backing_hd of top's overlay (the image orignally has 'top' as backing file). > > + * top's overlay may be NULL if 'top' is active, no such update needed. > > + * Requires that the top's overlay to 'top' is opened r/w. > > + * > > + * 1) This will convert the following chain: > > + * > > + * ... <- base <- ... <- top <- overlay <-... <- active > > * > > - * Requires that the overlay to 'top' is opened r/w, so that the backing file > > - * information in 'bs' can be properly updated. > > + * to > > + * > > + * ... <- base <- overlay <- active > > Jeff is working on allowing the user full control over the string > written into overlay; let's make sure these efforts are coordinated. > https://lists.gnu.org/archive/html/qemu-devel/2014-05/msg02949.html Looks they are not exclusive functional changes, I can rebase if it is merged before this. > > > + * > > + * 2) It is allowed for bottom==base, in which case it converts: > > * > > - * E.g., this will convert the following chain: > > - * bottom <- base <- intermediate <- top <- active > > + * base <- ... <- top <- overlay <- ... <- active > > * > > * to > > * > > - * bottom <- base <- active > > + * base <- overlay <- active > > * > > - * It is allowed for bottom==base, in which case it converts: > > + * 2) It also allows active==top, in which case it converts: > > Shouldn't this be 3) ? Yes, thanks! > > > * > > - * base <- intermediate <- top <- active > > + * ... <- base <- ... <- top (active) > > * > > * to > > * > > - * base <- active > > + * ... <- base == active == top > > + * > > + * i.e. only base and lower remains: *top == *base when return. > > + * > > + * 3) If base==NULL, it will drop all the BDS below overlay and set its > > and 4) > Yes, thanks! Fam