Received: from eggs.gnu.org ([2001:4830:134:3::10]:46799) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1boyIH-0000bs-9b for qemu-devel@nongnu.org; Tue, 27 Sep 2016 15:44:01 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1boyIG-0008Vu-9K for qemu-devel@nongnu.org; Tue, 27 Sep 2016 15:43:57 -0400 References: <1474641161-10891-1-git-send-email-kwolf@redhat.com> <1474641161-10891-4-git-send-email-kwolf@redhat.com> <20160927082038.GC4090@noname.str.redhat.com> From: Max Reitz Message-ID: <68b5a6af-5da2-60e6-ac02-a47575691139@redhat.com> Date: Tue, 27 Sep 2016 21:43:46 +0200 MIME-Version: 1.0 In-Reply-To: <20160927082038.GC4090@noname.str.redhat.com> Content-Type: multipart/signed; micalg=pgp-sha256; protocol="application/pgp-signature"; boundary="hOq9X20AONwibJIVP3cIgcxa5mqaeO0H1" 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 Cc: qemu-block@nongnu.org, eblake@redhat.com, qemu-devel@nongnu.org This is an OpenPGP/MIME signed message (RFC 4880 and 3156) --hOq9X20AONwibJIVP3cIgcxa5mqaeO0H1 From: Max Reitz To: Kevin Wolf Cc: qemu-block@nongnu.org, eblake@redhat.com, qemu-devel@nongnu.org Message-ID: <68b5a6af-5da2-60e6-ac02-a47575691139@redhat.com> 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> <20160927082038.GC4090@noname.str.redhat.com> In-Reply-To: <20160927082038.GC4090@noname.str.redhat.com> Content-Type: text/plain; charset=windows-1252 Content-Transfer-Encoding: quoted-printable On 27.09.2016 10:20, Kevin Wolf wrote: > 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). >>> >>> 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 laye= r >>> (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. >>> >>> 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_OPTIO= NS_NATIVE >>> + : BLOCKDEV_AIO_OPTIONS= _THREADS; >>> + aio =3D qapi_enum_parse(BlockdevAioOptions_lookup, qemu_opt_get(= opts, "aio"), >>> + BLOCKDEV_AIO_OPTIONS__MAX, aio_default, er= rp); >>> + >>> + 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.) >=20 > 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. :-) Good point. Max --hOq9X20AONwibJIVP3cIgcxa5mqaeO0H1 Content-Type: application/pgp-signature; name="signature.asc" Content-Description: OpenPGP digital signature Content-Disposition: attachment; filename="signature.asc" -----BEGIN PGP SIGNATURE----- iQEvBAEBCAAZBQJX6svyEhxtcmVpdHpAcmVkaGF0LmNvbQAKCRD0B9sAYdXPQIeJ B/4lwS9r/Xvw3h/0vokLh0RIdew/mnISrnucJtAvm+bWO/BL1LI/KMN0ltuBJcD0 zGDbFBji2MmL12a6Ija9YH7UQul/tHgJaywbflejtCcliXo2y6+w+tqBzj55b83J zE8MFIbA+nTcGeNw31ztxkPG7HTNrSzHKl0rhxuwQhWPHA4wYQaAV670H4vJesnk hLyM61aL1f1FcUtVtx3q40SQL8oBKvuc7Z6/VWH/X6SABKmfwHeqn1XLGV/xbEMy aZFY18j5F8UAfk0HXSfzZGEayM15b47BSZU8m9kuJU4pgA5CAPe56KVSmyoASLrs 0gN1s3D4MHU5aCctHCXrzGnh =5Ayv -----END PGP SIGNATURE----- --hOq9X20AONwibJIVP3cIgcxa5mqaeO0H1--