From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:53576) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bondA-00024t-Q5 for qemu-devel@nongnu.org; Tue, 27 Sep 2016 04:20:49 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1bond9-0002kE-Rf for qemu-devel@nongnu.org; Tue, 27 Sep 2016 04:20:48 -0400 Date: Tue, 27 Sep 2016 10:20:38 +0200 From: Kevin Wolf Message-ID: <20160927082038.GC4090@noname.str.redhat.com> References: <1474641161-10891-1-git-send-email-kwolf@redhat.com> <1474641161-10891-4-git-send-email-kwolf@redhat.com> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="PNTmBPCT7hxwcZjr" Content-Disposition: inline In-Reply-To: Subject: Re: [Qemu-devel] [PATCH v2 3/7] block/qapi: Move 'aio' option to file driver List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Max Reitz Cc: qemu-block@nongnu.org, eblake@redhat.com, qemu-devel@nongnu.org --PNTmBPCT7hxwcZjr Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable Am 26.09.2016 um 18:49 hat Max Reitz geschrieben: > On 23.09.2016 16:32, Kevin Wolf wrote: > > The option whether or not to use a native AIO interface really isn't a > > generic option for all drivers, but only applies to the native file > > protocols. This patch moves the option in blockdev-add to the > > appropriate places (raw-posix and raw-win32). > >=20 > > We still have to keep the flag BDRV_O_NATIVE_AIO for compatibility > > because so far the AIO option was usually specified on the wrong layer > > (the top-level format driver, which didn't even look at it) and then > > inherited by the protocol driver (where it was actually used). We can't > > forbid this use except in new interfaces. > >=20 > > Signed-off-by: Kevin Wolf > > --- > > block/raw-posix.c | 44 ++++++++++++++++++++++++--------------- > > block/raw-win32.c | 56 ++++++++++++++++++++++++++++++++++++++++++= +++----- > > qapi/block-core.json | 6 +++--- > > tests/qemu-iotests/087 | 4 ++-- > > 4 files changed, 83 insertions(+), 27 deletions(-) >=20 > [...] >=20 > > diff --git a/block/raw-win32.c b/block/raw-win32.c > > index 56f45fe..734bb10 100644 > > --- a/block/raw-win32.c > > +++ b/block/raw-win32.c >=20 > [...] >=20 > > +static bool get_aio_option(QemuOpts *opts, int flags, Error **errp) > > +{ > > + BlockdevAioOptions aio, aio_default; > > + > > + aio_default =3D (flags & BDRV_O_NATIVE_AIO) ? BLOCKDEV_AIO_OPTIONS= _NATIVE > > + : BLOCKDEV_AIO_OPTIONS_T= HREADS; > > + aio =3D qapi_enum_parse(BlockdevAioOptions_lookup, qemu_opt_get(op= ts, "aio"), > > + BLOCKDEV_AIO_OPTIONS__MAX, aio_default, errp= ); > > + > > + switch (aio) { > > + case BLOCKDEV_AIO_OPTIONS_NATIVE: > > + return true; > > + case BLOCKDEV_AIO_OPTIONS_THREADS: > > + return false; > > + default: > > + error_setg(errp, "Invalid AIO option"); >=20 > Any reason for catching this case here but not in raw-posix? >=20 > (Not that it really matters, though.) Nobody will forget raw-posix when adding a new AIO mode to win32, so I didn't feel like the additional code was worth it there. But if we add a new AIO mode to raw-posix, I'm pretty sure we will forget win32. Kevin --PNTmBPCT7hxwcZjr Content-Type: application/pgp-signature -----BEGIN PGP SIGNATURE----- Version: GnuPG v2.0.22 (GNU/Linux) iQIcBAEBAgAGBQJX6ivWAAoJEH8JsnLIjy/WR0EP/1XRznZPyt6D1XuP/+xGVSUM 1eg3G82BJjNYFaAQEbijqBWzQMLsxEcpJ9S2m+V20+QutQgQmDuAf4MLVYOnHMEu tv0S2XKM1jOLVWLqAhK+ttR11l1xjZqY07+dVvkcU6Qex46p/iwrFGb3nwY2+j2t L2Dc1b/RlFKU6seyFBPYhmRFq6BYCR45YOFAIJOrrGgA/PEaR0fdDyiUJYoqEvQr EUpIbJNrFm1SxIkHUXYZgEp5zKy9wdPZrDTRjvIItm6fgBQ5VIv35o996zJ0w+vC rk+QYAHTPP3AE9RB5hMRmSA9Fj2fsPwRDq1bRWgLCfd0i3qVjAhLR7L18zbF4k7t AXGea9TxHbXFjZdHz22mKbsPBEJ/bNw3nDqwG40gi8+fswqL5DNfx/XD1seSJ50F Ckd0n2PvGhZv3YZ3nOpQSEMdYzunok+rSh8vFFvJvfJmhz6qSY0NFM9WxSaTs1/F YzRFQXb2lOshZNlFrN9ChBiq/d9M9clq0DInmPsTXqlcQOB+RgkkgHSy8bHA1qY8 xgMzoKYsQkmZbGNfTe8J0tDeHqg5lagGYGdcwKOTTj+1AWMBa22/r1XqB2BuTjuF yRhYoyKBzVgD3VhMk/NfOoHrrWwsOZQbTfUUvXJncGY04iRVlsCIzGk9uiZgLNJy /fpJ+BCBcLgR0ymSkVJr =8zvF -----END PGP SIGNATURE----- --PNTmBPCT7hxwcZjr--