]> xenbits.xensource.com Git - qemu-upstream-4.6-testing.git/commitdiff
raw-posix: fix bdrv_aio_ioctl
authorPaolo Bonzini <pbonzini@redhat.com>
Thu, 10 Jan 2013 14:28:35 +0000 (15:28 +0100)
committerMichael Roth <mdroth@linux.vnet.ibm.com>
Wed, 16 Jan 2013 05:05:45 +0000 (23:05 -0600)
When the raw-posix aio=thread code was moved from posix-aio-compat.c
to block/raw-posix.c, there was an unintended change to the ioctl code.
The code used to return the ioctl command, which posix_aio_read()
would later morph into a zero.  This hack is not necessary anymore,
and in fact breaks scsi-generic (which expects a zero return code).
Remove it.

Cc: qemu-stable@nongnu.org
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
Signed-off-by: Kevin Wolf <kwolf@redhat.com>
(cherry picked from commit b608c8dc02c78ee95455a0989bdf1b41c768b2ef)

Signed-off-by: Michael Roth <mdroth@linux.vnet.ibm.com>
block/raw-posix.c

index 550c81f22b111eaefc07157b94a278b6c4bbaa32..5c6c564b514e729855554c125631a941b6e7c700 100644 (file)
@@ -456,15 +456,7 @@ static ssize_t handle_aiocb_ioctl(RawPosixAIOData *aiocb)
         return -errno;
     }
 
-    /*
-     * This looks weird, but the aio code only considers a request
-     * successful if it has written the full number of bytes.
-     *
-     * Now we overload aio_nbytes as aio_ioctl_cmd for the ioctl command,
-     * so in fact we return the ioctl command here to make posix_aio_read()
-     * happy..
-     */
-    return aiocb->aio_nbytes;
+    return 0;
 }
 
 static ssize_t handle_aiocb_flush(RawPosixAIOData *aiocb)