All of lore.kernel.org
 help / color / mirror / Atom feed
From: Stefan Weil <weil@mail.berlios.de>
To: QEMU Developers <qemu-devel@nongnu.org>
Cc: Kevin Wolf <kwolf@redhat.com>, Anthony Liguori <aliguori@us.ibm.com>
Subject: [Qemu-devel] [PATCH] Don't compile aio code if CONFIG_LINUX_AIO is undefined
Date: Fri, 28 Aug 2009 14:51:38 +0200	[thread overview]
Message-ID: <4A97D2DA.6070905@mail.berlios.de> (raw)
In-Reply-To: <4A97C3E9.3060006@redhat.com>

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 <weil@mail.berlios.de>
---
 block/raw-posix.c |    8 +++++++-
 1 files changed, 7 insertions(+), 1 deletions(-)

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
     }

     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
         }
     }

           reply	other threads:[~2009-08-28 12:52 UTC|newest]

Thread overview: expand[flat|nested]  mbox.gz  Atom feed
 [parent not found: <4A97C3E9.3060006@redhat.com>]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=4A97D2DA.6070905@mail.berlios.de \
    --to=weil@mail.berlios.de \
    --cc=aliguori@us.ibm.com \
    --cc=kwolf@redhat.com \
    --cc=qemu-devel@nongnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.