Received: from eggs.gnu.org ([2001:4830:134:3::10]:39530) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1boZ6I-0006PS-Jg for qemu-devel@nongnu.org; Mon, 26 Sep 2016 12:49:55 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1boZ6H-00052v-Mv for qemu-devel@nongnu.org; Mon, 26 Sep 2016 12:49:54 -0400 References: <1474641161-10891-1-git-send-email-kwolf@redhat.com> <1474641161-10891-4-git-send-email-kwolf@redhat.com> From: Max Reitz Message-ID: Date: Mon, 26 Sep 2016 18:49:43 +0200 MIME-Version: 1.0 In-Reply-To: <1474641161-10891-4-git-send-email-kwolf@redhat.com> Content-Type: multipart/signed; micalg=pgp-sha256; protocol="application/pgp-signature"; boundary="miDe6MLIQhgl2aom7JRN1BOE9XWrFH1al" 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: Kevin Wolf , qemu-block@nongnu.org Cc: eblake@redhat.com, qemu-devel@nongnu.org This is an OpenPGP/MIME signed message (RFC 4880 and 3156) --miDe6MLIQhgl2aom7JRN1BOE9XWrFH1al From: Max Reitz To: Kevin Wolf , qemu-block@nongnu.org Cc: eblake@redhat.com, qemu-devel@nongnu.org Message-ID: Subject: Re: [PATCH v2 3/7] block/qapi: Move 'aio' option to file driver References: <1474641161-10891-1-git-send-email-kwolf@redhat.com> <1474641161-10891-4-git-send-email-kwolf@redhat.com> In-Reply-To: <1474641161-10891-4-git-send-email-kwolf@redhat.com> Content-Type: text/plain; charset=iso-8859-15 Content-Transfer-Encoding: quoted-printable 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(-) [...] > 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 [...] > +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"); Any reason for catching this case here but not in raw-posix? (Not that it really matters, though.) Max --miDe6MLIQhgl2aom7JRN1BOE9XWrFH1al Content-Type: application/pgp-signature; name="signature.asc" Content-Description: OpenPGP digital signature Content-Disposition: attachment; filename="signature.asc" -----BEGIN PGP SIGNATURE----- iQEvBAEBCAAZBQJX6VGnEhxtcmVpdHpAcmVkaGF0LmNvbQAKCRD0B9sAYdXPQHoN B/4xHdWMQfQyrIF6vU9Uuv16MkcIZzLRDUKDpRi1E3AcrmQ+4yMn2hwWKHymLrRY XYG5LuwA34LFqUz6jZlv+Lel9RDOPfnyeE/3BIOb+Fg98175uMX/1Lsjhvu17gsy 7CaP7+3PkqnMlw+ntYpMu+etA+bcledBenB9hWpdXA0XWdvOb1yUlxzie73YHyfi 5wVcfwTJASmbmMnNXnQlE6P47FAg24ZP+sdriY4rov+H2+sZzK7qE+lrylcFQxWk KVpVXllOfZ/pFGbptU9VaRx5PArh+GqE+Di7sEvaYDg803posmA/K9nuJewqvSEE LT3GVw7ATbSdX/1ewcH+WF75 =9GCA -----END PGP SIGNATURE----- --miDe6MLIQhgl2aom7JRN1BOE9XWrFH1al--