From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([208.118.235.92]:43084) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1TCY08-0000cE-5e for qemu-devel@nongnu.org; Fri, 14 Sep 2012 11:40:18 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1TCXzy-0004Hy-IS for qemu-devel@nongnu.org; Fri, 14 Sep 2012 11:40:16 -0400 Received: from mx1.redhat.com ([209.132.183.28]:42112) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1TCXzy-0004Gj-9j for qemu-devel@nongnu.org; Fri, 14 Sep 2012 11:40:06 -0400 Message-ID: <50534FC3.90109@redhat.com> Date: Fri, 14 Sep 2012 11:39:47 -0400 From: Jeff Cody MIME-Version: 1.0 References: <50534BE7.2070803@redhat.com> In-Reply-To: <50534BE7.2070803@redhat.com> Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit Subject: Re: [Qemu-devel] [PATCH 1/8] block: add support functions for live commit, to find and delete images. Reply-To: jcody@redhat.com List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Eric Blake Cc: kwolf@redhat.com, pbonzini@redhat.com, stefanha@gmail.com, qemu-devel@nongnu.org, supriyak@linux.vnet.ibm.com On 09/14/2012 11:23 AM, Eric Blake wrote: > On 09/14/2012 07:41 AM, Jeff Cody wrote: >> Add bdrv_find_overlay(), and bdrv_drop_intermediate(). >> >> bdrv_find_overlay(): given 'bs' and the active (topmost) BDS of an image chain, >> find the image that is the immediate top of 'bs' >> >> bdrv_drop_intermediate(): >> Given 3 BDS (active, top, base), delete images above > > s/delete/drop/ > Thanks >> base up to and including top, and set base to be the >> parent of top's child node. > > set base to be the backing file of top's overlay node. > Thanks >> >> E.g., this converts: >> >> bottom <- base <- intermediate <- top <- active >> >> to >> >> bottom <- base <- active >> >> +++ b/block.c >> @@ -1713,6 +1713,156 @@ int bdrv_change_backing_file(BlockDriverState *bs, >> return ret; >> } >> >> +/* >> + * Finds the image layer immediately to the 'top' of bs. > > Or even: > > Finds the image layer in the chain that has 'bs' as its backing file. > Thanks - I prefer your wording, that is clearer. >> +/* >> + * Deletes images above 'base' up to and including 'top', and sets the image > > s/Deletes/Drops/ > >> +++ b/block.h >> @@ -209,7 +209,10 @@ int bdrv_commit_all(void); >> int bdrv_change_backing_file(BlockDriverState *bs, >> const char *backing_file, const char *backing_fmt); >> void bdrv_register(BlockDriver *bdrv); >> - >> +int bdrv_drop_intermediate(BlockDriverState *active, BlockDriverState *top, >> + BlockDriverState *base); >> +BlockDriverState *bdrv_find_overlay(BlockDriverState *active, >> + BlockDriverState *bs); >> >> typedef struct BdrvCheckResult { > > Changed from two blank lines to one before the typedef; was that > intentional? > Nope, it was unintentional - thanks