From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:34769) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZlomK-0000yx-6C for qemu-devel@nongnu.org; Mon, 12 Oct 2015 21:53:25 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1ZlomJ-0004oS-Bn for qemu-devel@nongnu.org; Mon, 12 Oct 2015 21:53:24 -0400 Date: Mon, 12 Oct 2015 21:53:13 -0400 From: Jeff Cody Message-ID: <20151013015313.GN11943@localhost.localdomain> References: <1444392941-28704-1-git-send-email-kwolf@redhat.com> <1444392941-28704-8-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-8-git-send-email-kwolf@redhat.com> Subject: Re: [Qemu-devel] [PATCH v3 07/16] block: Convert bs->backing_hd to BdrvChild 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:32PM +0200, Kevin Wolf wrote: > This is the final step in converting all of the BlockDriverState > pointers that block drivers use to BdrvChild. > > After this patch, bs->children contains the full list of child nodes > that are referenced by a given BDS, and these children are only > referenced through BdrvChild, so that updating the pointer in there is > enough for changing edges in the graph. > > Signed-off-by: Kevin Wolf > --- > block.c | 105 +++++++++++++++++++++++----------------------- > block/io.c | 24 +++++------ > block/mirror.c | 6 +-- > block/qapi.c | 8 ++-- > block/qcow.c | 4 +- > block/qcow2-cluster.c | 4 +- > block/qcow2.c | 6 +-- > block/qed.c | 12 +++--- > block/stream.c | 8 ++-- > block/vmdk.c | 21 +++++----- > block/vvfat.c | 6 +-- > blockdev.c | 4 +- > include/block/block_int.h | 12 ++++-- > qemu-img.c | 4 +- > 14 files changed, 115 insertions(+), 109 deletions(-) > [...] > diff --git a/include/block/block_int.h b/include/block/block_int.h > index 98936c9..90971c0 100644 > --- a/include/block/block_int.h > +++ b/include/block/block_int.h > @@ -378,8 +378,7 @@ struct BlockDriverState { > QDict *full_open_options; > char exact_filename[PATH_MAX]; > > - BlockDriverState *backing_hd; > - BdrvChild *backing_child; > + BdrvChild *backing; > BdrvChild *file; > > NotifierList close_notifiers; > @@ -458,6 +457,11 @@ struct BlockDriverState { > NotifierWithReturn write_threshold_notifier; > }; > > +static inline BlockDriverState *backing_bs(BlockDriverState *bs) > +{ > + return bs->backing ? bs->backing->bs : NULL; > +} > + Is there a good guideline regarding when you prefer backing_bs() to be used, over accessing bs->backing->bs directly? There seems to be a lot of mixed usage left in this patch, and I'm not sure if I am just missing the intended distinction. Thanks, Jeff