qemu-devel
[Top][All Lists]
Advanced

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

Re: [Qemu-devel] [RFC PATCH 2/6] block: Add options QDict to bdrv_open()


From: Kevin Wolf
Subject: Re: [Qemu-devel] [RFC PATCH 2/6] block: Add options QDict to bdrv_open() prototype
Date: Thu, 28 Feb 2013 12:02:06 +0100
User-agent: Mutt/1.5.21 (2010-09-15)

Am 28.02.2013 um 11:39 hat Stefan Hajnoczi geschrieben:
> On Wed, Feb 27, 2013 at 06:25:51PM +0100, Kevin Wolf wrote:
> > @@ -780,15 +788,28 @@ int bdrv_open_backing_file(BlockDriverState *bs)
> >  
> >  /*
> >   * Opens a disk image (raw, qcow2, vmdk, ...)
> > + *
> > + * options is a QDict of options to pass to the block drivers, or NULL for 
> > an
> > + * empty set of options. The reference to the QDict belongs to the block 
> > layer
> > + * after the call, so if the caller intends to reuse the dictionary, it 
> > needs
> > + * to use QINCREF() before calling bdrv_open.
> >   */
> 
> It's helpful to be explicit about ownership when the function fails:
> "The reference to the QDict belongs to the block layer after the call
> (even on failure)".

Good idea, I'll add that. It also makes clear that the RFC code leaks
the QDict in some cases...

Kevin



reply via email to

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