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: Alberto Garcia
Subject: Re: [Qemu-block] [PATCH RFC v3 6/8] block: add options parameter to bdrv_new_open_driver()
Date: Wed, 28 Jun 2017 15:42:41 +0200
User-agent: Notmuch/0.18.2 (http://notmuchmail.org) Emacs/24.4.1 (i586-pc-linux-gnu)

On Fri 23 Jun 2017 02:46:58 PM CEST, Manos Pitsidianakis wrote:
>  BlockDriverState *bdrv_new_open_driver(BlockDriver *drv, const char 
> *node_name,
> -                                       int flags, Error **errp)
> +                                       int flags, QDict *options, Error 
> **errp)
>  {
>      BlockDriverState *bs;
>      int ret;
>  
>      bs = bdrv_new();
>      bs->open_flags = flags;
> -    bs->explicit_options = qdict_new();
> -    bs->options = qdict_new();
> +    if (options) {
> +        bs->explicit_options = qdict_clone_shallow(options);
> +        bs->options = qdict_clone_shallow(options);
> +    } else {
> +        bs->explicit_options = qdict_new();
> +        bs->options = qdict_new();
> +    }
>      bs->opaque = NULL;
>  
>      update_options_from_flags(bs->options, flags);
>  
> -    ret = bdrv_open_driver(bs, drv, node_name, bs->options, flags, errp);
> +    ret = bdrv_open_driver(bs, drv, node_name, options, flags, errp);

Why this last change? In the default case you're now passing NULL
instead of the QDict created with qdict_new().

Berto



reply via email to

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