From: Paolo Bonzini Date: Mon, 4 Aug 2014 21:11:05 +0000 (-0400) Subject: ide: stash aiocb for flushes X-Git-Tag: Tizen_Studio_1.3_Release_p2.3.2~209^2~652^2~51 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=69f72a22213a6909bf4aef06133c976b508e370a;p=sdk%2Femulator%2Fqemu.git ide: stash aiocb for flushes This ensures that operations are completed after a reset Signed-off-by: Paolo Bonzini Signed-off-by: John Snow Signed-off-by: Stefan Hajnoczi --- diff --git a/hw/ide/core.c b/hw/ide/core.c index db191a6c3e..79985f9f49 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)