From patchwork Fri Mar 15 15:14:19 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Stefan Hajnoczi X-Patchwork-Id: 228062 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 776ED2C072D for ; Sat, 16 Mar 2013 02:25:18 +1100 (EST) Received: from localhost ([::1]:40005 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1UGWVQ-0006I0-Jk for incoming@patchwork.ozlabs.org; Fri, 15 Mar 2013 11:25:16 -0400 Received: from eggs.gnu.org ([208.118.235.92]:43116) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1UGWLi-00007K-8N for qemu-devel@nongnu.org; Fri, 15 Mar 2013 11:15:20 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1UGWLf-0004WP-0h for qemu-devel@nongnu.org; Fri, 15 Mar 2013 11:15:14 -0400 Received: from mx1.redhat.com ([209.132.183.28]:47531) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1UGWLe-0004W9-NO for qemu-devel@nongnu.org; Fri, 15 Mar 2013 11:15:10 -0400 Received: from int-mx09.intmail.prod.int.phx2.redhat.com (int-mx09.intmail.prod.int.phx2.redhat.com [10.5.11.22]) by mx1.redhat.com (8.14.4/8.14.4) with ESMTP id r2FFFA8V007421 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK); Fri, 15 Mar 2013 11:15:10 -0400 Received: from localhost (ovpn-112-50.ams2.redhat.com [10.36.112.50]) by int-mx09.intmail.prod.int.phx2.redhat.com (8.14.4/8.14.4) with ESMTP id r2FFF9lO001577; Fri, 15 Mar 2013 11:15:09 -0400 From: Stefan Hajnoczi To: Date: Fri, 15 Mar 2013 16:14:19 +0100 Message-Id: <1363360465-5247-23-git-send-email-stefanha@redhat.com> In-Reply-To: <1363360465-5247-1-git-send-email-stefanha@redhat.com> References: <1363360465-5247-1-git-send-email-stefanha@redhat.com> X-Scanned-By: MIMEDefang 2.68 on 10.5.11.22 X-detected-operating-system: by eggs.gnu.org: GNU/Linux 3.x X-Received-From: 209.132.183.28 Cc: Anthony Liguori Subject: [Qemu-devel] [PATCH 22/28] 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 Reviewed-by: Paolo Bonzini --- block.c | 6 ++++++ include/block/block_int.h | 7 +++++++ 2 files changed, 13 insertions(+) diff --git a/block.c b/block.c index 0ab164d..037e15e 100644 --- a/block.c +++ b/block.c @@ -4681,3 +4681,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 baf80e3..ce0aa26 100644 --- a/include/block/block_int.h +++ b/include/block/block_int.h @@ -294,6 +294,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