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 <mre...@redhat.com>
> ---
>  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