qemu-devel
[Top][All Lists]
Advanced

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

Re: [Qemu-devel] [RFC V3 2/7] block: Allow the user to define "node-name


From: Eric Blake
Subject: Re: [Qemu-devel] [RFC V3 2/7] block: Allow the user to define "node-name" option.
Date: Wed, 04 Dec 2013 16:33:31 -0700
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:24.0) Gecko/20100101 Thunderbird/24.1.0

On 12/03/2013 06:26 AM, Benoît Canet wrote:
> Signed-off-by: Benoit Canet <address@hidden>
> ---
>  block.c | 42 +++++++++++++++++++++++++++++++++++++-----
>  1 file changed, 37 insertions(+), 5 deletions(-)
> 

> @@ -880,7 +881,14 @@ int bdrv_file_open(BlockDriverState **pbs, const char 
> *filename,
>          options = qdict_new();
>      }
>  
> -    bs = bdrv_new("", "");
> +    node_name = qdict_get_try_str(options, "node-name");
> +    if (node_name && bdrv_find_node(node_name)) {
> +        error_setg(errp, "Duplicate node name");
> +        return -EINVAL;

This leaks options on failure.

> @@ -1053,6 +1070,21 @@ int bdrv_open(BlockDriverState *bs, const char 
> *filename, QDict *options,
>          options = qdict_new();
>      }
>  
> +    node_name = qdict_get_try_str(options, "node-name");
> +    if (node_name && bdrv_find_node(node_name)) {
> +        error_setg(errp, "Duplicate node name");
> +        return -EINVAL;

So does this.

-- 
Eric Blake   eblake redhat com    +1-919-301-3266
Libvirt virtualization library http://libvirt.org

Attachment: signature.asc
Description: OpenPGP digital signature


reply via email to

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