From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:40884) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Zlngb-0002qH-09 for qemu-devel@nongnu.org; Mon, 12 Oct 2015 20:43:25 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Zlnga-0000CS-24 for qemu-devel@nongnu.org; Mon, 12 Oct 2015 20:43:24 -0400 Date: Mon, 12 Oct 2015 20:43:15 -0400 From: Jeff Cody Message-ID: <20151013004315.GH11943@localhost.localdomain> References: <1444392941-28704-1-git-send-email-kwolf@redhat.com> <1444392941-28704-2-git-send-email-kwolf@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <1444392941-28704-2-git-send-email-kwolf@redhat.com> Subject: Re: [Qemu-devel] [PATCH v3 01/16] block: Introduce BDS.file_child List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Kevin Wolf Cc: berto@igalia.com, qemu-block@nongnu.org, qemu-devel@nongnu.org, armbru@redhat.com, stefanha@redhat.com, famz@redhat.com, mreitz@redhat.com On Fri, Oct 09, 2015 at 02:15:26PM +0200, Kevin Wolf wrote: > Store the BdrvChild for bs->file. At this point, bs->file_child->bs just > duplicates the bs->file pointer. Later, it will completely replace it. > > Signed-off-by: Kevin Wolf > Reviewed-by: Max Reitz > Reviewed-by: Alberto Garcia > Reviewed-by: Fam Zheng > --- > block.c | 12 +++++++++--- > include/block/block_int.h | 1 + > 2 files changed, 10 insertions(+), 3 deletions(-) > > diff --git a/block.c b/block.c > index 1f90b47..75afed1 100644 > --- a/block.c > +++ b/block.c > @@ -1487,11 +1487,17 @@ static int bdrv_open_inherit(BlockDriverState **pbs, const char *filename, > > assert(file == NULL); > bs->open_flags = flags; > - ret = bdrv_open_image(&file, filename, options, "file", > - bs, &child_file, true, &local_err); > - if (ret < 0) { > + > + bs->file_child = bdrv_open_child(filename, options, "file", bs, > + &child_file, true, &local_err); > + if (local_err) { > + ret = -EINVAL; > goto fail; > } > + > + if (bs->file_child) { > + file = bs->file_child->bs; > + } > } > > /* Image format probing */ > diff --git a/include/block/block_int.h b/include/block/block_int.h > index 14ad4c3..d0dd93e 100644 > --- a/include/block/block_int.h > +++ b/include/block/block_int.h > @@ -381,6 +381,7 @@ struct BlockDriverState { > BlockDriverState *backing_hd; > BdrvChild *backing_child; > BlockDriverState *file; > + BdrvChild *file_child; > > NotifierList close_notifiers; > > -- > 1.8.3.1 > Reviewed-by: Jeff Cody