qemu-block
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Qemu-block] [PATCH RFC v3 6/8] block: add options parameter to bdrv


From: Kevin Wolf
Subject: Re: [Qemu-block] [PATCH RFC v3 6/8] block: add options parameter to bdrv_new_open_driver()
Date: Wed, 28 Jun 2017 17:55:14 +0200
User-agent: Mutt/1.5.21 (2010-09-15)

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

Attachment: pgpNjSJ4pcy9a.pgp
Description: PGP signature


reply via email to

[Prev in Thread] Current Thread [Next in Thread]