]> git.proxmox.com Git - qemu.git/commitdiff
block: use BDRV_O_NOCACHE instead of s->aligned_buf in raw-posix.c
authorJeff Cody <jcody@redhat.com>
Thu, 20 Sep 2012 19:13:23 +0000 (15:13 -0400)
committerKevin Wolf <kwolf@redhat.com>
Mon, 24 Sep 2012 13:15:11 +0000 (15:15 +0200)
Rather than check for a non-NULL aligned_buf to determine if
raw_aio_submit needs to check for alignment, check for the presence
of BDRV_O_NOCACHE in the bs->open_flags.

Signed-off-by: Jeff Cody <jcody@redhat.com>
Signed-off-by: Kevin Wolf <kwolf@redhat.com>
block/raw-posix.c

index 288e7ff238e1351aab790a5fb813ddd1f68df830..1e727eb04245e9a23cd65e0c8cac6773875e1058 100644 (file)
@@ -354,7 +354,7 @@ static BlockDriverAIOCB *raw_aio_submit(BlockDriverState *bs,
      * boundary.  Check if this is the case or tell the low-level
      * driver that it needs to copy the buffer.
      */
-    if (s->aligned_buf) {
+    if ((bs->open_flags & BDRV_O_NOCACHE)) {
         if (!qiov_is_aligned(bs, qiov)) {
             type |= QEMU_AIO_MISALIGNED;
 #ifdef CONFIG_LINUX_AIO