qemu-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [PATCH] iotests/check: move general long options to double dash


From: Emanuele Giuseppe Esposito
Subject: Re: [PATCH] iotests/check: move general long options to double dash
Date: Thu, 3 Jun 2021 12:21:47 +0200
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:78.0) Gecko/20100101 Thunderbird/78.8.1



On 26/05/2021 20:16, Vladimir Sementsov-Ogievskiy wrote:
So, the change:

   -makecheck -> --makecheck
   -valgrind  -> --valgrind
   -nocache   -> --nocache
   -misalign  -> --misalign

Motivation:

1. Several long options are already have double dash:
   --dry-run, --color, --groups, --exclude-groups, --start-from

2. -misalign is used to add --misalign option (two dashes) to qemu-io

3. qemu-io and qemu-nbd has --nocache option (two dashes)

Signed-off-by: Vladimir Sementsov-Ogievskiy <vsementsov@virtuozzo.com>
---
  tests/check-block.sh         | 2 +-
  tests/qemu-iotests/check     | 8 ++++----
  tests/qemu-iotests/common.rc | 4 ++--
  3 files changed, 7 insertions(+), 7 deletions(-)

diff --git a/tests/check-block.sh b/tests/check-block.sh
index f86cb863de..90619454d3 100755
--- a/tests/check-block.sh
+++ b/tests/check-block.sh
@@ -77,7 +77,7 @@ export PYTHONUTF8=1
ret=0
  for fmt in $format_list ; do
-    ${PYTHON} ./check -makecheck -$fmt $group || ret=1
+    ${PYTHON} ./check --makecheck -$fmt $group || ret=1
  done
exit $ret
diff --git a/tests/qemu-iotests/check b/tests/qemu-iotests/check
index 2dd529eb75..3f3962dd75 100755
--- a/tests/qemu-iotests/check
+++ b/tests/qemu-iotests/check
@@ -32,11 +32,11 @@ def make_argparser() -> argparse.ArgumentParser:
p.add_argument('-n', '--dry-run', action='store_true',
                     help='show me, do not run tests')
-    p.add_argument('-makecheck', action='store_true',
+    p.add_argument('--makecheck', action='store_true',
                     help='pretty print output for make check')
p.add_argument('-d', dest='debug', action='store_true', help='debug')
-    p.add_argument('-misalign', action='store_true',
+    p.add_argument('--misalign', action='store_true',
                     help='misalign memory allocations')
      p.add_argument('--color', choices=['on', 'off', 'auto'],
                     default='auto', help="use terminal colors. The default "
@@ -46,7 +46,7 @@ def make_argparser() -> argparse.ArgumentParser:
      mg = g_env.add_mutually_exclusive_group()
      # We don't set default for cachemode, as we need to distinguish default
      # from user input later.
-    mg.add_argument('-nocache', dest='cachemode', action='store_const',
+    mg.add_argument('--nocache', dest='cachemode', action='store_const',
                      const='none', help='set cache mode "none" (O_DIRECT), '
                      'sets CACHEMODE environment variable')
      mg.add_argument('-c', dest='cachemode',
@@ -85,7 +85,7 @@ def make_argparser() -> argparse.ArgumentParser:
      g_bash.add_argument('-o', dest='imgopts',
                          help='options to pass to qemu-img create/convert, '
                          'sets IMGOPTS environment variable')
-    g_bash.add_argument('-valgrind', action='store_true',
+    g_bash.add_argument('--valgrind', action='store_true',
                          help='use valgrind, sets VALGRIND_QEMU environment '
                          'variable')
diff --git a/tests/qemu-iotests/common.rc b/tests/qemu-iotests/common.rc
index cbbf6d7c7f..e2f81cd41b 100644
--- a/tests/qemu-iotests/common.rc
+++ b/tests/qemu-iotests/common.rc
@@ -124,7 +124,7 @@ fi
# Set the variables to the empty string to turn Valgrind off
  # for specific processes, e.g.
-# $ VALGRIND_QEMU_IO= ./check -qcow2 -valgrind 015
+# $ VALGRIND_QEMU_IO= ./check -qcow2 --valgrind 015
: ${VALGRIND_QEMU_VM=$VALGRIND_QEMU}
  : ${VALGRIND_QEMU_IMG=$VALGRIND_QEMU}
@@ -134,7 +134,7 @@ fi
# The Valgrind own parameters may be set with
  # its environment variable VALGRIND_OPTS, e.g.
-# $ VALGRIND_OPTS="--leak-check=yes" ./check -qcow2 -valgrind 015
+# $ VALGRIND_OPTS="--leak-check=yes" ./check -qcow2 --valgrind 015

Ok I see why the short options do not make sense to have double dash, but if we want full consistency why fmt is left with one dash? Like "-qcow2", should we also change that? (that change might be more complex to do)

Thank you,
Emanuele




reply via email to

[Prev in Thread] Current Thread [Next in Thread]