diff options
author | Kevin Wolf <kwolf@redhat.com> | 2010-10-27 13:04:15 +0200 |
---|---|---|
committer | Kevin Wolf <kwolf@redhat.com> | 2010-11-04 13:54:37 +0100 |
commit | b2df7531f3adc4f0f65067b917cef8c66ba812c5 (patch) | |
tree | 5e5f77b884c4e118bc8f31e047207f853b70fe8c /hw | |
parent | a31335863648d1e707f59296cffb74205aedba96 (diff) | |
download | qemu-b2df7531f3adc4f0f65067b917cef8c66ba812c5.zip qemu-b2df7531f3adc4f0f65067b917cef8c66ba812c5.tar.gz qemu-b2df7531f3adc4f0f65067b917cef8c66ba812c5.tar.bz2 |
ide: Handle immediate bdrv_aio_flush failure
If bdrv_aio_flush returns NULL, this should be treated as an error.
Signed-off-by: Kevin Wolf <kwolf@redhat.com>
Diffstat (limited to 'hw')
-rw-r--r-- | hw/ide/core.c | 12 |
1 files changed, 9 insertions, 3 deletions
diff --git a/hw/ide/core.c b/hw/ide/core.c index bc3e916..484e0ca 100644 --- a/hw/ide/core.c +++ b/hw/ide/core.c @@ -811,10 +811,16 @@ static void ide_flush_cb(void *opaque, int ret) static void ide_flush_cache(IDEState *s) { - if (s->bs) { - bdrv_aio_flush(s->bs, ide_flush_cb, s); - } else { + BlockDriverAIOCB *acb; + + if (s->bs == NULL) { ide_flush_cb(s, 0); + return; + } + + acb = bdrv_aio_flush(s->bs, ide_flush_cb, s); + if (acb == NULL) { + ide_flush_cb(s, -EIO); } } |