From patchwork Fri Aug 28 12:51:38 2009 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Stefan Weil X-Patchwork-Id: 32358 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from lists.gnu.org (lists.gnu.org [199.232.76.165]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (Client did not present a certificate) by bilbo.ozlabs.org (Postfix) with ESMTPS id DECF0B7B9F for ; Fri, 28 Aug 2009 23:20:34 +1000 (EST) Received: from localhost ([127.0.0.1]:43616 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1Mh1NT-0005bE-SX for incoming@patchwork.ozlabs.org; Fri, 28 Aug 2009 09:20:27 -0400 Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1Mh0w1-000381-1j for qemu-devel@nongnu.org; Fri, 28 Aug 2009 08:52:05 -0400 Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1Mh0vt-00035O-Eg for qemu-devel@nongnu.org; Fri, 28 Aug 2009 08:52:03 -0400 Received: from [199.232.76.173] (port=42545 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1Mh0vs-000356-Uz for qemu-devel@nongnu.org; Fri, 28 Aug 2009 08:51:57 -0400 Received: from moutng.kundenserver.de ([212.227.126.177]:49585) by monty-python.gnu.org with esmtp (Exim 4.60) (envelope-from ) id 1Mh0vs-000887-DP for qemu-devel@nongnu.org; Fri, 28 Aug 2009 08:51:56 -0400 Received: from flocke.weilnetz.de (p54ADF348.dip.t-dialin.net [84.173.243.72]) by mrelayeu.kundenserver.de (node=mreu1) with ESMTP (Nemesis) id 0MKv1o-1Mh0vb3Ler-000Hsq; Fri, 28 Aug 2009 14:51:40 +0200 Received: from localhost ([127.0.0.1] ident=stefan) by flocke.weilnetz.de with esmtp (Exim 4.69) (envelope-from ) id 1Mh0va-0003Tb-Rt; Fri, 28 Aug 2009 14:51:38 +0200 Message-ID: <4A97D2DA.6070905@mail.berlios.de> Date: Fri, 28 Aug 2009 14:51:38 +0200 From: Stefan Weil User-Agent: Mozilla-Thunderbird 2.0.0.22 (X11/20090707) MIME-Version: 1.0 To: QEMU Developers References: <4A97C3E9.3060006@redhat.com> In-Reply-To: <4A97C3E9.3060006@redhat.com> X-Provags-ID: V01U2FsdGVkX19C0JD12MRJTH1URbIiqFk0eWXDzelWHzQSY5u PR0MF7yVk4AjYD9hscqAggkLFmVfMoboucHt/AyUaO/af9K/r+ MyPEhzoHmGgzePd+tBr7yhFCJ7oBiJjixidjXtTZAueff84gN1 A6g== X-detected-operating-system: by monty-python.gnu.org: Genre and OS details not recognized. Cc: Kevin Wolf , Anthony Liguori Subject: [Qemu-devel] [PATCH] Don't compile aio code if CONFIG_LINUX_AIO is undefined X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: qemu-devel.nongnu.org List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Errors-To: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org This patch fixes linker errors when building QEMU without Linux AIO support. It is based on suggestions from malc and Kevin Wolf. Signed-off-by: Stefan Weil --- block/raw-posix.c | 8 +++++++- 1 files changed, 7 insertions(+), 1 deletions(-) return 0; @@ -542,9 +546,11 @@ static BlockDriverAIOCB *raw_aio_submit(BlockDriverState *bs, if (s->aligned_buf) { if (!qiov_is_aligned(qiov)) { type |= QEMU_AIO_MISALIGNED; +#ifdef CONFIG_LINUX_AIO } else if (s->use_aio) { return laio_submit(bs, s->aio_ctx, s->fd, sector_num, qiov, - nb_sectors, cb, opaque, type); + nb_sectors, cb, opaque, type); +#endif } } diff --git a/block/raw-posix.c b/block/raw-posix.c index 8a7dc15..2125d67 100644 --- a/block/raw-posix.c +++ b/block/raw-posix.c @@ -115,7 +115,9 @@ typedef struct BDRVRawState { int fd_got_error; int fd_media_changed; #endif +#ifdef CONFIG_LINUX_AIO int use_aio; +#endif uint8_t* aligned_buf; } BDRVRawState; @@ -183,7 +185,9 @@ static int raw_open_common(BlockDriverState *bs, const char *filename, if (!s->aio_ctx) { goto out_free_buf; } +#ifdef CONFIG_LINUX_AIO s->use_aio = 0; +#endif }