[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
- [Qemu-devel] [RFC PATCH 0/6] block: Add driver specific options, Kevin Wolf, 2013/02/27
- [Qemu-devel] [RFC PATCH 3/6] Add qdict_clone_shallow(), Kevin Wolf, 2013/02/27
- [Qemu-devel] [RFC PATCH 2/6] block: Add options QDict to bdrv_open() prototype, Kevin Wolf, 2013/02/27
- [Qemu-devel] [RFC PATCH 1/6] block: Add options QDict to .bdrv_open(), Kevin Wolf, 2013/02/27
- [Qemu-devel] [RFC PATCH 5/6] block: Support driver specific options in drive_init(), Kevin Wolf, 2013/02/27
- [Qemu-devel] [RFC PATCH 6/6] qcow2: Allow lazy refcounts to be enabled on the command line, Kevin Wolf, 2013/02/27
- [Qemu-devel] [RFC PATCH 4/6] block: Add options QDict to bdrv_open_common(), Kevin Wolf, 2013/02/27
- Re: [Qemu-devel] [RFC PATCH 0/6] block: Add driver specific options, Eric Blake, 2013/02/27
- Re: [Qemu-devel] [RFC PATCH 0/6] block: Add driver specific options, Stefan Hajnoczi, 2013/02/28