qemu-devel
[Top][All Lists]
Advanced

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

Re: [Qemu-devel] [PATCH v5 09/22] block: Allow reference for bdrv_file_o


From: Kevin Wolf
Subject: Re: [Qemu-devel] [PATCH v5 09/22] block: Allow reference for bdrv_file_open()
Date: Fri, 13 Dec 2013 20:54:59 +0100
User-agent: Mutt/1.5.21 (2010-09-15)

Am 13.12.2013 um 18:10 hat Max Reitz geschrieben:
> Allow specifying a reference to an existing block device (by name) for
> bdrv_file_open() instead of a filename and/or options.
> 
> Signed-off-by: Max Reitz <address@hidden>

> @@ -872,6 +873,24 @@ int bdrv_file_open(BlockDriverState **pbs, const char 
> *filename,
>          options = qdict_new();
>      }
>  
> +    if (reference) {
> +        if (filename || qdict_size(options)) {
> +            error_setg(errp, "Cannot reference an existing block device with 
> "
> +                       "additional options or a new filename");
> +            return -EINVAL;
> +        }

I suspect this could in fact be an assertion. Users shouldn't have any
way to provoke a call with a reference _and_ options/filename set.

Doesn't make the code less correct, of course, so:

Reviewed-by: Kevin Wolf <address@hidden>



reply via email to

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