diff mbox series

[v5,07/12] blockdev: accept io_uring as option

Message ID 20190610134905.22294-8-mehta.aaru20@gmail.com (mailing list archive)
State New, archived
Headers show
Series Add support for io_uring | expand

Commit Message

Aarushi Mehta June 10, 2019, 1:49 p.m. UTC
Signed-off-by: Aarushi Mehta <mehta.aaru20@gmail.com>
Reviewed-by: Stefan Hajnoczi <stefanha@redhat.com>
---
 blockdev.c | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

Comments

Maxim Levitsky June 17, 2019, 1:01 p.m. UTC | #1
On Mon, 2019-06-10 at 19:19 +0530, Aarushi Mehta wrote:
> Signed-off-by: Aarushi Mehta <mehta.aaru20@gmail.com>
> Reviewed-by: Stefan Hajnoczi <stefanha@redhat.com>
> ---
>  blockdev.c | 4 +++-
>  1 file changed, 3 insertions(+), 1 deletion(-)
> 
> diff --git a/blockdev.c b/blockdev.c
> index 3f44b891eb..a2a5b32604 100644
> --- a/blockdev.c
> +++ b/blockdev.c
> @@ -386,6 +386,8 @@ static void extract_common_blockdev_options(QemuOpts *opts, int *bdrv_flags,
>          if ((aio = qemu_opt_get(opts, "aio")) != NULL) {
>              if (!strcmp(aio, "native")) {
>                  *bdrv_flags |= BDRV_O_NATIVE_AIO;
> +            } else if (!strcmp(aio, "io_uring")) {
> +                *bdrv_flags |= BDRV_O_IO_URING;
>              } else if (!strcmp(aio, "threads")) {
>                  /* this is the default */
>              } else {
> @@ -4579,7 +4581,7 @@ QemuOptsList qemu_common_drive_opts = {
>          },{
>              .name = "aio",
>              .type = QEMU_OPT_STRING,
> -            .help = "host AIO implementation (threads, native)",
> +            .help = "host AIO implementation (threads, native, io_uring)",
>          },{
>              .name = BDRV_OPT_CACHE_WB,
>              .type = QEMU_OPT_BOOL,

Nitpick: Maybe we should rename the native to libaio (accept both but give an deprication warning)?


Reviewed-by: Maxim Levitsky <mlevitsk@redhat.com>

Best regards,
	Maxim Levitsky
Stefan Hajnoczi June 19, 2019, 10:24 a.m. UTC | #2
On Mon, Jun 17, 2019 at 04:01:45PM +0300, Maxim Levitsky wrote:
> On Mon, 2019-06-10 at 19:19 +0530, Aarushi Mehta wrote:
> > Signed-off-by: Aarushi Mehta <mehta.aaru20@gmail.com>
> > Reviewed-by: Stefan Hajnoczi <stefanha@redhat.com>
> > ---
> >  blockdev.c | 4 +++-
> >  1 file changed, 3 insertions(+), 1 deletion(-)
> > 
> > diff --git a/blockdev.c b/blockdev.c
> > index 3f44b891eb..a2a5b32604 100644
> > --- a/blockdev.c
> > +++ b/blockdev.c
> > @@ -386,6 +386,8 @@ static void extract_common_blockdev_options(QemuOpts *opts, int *bdrv_flags,
> >          if ((aio = qemu_opt_get(opts, "aio")) != NULL) {
> >              if (!strcmp(aio, "native")) {
> >                  *bdrv_flags |= BDRV_O_NATIVE_AIO;
> > +            } else if (!strcmp(aio, "io_uring")) {
> > +                *bdrv_flags |= BDRV_O_IO_URING;
> >              } else if (!strcmp(aio, "threads")) {
> >                  /* this is the default */
> >              } else {
> > @@ -4579,7 +4581,7 @@ QemuOptsList qemu_common_drive_opts = {
> >          },{
> >              .name = "aio",
> >              .type = QEMU_OPT_STRING,
> > -            .help = "host AIO implementation (threads, native)",
> > +            .help = "host AIO implementation (threads, native, io_uring)",
> >          },{
> >              .name = BDRV_OPT_CACHE_WB,
> >              .type = QEMU_OPT_BOOL,
> 
> Nitpick: Maybe we should rename the native to libaio (accept both but give an deprication warning)?

"libaio" is a clearer name but I'm afraid changing it or introducing a
new name is not worth it with so many users, command-lines, scripts, and
management tools that know about "native".  Having two names that mean
the same thing might cause confusion.

Let's leave it as is.

Stefan
Maxim Levitsky June 19, 2019, 10:48 a.m. UTC | #3
On Wed, 2019-06-19 at 11:24 +0100, Stefan Hajnoczi wrote:
> On Mon, Jun 17, 2019 at 04:01:45PM +0300, Maxim Levitsky wrote:
> > On Mon, 2019-06-10 at 19:19 +0530, Aarushi Mehta wrote:
> > > Signed-off-by: Aarushi Mehta <mehta.aaru20@gmail.com>
> > > Reviewed-by: Stefan Hajnoczi <stefanha@redhat.com>
> > > ---
> > >  blockdev.c | 4 +++-
> > >  1 file changed, 3 insertions(+), 1 deletion(-)
> > > 
> > > diff --git a/blockdev.c b/blockdev.c
> > > index 3f44b891eb..a2a5b32604 100644
> > > --- a/blockdev.c
> > > +++ b/blockdev.c
> > > @@ -386,6 +386,8 @@ static void extract_common_blockdev_options(QemuOpts *opts, int *bdrv_flags,
> > >          if ((aio = qemu_opt_get(opts, "aio")) != NULL) {
> > >              if (!strcmp(aio, "native")) {
> > >                  *bdrv_flags |= BDRV_O_NATIVE_AIO;
> > > +            } else if (!strcmp(aio, "io_uring")) {
> > > +                *bdrv_flags |= BDRV_O_IO_URING;
> > >              } else if (!strcmp(aio, "threads")) {
> > >                  /* this is the default */
> > >              } else {
> > > @@ -4579,7 +4581,7 @@ QemuOptsList qemu_common_drive_opts = {
> > >          },{
> > >              .name = "aio",
> > >              .type = QEMU_OPT_STRING,
> > > -            .help = "host AIO implementation (threads, native)",
> > > +            .help = "host AIO implementation (threads, native, io_uring)",
> > >          },{
> > >              .name = BDRV_OPT_CACHE_WB,
> > >              .type = QEMU_OPT_BOOL,
> > 
> > Nitpick: Maybe we should rename the native to libaio (accept both but give an deprication warning)?
> 
> "libaio" is a clearer name but I'm afraid changing it or introducing a
> new name is not worth it with so many users, command-lines, scripts, and
> management tools that know about "native".  Having two names that mean
> the same thing might cause confusion.
> 
> Let's leave it as is.
> 
I won't argue about this, also this can also be done later.

Best regards,
	Maxim Levitsky
diff mbox series

Patch

diff --git a/blockdev.c b/blockdev.c
index 3f44b891eb..a2a5b32604 100644
--- a/blockdev.c
+++ b/blockdev.c
@@ -386,6 +386,8 @@  static void extract_common_blockdev_options(QemuOpts *opts, int *bdrv_flags,
         if ((aio = qemu_opt_get(opts, "aio")) != NULL) {
             if (!strcmp(aio, "native")) {
                 *bdrv_flags |= BDRV_O_NATIVE_AIO;
+            } else if (!strcmp(aio, "io_uring")) {
+                *bdrv_flags |= BDRV_O_IO_URING;
             } else if (!strcmp(aio, "threads")) {
                 /* this is the default */
             } else {
@@ -4579,7 +4581,7 @@  QemuOptsList qemu_common_drive_opts = {
         },{
             .name = "aio",
             .type = QEMU_OPT_STRING,
-            .help = "host AIO implementation (threads, native)",
+            .help = "host AIO implementation (threads, native, io_uring)",
         },{
             .name = BDRV_OPT_CACHE_WB,
             .type = QEMU_OPT_BOOL,