raw-win32: Fix write request error handling
authorKevin Wolf <kwolf@redhat.com>
Wed, 23 Sep 2015 12:58:21 +0000 (14:58 +0200)
committerKevin Wolf <kwolf@redhat.com>
Fri, 2 Oct 2015 11:48:29 +0000 (13:48 +0200)
aio_worker() wrote the return code to the wrong variable.

Signed-off-by: Kevin Wolf <kwolf@redhat.com>
Tested-by: Guangmu Zhu <guangmuzhu@gmail.com>
Reviewed-by: Eric Blake <eblake@redhat.com>
block/raw-win32.c

index 68f2338acc43d00dc41055aa03cd6f6d1d179bd7..b562c94dad3918aed5a0a5cc52830a242fbc4f94 100644 (file)
@@ -119,9 +119,9 @@ static int aio_worker(void *arg)
     case QEMU_AIO_WRITE:
         count = handle_aiocb_rw(aiocb);
         if (count == aiocb->aio_nbytes) {
-            count = 0;
+            ret = 0;
         } else {
-            count = -EINVAL;
+            ret = -EINVAL;
         }
         break;
     case QEMU_AIO_FLUSH: