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

Paolo Bonzini posted 2 patches 3 years, 5 months ago
Test checkpatch failed
Patches applied successfully (tree, apply log)
git fetch https://github.com/patchew-project/qemu tags/patchew/20201105142731.623428-1-pbonzini@redhat.com
Maintainers: Markus Armbruster <armbru@redhat.com>, Gerd Hoffmann <kraxel@redhat.com>, "Marc-André Lureau" <marcandre.lureau@redhat.com>, Paolo Bonzini <pbonzini@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/test-qemu-opts.c     |  1 +
ui/spice-core.c            |  1 +
util/qemu-option.c         | 55 +++++++++++++++++++++-----------------
6 files changed, 42 insertions(+), 24 deletions(-)
[PATCH for-5.2 0/2] deprecate short-form boolean options
Posted by Paolo Bonzini 3 years, 5 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 2 in this series deprecates it for all other option
groups.  The first patch avoids emitting the warning
for the "help" option.

Paolo

Paolo Bonzini (2):
  qemu-option: move help handling to get_opt_name_value
  qemu-option: warn for short-form boolean options

 chardev/char.c             |  1 +
 docs/system/deprecated.rst |  7 +++++
 include/qemu/option.h      |  1 +
 tests/test-qemu-opts.c     |  1 +
 ui/spice-core.c            |  1 +
 util/qemu-option.c         | 55 +++++++++++++++++++++-----------------
 6 files changed, 42 insertions(+), 24 deletions(-)

-- 
2.26.2


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



Hi,

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

Type: series
Message-id: 20201105142731.623428-1-pbonzini@redhat.com
Subject: [PATCH for-5.2 0/2] 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
 - [tag update]      patchew/160455661411.3455.4177953912304752892.stgit@pasha-ThinkPad-X280 -> patchew/160455661411.3455.4177953912304752892.stgit@pasha-ThinkPad-X280
 - [tag update]      patchew/20201105134112.25119-1-kraxel@redhat.com -> patchew/20201105134112.25119-1-kraxel@redhat.com
 * [new tag]         patchew/20201105142731.623428-1-pbonzini@redhat.com -> patchew/20201105142731.623428-1-pbonzini@redhat.com
Switched to a new branch 'test'
2b03c50 qemu-option: warn for short-form boolean options
62d2bb7 qemu-option: move help handling to get_opt_name_value

=== OUTPUT BEGIN ===
1/2 Checking commit 62d2bb78d3b3 (qemu-option: move help handling to get_opt_name_value)
2/2 Checking commit 2b03c50a991d (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
#110: FILE: util/qemu-option.c:810:
+                error_report("short-form boolean option '%s%s' deprecated", prefix, *name);

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

total: 1 errors, 2 warnings, 117 lines checked

Patch 2/2 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/20201105142731.623428-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