From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:38732) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1X4DUs-00031H-0T for qemu-devel@nongnu.org; Mon, 07 Jul 2014 14:18:46 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1X4DUi-0004CB-PI for qemu-devel@nongnu.org; Mon, 07 Jul 2014 14:18:37 -0400 Received: from mx1.redhat.com ([209.132.183.28]:48333) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1X4DUi-0004C6-Hv for qemu-devel@nongnu.org; Mon, 07 Jul 2014 14:18:28 -0400 Received: from int-mx13.intmail.prod.int.phx2.redhat.com (int-mx13.intmail.prod.int.phx2.redhat.com [10.5.11.26]) by mx1.redhat.com (8.14.4/8.14.4) with ESMTP id s67IIRVd018892 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK) for ; Mon, 7 Jul 2014 14:18:27 -0400 From: John Snow Date: Mon, 7 Jul 2014 14:17:45 -0400 Message-Id: <1404757089-4836-5-git-send-email-jsnow@redhat.com> In-Reply-To: <1404757089-4836-1-git-send-email-jsnow@redhat.com> References: <1404757089-4836-1-git-send-email-jsnow@redhat.com> Subject: [Qemu-devel] [PATCH 04/28] 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, John Snow , 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 3a38f1e..506db88 100644 --- a/hw/ide/core.c +++ b/hw/ide/core.c @@ -803,6 +803,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)) { @@ -825,7 +827,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