From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:39633) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YsYZx-0005CG-NF for qemu-devel@nongnu.org; Wed, 13 May 2015 11:28:14 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1YsYZw-0005eK-No for qemu-devel@nongnu.org; Wed, 13 May 2015 11:28:13 -0400 Date: Wed, 13 May 2015 17:28:03 +0200 From: Kevin Wolf Message-ID: <20150513152803.GI4263@noname.str.redhat.com> References: <1431105726-3682-1-git-send-email-kwolf@redhat.com> <1431105726-3682-28-git-send-email-kwolf@redhat.com> <55536950.4080808@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <55536950.4080808@redhat.com> Subject: Re: [Qemu-devel] [PATCH 27/34] block: Add infrastructure for option inheritance List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Max Reitz Cc: armbru@redhat.com, qemu-block@nongnu.org, qemu-devel@nongnu.org Am 13.05.2015 um 17:10 hat Max Reitz geschrieben: > On 08.05.2015 19:21, Kevin Wolf wrote: > >Options are not actually inherited from the parent node yet, but this > >commit lays the grounds for doing so. > > > >Signed-off-by: Kevin Wolf > >--- > > block.c | 51 ++++++++++++++++++++++++++--------------------- > > include/block/block_int.h | 3 ++- > > 2 files changed, 30 insertions(+), 24 deletions(-) > > > >diff --git a/block.c b/block.c > >index 1e5625f..9259b42 100644 > >--- a/block.c > >+++ b/block.c > >@@ -678,11 +678,14 @@ static int bdrv_temp_snapshot_flags(int flags) > > } > > /* > >- * Returns the flags that bs->file should get if a protocol driver is expected, > >- * based on the given flags for the parent BDS > >+ * Returns the options and flags that bs->file should get if a protocol driver > >+ * is expected, based on the given flags for the parent BDS > > */ > >-static int bdrv_inherited_flags(int flags) > >+static void bdrv_inherited_options(int *child_flags, QDict *child_options, > >+ int parent_flags, QDict *parent_options) > > { > >+ int flags = parent_flags; > >+ > > /* Enable protocol handling, disable format probing for bs->file */ > > flags |= BDRV_O_PROTOCOL; > >@@ -693,45 +696,46 @@ static int bdrv_inherited_flags(int flags) > > /* Clear flags that only apply to the top layer */ > > flags &= ~(BDRV_O_SNAPSHOT | BDRV_O_NO_BACKING | BDRV_O_COPY_ON_READ); > >- return flags; > >+ *child_flags = flags; > > } > > const BdrvChildRole child_file = { > >- .inherit_flags = bdrv_inherited_flags, > >+ .inherit_options = bdrv_inherited_options, > > }; > >-/* > >- * Returns the flags that bs->file should get if the use of formats (and not > >- * only protocols) is permitted for it, based on the given flags for the parent > >- * BDS > >- */ > > Is removing this comment intentional? Looks like a mismerge, thanks. Kevin