[v6,12/14] qemu-img: adds option to use aio engine
diff mbox series

Message ID 20190719133530.28688-13-mehta.aaru20@gmail.com
State New
Headers show
Series
  • Add support for io_uring
Related show

Commit Message

Aarushi Mehta July 19, 2019, 1:35 p.m. UTC
Use -i AIOMODE instead of -n.

Signed-off-by: Aarushi Mehta <mehta.aaru20@gmail.com>
---
 qemu-img.c | 11 ++++++++---
 1 file changed, 8 insertions(+), 3 deletions(-)

Comments

Stefan Hajnoczi July 19, 2019, 3:42 p.m. UTC | #1
On Fri, Jul 19, 2019 at 07:05:28PM +0530, Aarushi Mehta wrote:
> Use -i AIOMODE instead of -n.
> 
> Signed-off-by: Aarushi Mehta <mehta.aaru20@gmail.com>
> ---
>  qemu-img.c | 11 ++++++++---
>  1 file changed, 8 insertions(+), 3 deletions(-)
> 
> diff --git a/qemu-img.c b/qemu-img.c
> index 79983772de..b7a962afff 100644
> --- a/qemu-img.c
> +++ b/qemu-img.c
> @@ -4192,7 +4192,7 @@ static int img_bench(int argc, char **argv)
>              {"force-share", no_argument, 0, 'U'},
>              {0, 0, 0, 0}
>          };
> -        c = getopt_long(argc, argv, ":hc:d:f:no:qs:S:t:wU", long_options, NULL);
> +        c = getopt_long(argc, argv, ":hc:d:f:io:qs:S:t:wU", long_options, NULL);

Please preserve -n for backwards compability.

Patch
diff mbox series

diff --git a/qemu-img.c b/qemu-img.c
index 79983772de..b7a962afff 100644
--- a/qemu-img.c
+++ b/qemu-img.c
@@ -4192,7 +4192,7 @@  static int img_bench(int argc, char **argv)
             {"force-share", no_argument, 0, 'U'},
             {0, 0, 0, 0}
         };
-        c = getopt_long(argc, argv, ":hc:d:f:no:qs:S:t:wU", long_options, NULL);
+        c = getopt_long(argc, argv, ":hc:d:f:io:qs:S:t:wU", long_options, NULL);
         if (c == -1) {
             break;
         }
@@ -4232,8 +4232,13 @@  static int img_bench(int argc, char **argv)
         case 'f':
             fmt = optarg;
             break;
-        case 'n':
-            flags |= BDRV_O_NATIVE_AIO;
+        case 'i':
+            ret = bdrv_parse_aio(optarg, &flags);
+            if (ret < 0) {
+                error_report("Invalid aio option: %s", optarg);
+                ret = -1;
+                goto out;
+            }
             break;
         case 'o':
         {