diff options
author | Paolo Bonzini <pbonzini@redhat.com> | 2014-08-04 17:11:05 -0400 |
---|---|---|
committer | Stefan Hajnoczi <stefanha@redhat.com> | 2014-08-15 18:03:12 +0100 |
commit | 69f72a22213a6909bf4aef06133c976b508e370a (patch) | |
tree | 0289bb35578ec73e3b43f9372bf0364884f4f687 /hw | |
parent | 14a92e5fe1d81fe36630582dadd387fba10a63c9 (diff) | |
download | hqemu-69f72a22213a6909bf4aef06133c976b508e370a.zip hqemu-69f72a22213a6909bf4aef06133c976b508e370a.tar.gz |
ide: stash aiocb for flushes
This ensures that operations are completed after a reset
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
Signed-off-by: John Snow <jsnow@redhat.com>
Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>
Diffstat (limited to 'hw')
-rw-r--r-- | hw/ide/core.c | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/hw/ide/core.c b/hw/ide/core.c index db191a6..79985f9 100644 --- a/hw/ide/core.c +++ b/hw/ide/core.c @@ -831,6 +831,8 @@ static void ide_flush_cb(void *opaque, int ret) { IDEState *s = opaque; + s->pio_aiocb = NULL; + if (ret < 0) { /* XXX: What sector number to set here? */ if (ide_handle_rw_error(s, -ret, BM_STATUS_RETRY_FLUSH)) { @@ -853,7 +855,7 @@ void ide_flush_cache(IDEState *s) s->status |= BUSY_STAT; bdrv_acct_start(s->bs, &s->acct, 0, BDRV_ACCT_FLUSH); - bdrv_aio_flush(s->bs, ide_flush_cb, s); + s->pio_aiocb = bdrv_aio_flush(s->bs, ide_flush_cb, s); } static void ide_cfata_metadata_inquiry(IDEState *s) |