From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:52127) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1XEPY5-0003UQ-M9 for qemu-devel@nongnu.org; Mon, 04 Aug 2014 17:12:13 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1XEPXw-0003oO-Ba for qemu-devel@nongnu.org; Mon, 04 Aug 2014 17:12:05 -0400 Received: from mx1.redhat.com ([209.132.183.28]:14273) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1XEPXw-0003oJ-41 for qemu-devel@nongnu.org; Mon, 04 Aug 2014 17:11:56 -0400 Received: from int-mx11.intmail.prod.int.phx2.redhat.com (int-mx11.intmail.prod.int.phx2.redhat.com [10.5.11.24]) by mx1.redhat.com (8.14.4/8.14.4) with ESMTP id s74LBtdI003733 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK) for ; Mon, 4 Aug 2014 17:11:55 -0400 From: John Snow Date: Mon, 4 Aug 2014 17:11:05 -0400 Message-Id: <1407186691-16103-5-git-send-email-jsnow@redhat.com> In-Reply-To: <1407186691-16103-1-git-send-email-jsnow@redhat.com> References: <1407186691-16103-1-git-send-email-jsnow@redhat.com> Subject: [Qemu-devel] [PATCH v2 04/30] ide: stash aiocb for flushes List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: qemu-devel@nongnu.org Cc: pbonzini@redhat.com, jsnow@redhat.com, stefanha@redhat.com, mst@redhat.com From: Paolo Bonzini This ensures that operations are completed after a reset Signed-off-by: Paolo Bonzini Signed-off-by: John Snow --- hw/ide/core.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) 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) -- 1.9.3