From patchwork Thu Sep 20 19:13:23 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Subject: [v4, 07/19] block: use BDRV_O_NOCACHE instead of s->aligned_buf in raw-posix.c Date: Thu, 20 Sep 2012 09:13:23 -0000 From: Jeff Cody X-Patchwork-Id: 185485 Message-Id: <983d2030757b08d4e6be9503b21a5307f0df7795.1348157913.git.jcody@redhat.com> To: qemu-devel@nongnu.org Cc: kwolf@redhat.com, pbonzini@redhat.com, eblake@redhat.com, supriyak@linux.vnet.ibm.com 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 --- block/raw-posix.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/block/raw-posix.c b/block/raw-posix.c index 288e7ff..1e727eb 100644 --- a/block/raw-posix.c +++ b/block/raw-posix.c @@ -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