From patchwork Thu Mar 7 12:41:48 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Stefan Hajnoczi X-Patchwork-Id: 225838 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from lists.gnu.org (lists.gnu.org [208.118.235.17]) (using TLSv1 with cipher AES256-SHA (256/256 bits)) (Client did not present a certificate) by ozlabs.org (Postfix) with ESMTPS id 5AD902C0382 for ; Thu, 7 Mar 2013 23:43:20 +1100 (EST) Received: from localhost ([::1]:55272 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1UDaAI-0008R2-JF for incoming@patchwork.ozlabs.org; Thu, 07 Mar 2013 07:43:18 -0500 Received: from eggs.gnu.org ([208.118.235.92]:51558) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1UDa9j-00087a-MG for qemu-devel@nongnu.org; Thu, 07 Mar 2013 07:42:51 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1UDa9g-0007Jv-Tt for qemu-devel@nongnu.org; Thu, 07 Mar 2013 07:42:43 -0500 Received: from mx1.redhat.com ([209.132.183.28]:26875) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1UDa9g-0007Jp-MT for qemu-devel@nongnu.org; Thu, 07 Mar 2013 07:42:40 -0500 Received: from int-mx01.intmail.prod.int.phx2.redhat.com (int-mx01.intmail.prod.int.phx2.redhat.com [10.5.11.11]) by mx1.redhat.com (8.14.4/8.14.4) with ESMTP id r27CgeAP023230 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK) for ; Thu, 7 Mar 2013 07:42:40 -0500 Received: from localhost (ovpn-112-34.ams2.redhat.com [10.36.112.34]) by int-mx01.intmail.prod.int.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id r27Cgc6J032660; Thu, 7 Mar 2013 07:42:39 -0500 From: Stefan Hajnoczi To: Date: Thu, 7 Mar 2013 13:41:48 +0100 Message-Id: <1362660110-26970-6-git-send-email-stefanha@redhat.com> In-Reply-To: <1362660110-26970-1-git-send-email-stefanha@redhat.com> References: <1362660110-26970-1-git-send-email-stefanha@redhat.com> X-Scanned-By: MIMEDefang 2.67 on 10.5.11.11 X-detected-operating-system: by eggs.gnu.org: GNU/Linux 3.x X-Received-From: 209.132.183.28 Cc: Kevin Wolf , Paolo Bonzini , Stefan Hajnoczi Subject: [Qemu-devel] [PATCH v2 5/7] block: add bdrv_get_aio_context() X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Sender: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org For now bdrv_get_aio_context() is just a stub that calls qemu_aio_get_context() since the block layer is currently tied to the main loop AioContext. Add the stub now so that the block layer can begin accessing its AioContext. Signed-off-by: Stefan Hajnoczi --- block.c | 6 ++++++ include/block/block_int.h | 7 +++++++ 2 files changed, 13 insertions(+) diff --git a/block.c b/block.c index 124a9eb..0e5cd01 100644 --- a/block.c +++ b/block.c @@ -4638,3 +4638,9 @@ out: bdrv_delete(bs); } } + +AioContext *bdrv_get_aio_context(BlockDriverState *bs) +{ + /* Currently BlockDriverState always uses the main loop AioContext */ + return qemu_get_aio_context(); +} diff --git a/include/block/block_int.h b/include/block/block_int.h index eaad53e..966f7fd 100644 --- a/include/block/block_int.h +++ b/include/block/block_int.h @@ -293,6 +293,13 @@ int get_tmp_filename(char *filename, int size); void bdrv_set_io_limits(BlockDriverState *bs, BlockIOLimit *io_limits); +/** + * bdrv_get_aio_context: + * + * Returns: the currently bound #AioContext + */ +AioContext *bdrv_get_aio_context(BlockDriverState *bs); + #ifdef _WIN32 int is_windows_drive(const char *filename); #endif