qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: "Dirk Müller" <dmueller@suse.de>
To: "Daniel P. Berrangé" <berrange@redhat.com>
Cc: eblake@redhat.com, qemu-devel@nongnu.org, qemu-block@nongnu.org
Subject: Re: [PATCH] Only advertise aio=io_uring if support is actually available
Date: Mon, 25 Apr 2022 13:06:29 +0200	[thread overview]
Message-ID: <4399482.LvFx2qVVIh@magnolia> (raw)
In-Reply-To: <Yl/FYrWfjAOeIl94@redhat.com>

On Mittwoch, 20. April 2022 10:33:38 CEST Daniel P. Berrangé wrote:

Hi Daniel,

> If we're going to conditionalize this, then we really ought to be
> address it fully, because 'native' is also platform specific.

Good point. I can do that as well. 

> IOW, we would end up needing something more like this:
> 
>            .help = "host AIO implementation (threads"
>  #if defined(WIN32) || defined(CONFIG_LINUX_AIO)
>                    ", native"
>  #endif
>  #if defined(CONFIG_LINUX_IO_URING)
>                    ", io_uring"
>  #else
>                    "),"
> 
> admittedly pretty ugly


the only other option I came up with so far is something like this:

+#if defined(CONFIG_LINUX_AIO)
+#define IF_CONFIG_LINUX_AIO(X) X
+#else
+#define IF_CONFIG_LINUX_AIO(X)
+#endif
+
+#if defined(CONFIG_LINUX_IO_URING)
+#define IF_CONFIG_LINUX_IO_URING(X) X
+#else
+#define IF_CONFIG_LINUX_IO_URING(X)
+#endif
+


and then use it like


-            .help = "host AIO implementation (threads"
-#ifdef CONFIG_LINUX_AIO
-            ", native"
-#endif
-#ifdef CONFIG_LINUX_IO_URING
-            ", io_uring"
-#endif
-            ")",
+            .help = "host AIO implementation (threads" IF_CONFIG_LINUX_AIO(", 
native") IF_CONFIG_LINUX_IO_URING(", io_uring") ")",


WDYT, is that worth it?

Thanks,
Dirk





      parent reply	other threads:[~2022-04-25 11:07 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-04-19 17:19 [PATCH] Only advertise aio=io_uring if support is actually available Dirk Müller
2022-04-19 19:23 ` Eric Blake
2022-04-20  8:33 ` Daniel P. Berrangé
2022-04-21 16:51   ` Dirk Müller
2022-04-25 11:06   ` Dirk Müller [this message]

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=4399482.LvFx2qVVIh@magnolia \
    --to=dmueller@suse.de \
    --cc=berrange@redhat.com \
    --cc=eblake@redhat.com \
    --cc=qemu-block@nongnu.org \
    --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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).