ide: Handle flush failure
authorKevin Wolf <kwolf@redhat.com>
Mon, 18 Oct 2010 15:13:05 +0000 (17:13 +0200)
committerKevin Wolf <kwolf@redhat.com>
Fri, 22 Oct 2010 12:49:35 +0000 (14:49 +0200)
commitbd13a85c17fb7e420bb21198ca937e811394a1d6
tree3fcc3dd3ada74393b30c57fa7bd236fb22dd1a20
parent199c89707521dc3c2ff69d4e68b3b6aea8dcc6c8
ide: Handle flush failure

Instead of always assuming success for bdrv_aio_flush, actually do something
with the error. This respects the werror option and accordingly ignores the
error, reports it to the guest or stops the VM and retries after cont.

Ignoring the error is trivial, obviously. For stopping the VM and retrying
later old code can be reused, but we need to introduce a new status for "retry
a flush". For reporting to the guest, fortunately the same action is required
as for a failed read/write (status = DRDY | ERR, error = ABRT), so this code
can be reused as well.

Signed-off-by: Kevin Wolf <kwolf@redhat.com>
hw/ide/core.c
hw/ide/internal.h