From: Stefan Hajnoczi <stefanha@redhat.com>
To: qemu-devel@nongnu.org
Cc: Kevin Wolf <kwolf@redhat.com>,
Stefan Hajnoczi <stefanha@redhat.com>,
Markus Armbruster <armbru@redhat.com>,
qemu-block@nongnu.org
Subject: [Qemu-devel] [PATCH] blockdev: warn about aio=native if libaio is unavailable
Date: Fri, 17 Jul 2015 10:59:49 +0100 [thread overview]
Message-ID: <1437127189-1137-1-git-send-email-stefanha@redhat.com> (raw)
QEMU silently ignores aio=native if libaio is unavailable. It is
confusing when aio=native performance is identical to aio=threads
because the binary was accidentally built without libaio.
Use error_report() because failing would break backward compatibility.
There are probably users using aio=native who would be inconvenienced if
QEMU suddenly refused to start their guests.
Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>
---
blockdev.c | 7 +++++--
1 file changed, 5 insertions(+), 2 deletions(-)
diff --git a/blockdev.c b/blockdev.c
index 62a4586..f30828a 100644
--- a/blockdev.c
+++ b/blockdev.c
@@ -405,10 +405,14 @@ static BlockBackend *blockdev_init(const char *file, QDict *bs_opts,
bdrv_flags |= BDRV_O_NO_FLUSH;
}
-#ifdef CONFIG_LINUX_AIO
if ((buf = qemu_opt_get(opts, "aio")) != NULL) {
if (!strcmp(buf, "native")) {
+#ifdef CONFIG_LINUX_AIO
bdrv_flags |= BDRV_O_NATIVE_AIO;
+#else
+ error_report("warning: aio=native support unavailable, "
+ "using default instead");
+#endif
} else if (!strcmp(buf, "threads")) {
/* this is the default */
} else {
@@ -416,7 +420,6 @@ static BlockBackend *blockdev_init(const char *file, QDict *bs_opts,
goto early_err;
}
}
-#endif
if ((buf = qemu_opt_get(opts, "format")) != NULL) {
if (is_help_option(buf)) {
--
2.4.3
next reply other threads:[~2015-07-17 10:00 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-07-17 9:59 Stefan Hajnoczi [this message]
2015-07-17 10:56 ` [Qemu-devel] [PATCH] blockdev: warn about aio=native if libaio is unavailable Kevin Wolf
2015-07-17 13:57 ` Stefan Hajnoczi
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=1437127189-1137-1-git-send-email-stefanha@redhat.com \
--to=stefanha@redhat.com \
--cc=armbru@redhat.com \
--cc=kwolf@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).