From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from [140.186.70.92] (port=40997 helo=eggs.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1OCOz5-0008L5-Ki for qemu-devel@nongnu.org; Wed, 12 May 2010 23:21:29 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.69) (envelope-from ) id 1OCLTI-00062c-Hw for qemu-devel@nongnu.org; Wed, 12 May 2010 19:36:14 -0400 Received: from cantor.suse.de ([195.135.220.2]:57643 helo=mx1.suse.de) by eggs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1OCLTI-00062I-Bk for qemu-devel@nongnu.org; Wed, 12 May 2010 19:36:12 -0400 From: Alexander Graf Date: Thu, 13 May 2010 01:36:27 +0200 Message-Id: <1273707388-5213-2-git-send-email-agraf@suse.de> In-Reply-To: <1273707388-5213-1-git-send-email-agraf@suse.de> References: <1273707388-5213-1-git-send-email-agraf@suse.de> Subject: [Qemu-devel] [PATCH 1/2] Add no-op aio emulation stub List-Id: qemu-devel.nongnu.org List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: qemu-devel@nongnu.org Cc: kwolf@redhat.com, hch@lst.de We need to be able to do nothing in AIO fashion. Since I suspect this could be useful for more cases than the non flushing, I figured I'd create a new function that does everything AIO-like, but doesn't do anything. Signed-off-by: Alexander Graf --- v1 -> v2: - remove stray define - make aio noop handler static - remove header define --- block.c | 18 ++++++++++++++++++ 1 files changed, 18 insertions(+), 0 deletions(-) diff --git a/block.c b/block.c index 48305b7..00e9b6b 100644 --- a/block.c +++ b/block.c @@ -2196,6 +2196,24 @@ static BlockDriverAIOCB *bdrv_aio_flush_em(BlockDriverState *bs, return &acb->common; } +static BlockDriverAIOCB *bdrv_aio_noop_em(BlockDriverState *bs, + BlockDriverCompletionFunc *cb, void *opaque) +{ + BlockDriverAIOCBSync *acb; + + acb = qemu_aio_get(&bdrv_em_aio_pool, bs, cb, opaque); + acb->is_write = 1; /* don't bounce in the completion hadler */ + acb->qiov = NULL; + acb->bounce = NULL; + acb->ret = 0; + + if (!acb->bh) + acb->bh = qemu_bh_new(bdrv_aio_bh_cb, acb); + + qemu_bh_schedule(acb->bh); + return &acb->common; +} + /**************************************************************/ /* sync block device emulation */ -- 1.6.0.2