Received: from eggs.gnu.org ([2001:4830:134:3::10]:46993) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZG3Jb-0003ly-98 for qemu-devel@nongnu.org; Fri, 17 Jul 2015 06:56:28 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1ZG3Ja-000615-8Y for qemu-devel@nongnu.org; Fri, 17 Jul 2015 06:56:27 -0400 Date: Fri, 17 Jul 2015 12:56:15 +0200 From: Kevin Wolf Message-ID: <20150717105615.GB4622@noname.redhat.com> References: <1437127189-1137-1-git-send-email-stefanha@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <1437127189-1137-1-git-send-email-stefanha@redhat.com> Subject: Re: [Qemu-devel] [PATCH] blockdev: warn about aio=native if libaio is unavailable List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Stefan Hajnoczi Cc: pbonzini@redhat.com, qemu-devel@nongnu.org, qemu-block@nongnu.org, Markus Armbruster Am 17.07.2015 um 11:59 hat Stefan Hajnoczi geschrieben: > 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 I hope not too many people are using aio=native without having libaio compiled in... Can we make it a message like for the case with aio=native,cache.direct=off, i.e. a deprecation warning that allows us to make this an error in a few releases? > 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 *sigh* It's sad to see that we still have such code in the generic block layer. It has no business there, the raw-posix driver should check whether it can support Linux AIO or not. Paolo: You added some code to raw-win32 that implements aio=native. Did it ever work in qemu proper, or only in the tools? It doesn't seem that this code would even have added the flag on Windows builds. Kevin