[PATCH for-5.2 0/4] deprecate short-form boolean options

Paolo Bonzini posted 4 patches 3 years, 6 months ago
Test checkpatch failed
Patches applied successfully (tree, apply log)
git fetch https://github.com/patchew-project/qemu tags/patchew/20201103151452.416784-1-pbonzini@redhat.com
Maintainers: Paolo Bonzini <pbonzini@redhat.com>, "Marc-André Lureau" <marcandre.lureau@redhat.com>, Thomas Huth <thuth@redhat.com>, Markus Armbruster <armbru@redhat.com>, Gerd Hoffmann <kraxel@redhat.com>, Laurent Vivier <lvivier@redhat.com>
There is a newer version of this series
chardev/char.c                       |  1 +
docs/system/deprecated.rst           |  7 ++++
include/qemu/option.h                |  1 +
tests/qtest/device-introspect-test.c |  9 +++--
tests/qtest/ivshmem-test.c           |  2 +-
tests/test-qemu-opts.c               |  1 +
ui/spice-core.c                      |  1 +
util/qemu-option.c                   | 51 ++++++++++++++++------------
8 files changed, 48 insertions(+), 25 deletions(-)
[PATCH for-5.2 0/4] deprecate short-form boolean options
Posted by Paolo Bonzini 3 years, 6 months ago
QemuOpts lets you write boolean options in "short form"
where "abc" means "abc=on" and "noabc" means "abc=off".
This is confusing, since it is not done for the first
key=value pair but only if there is an implied key;
it can also be grossly misused, for example "-device
e1000,noid" will create a device with id equal to "off".

Unfortunately, this idiom has found wide use with
-chardev (think "server,nowait") and to a lesser extent
-spice.

Patch 4 in this series deprecates it for all other option
groups.  The first three patches avoid emitting the warning
in tests (which in one case were buggy, see patch 3) or
for the "help" option.

Paolo Bonzini (4):
  ivshmem-test: do not use short-form boolean option
  qemu-option: move help handling to get_opt_name_value
  qtest: escape device name in device-introspect-test
  qemu-option: warn for short-form boolean options

 chardev/char.c                       |  1 +
 docs/system/deprecated.rst           |  7 ++++
 include/qemu/option.h                |  1 +
 tests/qtest/device-introspect-test.c |  9 +++--
 tests/qtest/ivshmem-test.c           |  2 +-
 tests/test-qemu-opts.c               |  1 +
 ui/spice-core.c                      |  1 +
 util/qemu-option.c                   | 51 ++++++++++++++++------------
 8 files changed, 48 insertions(+), 25 deletions(-)

-- 
2.26.2


Re: [PATCH for-5.2 0/4] deprecate short-form boolean options
Posted by no-reply@patchew.org 3 years, 6 months ago
Patchew URL: https://patchew.org/QEMU/20201103151452.416784-1-pbonzini@redhat.com/



Hi,

This series seems to have some coding style problems. See output below for
more information:

Type: series
Message-id: 20201103151452.416784-1-pbonzini@redhat.com
Subject: [PATCH for-5.2 0/4] deprecate short-form boolean options

=== TEST SCRIPT BEGIN ===
#!/bin/bash
git rev-parse base > /dev/null || exit 0
git config --local diff.renamelimit 0
git config --local diff.renames True
git config --local diff.algorithm histogram
./scripts/checkpatch.pl --mailback base..
=== TEST SCRIPT END ===

Updating 3c8cf5a9c21ff8782164d1def7f44bd888713384
From https://github.com/patchew-project/qemu
 * [new tag]         patchew/20201103151452.416784-1-pbonzini@redhat.com -> patchew/20201103151452.416784-1-pbonzini@redhat.com
Switched to a new branch 'test'
1b42d99 qemu-option: warn for short-form boolean options
9927d00 qtest: escape device name in device-introspect-test
dd427b7 qemu-option: move help handling to get_opt_name_value
e1273b2 ivshmem-test: do not use short-form boolean option

=== OUTPUT BEGIN ===
1/4 Checking commit e1273b2eab2e (ivshmem-test: do not use short-form boolean option)
2/4 Checking commit dd427b742e3b (qemu-option: move help handling to get_opt_name_value)
3/4 Checking commit 9927d0090494 (qtest: escape device name in device-introspect-test)
4/4 Checking commit 1b42d9947c18 (qemu-option: warn for short-form boolean options)
WARNING: line over 80 characters
#56: FILE: include/qemu/option.h:68:
+    bool allow_flag_options; /* Whether to warn for short-form boolean options */

ERROR: line over 90 characters
#117: FILE: util/qemu-option.c:812:
+                error_report("short-form boolean option '%s%s' deprecated", prefix, *name);

WARNING: line over 80 characters
#136: FILE: util/qemu-option.c:840:
+        p = get_opt_name_value(p, firstname, warn_on_flag, help_wanted, &option, &value);

total: 1 errors, 2 warnings, 124 lines checked

Patch 4/4 has style problems, please review.  If any of these errors
are false positives report them to the maintainer, see
CHECKPATCH in MAINTAINERS.

=== OUTPUT END ===

Test command exited with code: 1


The full log is available at
http://patchew.org/logs/20201103151452.416784-1-pbonzini@redhat.com/testing.checkpatch/?type=message.
---
Email generated automatically by Patchew [https://patchew.org/].
Please send your feedback to patchew-devel@redhat.com