On 05/09/2015 01:21 AM, Kevin Wolf wrote: > Instead of letting every caller of bdrv_open() determine the right flags > for its child node manually and pass them to the function, pass the > parent node and the role of the newly opened child (like backing file, > protocol layer, etc.). > > Signed-off-by: Kevin Wolf <kw...@redhat.com> > --- > block.c | 74 > ++++++++++++++++++++++++++++++++++++++--------- > block/blkdebug.c | 2 +- > block/blkverify.c | 4 +-- > block/quorum.c | 4 +-- > block/vmdk.c | 5 ++-- > include/block/block.h | 4 ++- > include/block/block_int.h | 7 +++++ > 7 files changed, 78 insertions(+), 22 deletions(-) > > diff --git a/block.c b/block.c > index cea022f..c4f0fb4 100644 > --- a/block.c > +++ b/block.c > @@ -79,6 +79,12 @@ static QTAILQ_HEAD(, BlockDriverState) graph_bdrv_states = > static QLIST_HEAD(, BlockDriver) bdrv_drivers = > QLIST_HEAD_INITIALIZER(bdrv_drivers); > > +static int bdrv_open_inherit(BlockDriverState **pbs, const char *filename, > + const char *reference, QDict *options, int > flags, > + BlockDriverState* parent, > + const BdrvChildRole *child_role, > + BlockDriver *drv, Error **errp);
The function name in patch title is wrong. Thanks Wen Congyang