[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Qemu-devel] [PATCH v2 3/7] block/qapi: Move 'aio' option to file dr
From: |
Kevin Wolf |
Subject: |
Re: [Qemu-devel] [PATCH v2 3/7] block/qapi: Move 'aio' option to file driver |
Date: |
Tue, 27 Sep 2016 10:20:38 +0200 |
User-agent: |
Mutt/1.5.21 (2010-09-15) |
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 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.
> >
> > Signed-off-by: Kevin Wolf <address@hidden>
> > ---
> > 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 = (flags & BDRV_O_NATIVE_AIO) ? BLOCKDEV_AIO_OPTIONS_NATIVE
> > + :
> > BLOCKDEV_AIO_OPTIONS_THREADS;
> > + aio = qapi_enum_parse(BlockdevAioOptions_lookup, qemu_opt_get(opts,
> > "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.)
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
pgp1gEz40VxkG.pgp
Description: PGP signature
- [Qemu-devel] [PATCH v2 6/7] block: Move 'discard' option to bdrv_open_common(), (continued)
- [Qemu-devel] [PATCH v2 6/7] block: Move 'discard' option to bdrv_open_common(), Kevin Wolf, 2016/09/23
- [Qemu-devel] [PATCH v2 2/7] block/qapi: Use separate options type for curl driver, Kevin Wolf, 2016/09/23
- [Qemu-devel] [PATCH v2 7/7] block: Remove qemu_root_bds_opts, Kevin Wolf, 2016/09/23
- [Qemu-devel] [PATCH v2 4/7] block: Parse 'detect-zeroes' in bdrv_open_common(), Kevin Wolf, 2016/09/23
- [Qemu-devel] [PATCH v2 5/7] block: Use 'detect-zeroes' option for 'blockdev-change-medium', Kevin Wolf, 2016/09/23
- [Qemu-devel] [PATCH v2 3/7] block/qapi: Move 'aio' option to file driver, Kevin Wolf, 2016/09/23
- Re: [Qemu-devel] [PATCH v2 0/7] block: Make more blockdev-add options work, Max Reitz, 2016/09/26
- Re: [Qemu-devel] [PATCH v2 0/7] block: Make more blockdev-add options work, Kevin Wolf, 2016/09/27