[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Qemu-devel] [PATCH 1/3] block: add options parameter to bdrv_new_op
From: |
Stefan Hajnoczi |
Subject: |
Re: [Qemu-devel] [PATCH 1/3] block: add options parameter to bdrv_new_open_driver() |
Date: |
Wed, 2 Aug 2017 10:33:55 +0100 |
User-agent: |
Mutt/1.8.3 (2017-05-23) |
On Tue, Aug 01, 2017 at 04:49:05PM +0300, Manos Pitsidianakis wrote:
> diff --git a/block.c b/block.c
> index 37e72b7a96..886a457ab0 100644
> --- a/block.c
> +++ b/block.c
> @@ -1149,16 +1149,26 @@ free_and_fail:
> return ret;
> }
>
> +/*
> + * If options is not NULL it is cloned (which adds another reference to the
> + * option entries). If the call to bdrv_new_open_driver() is successful, the
> + * caller should unref options to pass ownership.
> + * */
Please follow the ownership convention for the options argument.
Existing block.c function take ownership of options:
* 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 (even on failure), so if the caller intends to reuse the
* dictionary, it needs to use QINCREF() before calling bdrv_open.
> BlockDriverState *bdrv_new_open_driver(BlockDriver *drv, const char
> *node_name,
> - int flags, Error **errp)
> + int flags, QDict *options, Error
> **errp)
signature.asc
Description: PGP signature