ide: Treat read/write beyond end as invalid
commit58ac321135af890b503ebe56d0d00e184779918f
authorMarkus Armbruster <armbru@redhat.com>
Wed, 9 Jul 2014 17:07:32 +0000 (9 19:07 +0200)
committerKevin Wolf <kwolf@redhat.com>
Mon, 14 Jul 2014 10:03:21 +0000 (14 12:03 +0200)
treea74b7ea1c297aa2502569f904850c8a55d726079
parent3c2daac0b98952a858277878cb11294256b39e43
ide: Treat read/write beyond end as invalid

The block layer fails such reads and writes just fine.  However, they
then get treated like valid operations that fail: the error action
gets executed.  Unwanted; reporting the error to the guest is the only
sensible action.

Reject them before passing them to the block layer.  This bypasses the
error action and I/O accounting.  Not quite correct for DMA, because
DMA can fail after some success, and when that happens, the part that
succeeded isn't counted.  Tolerable, because I/O accounting is an
inconsistent mess anyway.

Signed-off-by: Markus Armbruster <armbru@redhat.com>
Signed-off-by: Kevin Wolf <kwolf@redhat.com>
hw/ide/core.c