Am 26.06.2017 um 17:11 hat Stefan Hajnoczi geschrieben: > On Fri, Jun 23, 2017 at 03:46:58PM +0300, Manos Pitsidianakis wrote: > > diff --git a/block.c b/block.c > > index 694396281b..c7d9f8959a 100644 > > --- a/block.c > > +++ b/block.c > > @@ -1150,20 +1150,25 @@ free_and_fail: > > } > > > > BlockDriverState *bdrv_new_open_driver(BlockDriver *drv, const char > > *node_name, > > - int flags, Error **errp) > > + int flags, QDict *options, Error > > **errp) > > Please add a doc comment that explains the QDict ownership when options > != NULL. Users need to understand whether the options QDict still > belongs to them after the call or bdrv_new_open_driver() takes over > ownership. > > See bdrv_open_inherit() for an example.
I think we might not only want to document it, but probably also change this function. bdrv_open_inherit() and friends take ownership of the QDict, so doing the same here would probably avoid bugs in the future. It also seems more practical, because the only user that is added in patch 8 already does QDECREF() after calling bdrv_new_open_driver(). Kevin
pgp8EQixbTAfe.pgp
Description: PGP signature