qemu-devel
[Top][All Lists]
Advanced

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

Re: [Qemu-devel] [PATCH 3/5] block/raw-win32: Employ error parameter


From: Eric Blake
Subject: Re: [Qemu-devel] [PATCH 3/5] block/raw-win32: Employ error parameter
Date: Thu, 10 Oct 2013 11:17:04 -0600
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:17.0) Gecko/20130923 Thunderbird/17.0.9

On 10/10/2013 07:44 AM, Max Reitz wrote:
> Make use of the error parameter in the opening and creating functions in
> block/raw-win32.c.
> 
> Signed-off-by: Max Reitz <address@hidden>
> ---
>  block/raw-win32.c | 16 +++++++++++-----
>  1 file changed, 11 insertions(+), 5 deletions(-)
> @@ -586,8 +590,10 @@ static int hdev_open(BlockDriverState *bs, QDict 
> *options, int flags,
>          int err = GetLastError();
>  
>          if (err == ERROR_ACCESS_DENIED) {
> +            error_setg_errno(errp, EACCES, "Could not open device");
>              ret = -EACCES;
>          } else {
> +            error_setg(errp, "Could not open device");
>              ret = -1;

Pre-existing, but that looks fishy.  Mixing -1 and -errno in the same
function is generally wrong.

-- 
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]