]> rtime.felk.cvut.cz Git - lisovros/qemu_apohw.git/commit
virtio-blk: Bypass error action and I/O accounting on invalid r/w
authorMarkus Armbruster <armbru@redhat.com>
Wed, 9 Jul 2014 17:07:30 +0000 (19:07 +0200)
committerKevin Wolf <kwolf@redhat.com>
Mon, 14 Jul 2014 10:03:21 +0000 (12:03 +0200)
commit42e38c1fd0199155d32f3464aedce282d3d7f6a1
treeee831dcb6b0876eb0e0c04b68c2d70d7e08ab932
parentd0e14376eefc40b07c8fb42c132c2202c66dcb0b
virtio-blk: Bypass error action and I/O accounting on invalid r/w

When a device model's I/O operation fails, we execute the error
action.  This lets layers above QEMU implement thin provisioning, or
attempt to correct errors before they reach the guest.  But when the
I/O operation fails because it's invalid, reporting the error to the
guest is the only sensible action.

If the guest's read or write asks for an invalid sector range, fail
the request right away, without considering the error action.  No
change with error action BDRV_ACTION_REPORT.

Furthermore, bypass I/O accounting, because we want to track only I/O
that actually reaches the block layer.

The next commit will extend "invalid sector range" to cover attempts
to read/write beyond the end of the medium.

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