virtio-blk: Treat read/write beyond end as invalid
commit3c2daac0b98952a858277878cb11294256b39e43
authorMarkus Armbruster <armbru@redhat.com>
Wed, 9 Jul 2014 17:07:31 +0000 (9 19:07 +0200)
committerKevin Wolf <kwolf@redhat.com>
Mon, 14 Jul 2014 10:03:21 +0000 (14 12:03 +0200)
treea76b5e0962f0f1650b7007449b7290777de31597
parent42e38c1fd0199155d32f3464aedce282d3d7f6a1
virtio-blk: 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.

Signed-off-by: Markus Armbruster <armbru@redhat.com>
Reviewed-by: Fam Zheng <famz@redhat.com>
Signed-off-by: Kevin Wolf <kwolf@redhat.com>
hw/block/virtio-blk.c