]> git.ipfire.org Git - thirdparty/qemu.git/commit
raw-posix: fix O_DIRECT short reads
authorStefan Hajnoczi <stefanha@redhat.com>
Thu, 21 Aug 2014 12:44:07 +0000 (13:44 +0100)
committerMichael Roth <mdroth@linux.vnet.ibm.com>
Mon, 8 Sep 2014 16:23:05 +0000 (11:23 -0500)
commitdea6efe88362a55f3f8208d12ef7159e23b9236c
treec3ee328a0f081fc185e9ce6d763c7212681b1d69
parent8c4edd743c819813b3f409754f525309d72be53d
raw-posix: fix O_DIRECT short reads

The following O_DIRECT read from a <512 byte file fails:

  $ truncate -s 320 test.img
  $ qemu-io -n -c 'read -P 0 0 512' test.img
  qemu-io: can't open device test.img: Could not read image for determining its format: Invalid argument

Note that qemu-io completes successfully without the -n (O_DIRECT)
option.

This patch fixes qemu-iotests ./check -nocache -vmdk 059.

Cc: qemu-stable@nongnu.org
Suggested-by: Kevin Wolf <kwolf@redhat.com>
Reported-by: Markus Armbruster <armbru@redhat.com>
Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>
Signed-off-by: Kevin Wolf <kwolf@redhat.com>
(cherry picked from commit 61ed73cff427206b3a959b18a4877952f566279b)
Signed-off-by: Michael Roth <mdroth@linux.vnet.ibm.com>
block/raw-posix.c