qemu-commits
[Top][All Lists]
Advanced

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

[Qemu-commits] [qemu/qemu] fec333: keyval: Fix and clarify grammar


From: Peter Maydell
Subject: [Qemu-commits] [qemu/qemu] fec333: keyval: Fix and clarify grammar
Date: Fri, 16 Oct 2020 13:23:05 -0700

  Branch: refs/heads/master
  Home:   https://github.com/qemu/qemu
  Commit: fec3331894a8a433d1a58ec2c929743bbf449cb1
      
https://github.com/qemu/qemu/commit/fec3331894a8a433d1a58ec2c929743bbf449cb1
  Author: Markus Armbruster <armbru@redhat.com>
  Date:   2020-10-15 (Thu, 15 Oct 2020)

  Changed paths:
    M util/keyval.c

  Log Message:
  -----------
  keyval: Fix and clarify grammar

The grammar has a few issues:

* key-fragment = / [^=,.]* /

  Prose restricts key fragments: they "must be valid QAPI names or
  consist only of decimal digits".  Technically, '' consists only of
  decimal digits.  The code rejects that.  Fix the grammar.

* val          = { / [^,]* / | ',,' }

  Use + instead of *.  Accepts the same language.

* val-no-key   = / [^=,]* /

  The code rejects an empty value.  Fix the grammar.

* Section "Additional syntax for use with an implied key" is
  confusing.  Rewrite it.

Signed-off-by: Markus Armbruster <armbru@redhat.com>
Message-Id: <20201011073505.1185335-2-armbru@redhat.com>
Reviewed-by: Eric Blake <eblake@redhat.com>
Signed-off-by: Kevin Wolf <kwolf@redhat.com>


  Commit: ce40cbf11d215dc3f820bf32937f7e44aab4a1e3
      
https://github.com/qemu/qemu/commit/ce40cbf11d215dc3f820bf32937f7e44aab4a1e3
  Author: Markus Armbruster <armbru@redhat.com>
  Date:   2020-10-15 (Thu, 15 Oct 2020)

  Changed paths:
    M tests/test-keyval.c

  Log Message:
  -----------
  test-keyval: Demonstrate misparse of ',' with implied key

Add a test for "val,,ue" with implied key.  Documentation says this
should parse as implied key with value "val", then fail.  The code
parses it as implied key with value "val,ue", then succeeds.  The next
commit will fix it.

Signed-off-by: Markus Armbruster <armbru@redhat.com>
Message-Id: <20201011073505.1185335-3-armbru@redhat.com>
Reviewed-by: Eric Blake <eblake@redhat.com>
Signed-off-by: Kevin Wolf <kwolf@redhat.com>


  Commit: 7051ae6cf1ec1072d2cdaa978660b22245a1efad
      
https://github.com/qemu/qemu/commit/7051ae6cf1ec1072d2cdaa978660b22245a1efad
  Author: Markus Armbruster <armbru@redhat.com>
  Date:   2020-10-15 (Thu, 15 Oct 2020)

  Changed paths:
    M tests/test-keyval.c
    M util/keyval.c

  Log Message:
  -----------
  keyval: Fix parsing of ',' in value of implied key

The previous commit demonstrated documentation and code disagree on
parsing of ',' in the value of an implied key.  Fix the code to match
the documentation.

This breaks uses of keyval_parse() that pass an implied key and accept
a value containing ','.  None of the existing uses does:

* audiodev: implied key "driver" is enum AudiodevDriver, none of the
  values contains ','

* display: implied key "type" is enum DisplayType, none of the values
  contains ','

* blockdev: implied key "driver is enum BlockdevDriver, none of the
  values contains ','

* export: implied key "type" is enum BlockExportType, none of the
  values contains ','

* monitor: implied key "mode" is enum MonitorMode, none of the values
  contains ','

* nbd-server: no implied key.

Signed-off-by: Markus Armbruster <armbru@redhat.com>
Message-Id: <20201011073505.1185335-4-armbru@redhat.com>
Reviewed-by: Eric Blake <eblake@redhat.com>
Signed-off-by: Kevin Wolf <kwolf@redhat.com>


  Commit: 8bf12c4f752b439eb37e3de8a063af32e986c730
      
https://github.com/qemu/qemu/commit/8bf12c4f752b439eb37e3de8a063af32e986c730
  Author: Kevin Wolf <kwolf@redhat.com>
  Date:   2020-10-15 (Thu, 15 Oct 2020)

  Changed paths:
    M include/qemu/help_option.h
    M include/qemu/option.h
    M qapi/qobject-input-visitor.c
    M storage-daemon/qemu-storage-daemon.c
    M tests/test-keyval.c
    M util/keyval.c

  Log Message:
  -----------
  keyval: Parse help options

This adds a special meaning for 'help' and '?' as options to the keyval
parser. Instead of being an error (because of a missing value) or a
value for an implied key, they now request help, which is a new boolean
output of the parser in addition to the QDict.

A new parameter 'p_help' is added to keyval_parse() that contains on
return whether help was requested. If NULL is passed, requesting help
results in an error and all other cases work like before.

Turning previous error cases into help is a compatible extension. The
behaviour potentially changes for implied keys: They could previously
get 'help' as their value, which is now interpreted as requesting help.

This is not a problem in practice because 'help' and '?' are not a valid
values for the implied key of any option parsed with keyval_parse():

* audiodev: union Audiodev, implied key "driver" is enum AudiodevDriver,
  "help" and "?" are not among its values

* display: union DisplayOptions, implied key "type" is enum
  DisplayType, "help" and "?" are not among its values

* blockdev: union BlockdevOptions, implied key "driver is enum
  BlockdevDriver, "help" and "?" are not among its values

* export: union BlockExport, implied key "type" is enum BlockExportType,
  "help" and "?" are not among its values

* monitor: struct MonitorOptions, implied key "mode" is enum MonitorMode,
  "help" and "?" are not among its values

* nbd-server: struct NbdServerOptions, no implied key.

Signed-off-by: Kevin Wolf <kwolf@redhat.com>
Signed-off-by: Markus Armbruster <armbru@redhat.com>
Message-Id: <20201011073505.1185335-5-armbru@redhat.com>
Reviewed-by: Eric Blake <eblake@redhat.com>
Signed-off-by: Kevin Wolf <kwolf@redhat.com>


  Commit: 0e301d44271b370ed0d46c2e85c2a5bda041c57c
      
https://github.com/qemu/qemu/commit/0e301d44271b370ed0d46c2e85c2a5bda041c57c
  Author: Kevin Wolf <kwolf@redhat.com>
  Date:   2020-10-15 (Thu, 15 Oct 2020)

  Changed paths:
    M qom/object_interfaces.c

  Log Message:
  -----------
  qom: Factor out helpers from user_creatable_print_help()

This creates separate helper functions for printing a list of user
creatable object types and for printing a list of properties of a given
type. This will allow using these parts without having a QemuOpts.

Signed-off-by: Kevin Wolf <kwolf@redhat.com>
Reviewed-by: Eric Blake <eblake@redhat.com>
Reviewed-by: Markus Armbruster <armbru@redhat.com>
Message-Id: <20201007164903.282198-3-kwolf@redhat.com>
Signed-off-by: Kevin Wolf <kwolf@redhat.com>


  Commit: c9ac1458430e4794adc8f0418d263befc3917886
      
https://github.com/qemu/qemu/commit/c9ac1458430e4794adc8f0418d263befc3917886
  Author: Kevin Wolf <kwolf@redhat.com>
  Date:   2020-10-15 (Thu, 15 Oct 2020)

  Changed paths:
    M include/qom/object_interfaces.h
    M qom/object_interfaces.c

  Log Message:
  -----------
  qom: Add user_creatable_print_help_from_qdict()

This adds a function that, given a QDict of non-help options, prints
help for user creatable objects.

Signed-off-by: Kevin Wolf <kwolf@redhat.com>
Reviewed-by: Eric Blake <eblake@redhat.com>
Reviewed-by: Markus Armbruster <armbru@redhat.com>
Message-Id: <20201007164903.282198-4-kwolf@redhat.com>
Signed-off-by: Kevin Wolf <kwolf@redhat.com>


  Commit: 8db1efd3f30749d471a60e56dabc131c03e73282
      
https://github.com/qemu/qemu/commit/8db1efd3f30749d471a60e56dabc131c03e73282
  Author: Kevin Wolf <kwolf@redhat.com>
  Date:   2020-10-15 (Thu, 15 Oct 2020)

  Changed paths:
    M storage-daemon/qemu-storage-daemon.c

  Log Message:
  -----------
  qemu-storage-daemon: Remove QemuOpts from --object parser

The command line parser for --object parses the input twice: Once into
QemuOpts just for detecting help options, and then again into a QDict
using the keyval parser for actually creating the object.

Now that the keyval parser can also detect help options, we can simplify
this and remove the QemuOpts part.

Signed-off-by: Kevin Wolf <kwolf@redhat.com>
Reviewed-by: Eric Blake <eblake@redhat.com>
Reviewed-by: Markus Armbruster <armbru@redhat.com>
Message-Id: <20201007164903.282198-5-kwolf@redhat.com>
Signed-off-by: Kevin Wolf <kwolf@redhat.com>


  Commit: 357bda9590784ff75803d52de43150d4107ed98e
      
https://github.com/qemu/qemu/commit/357bda9590784ff75803d52de43150d4107ed98e
  Author: Kevin Wolf <kwolf@redhat.com>
  Date:   2020-10-15 (Thu, 15 Oct 2020)

  Changed paths:
    M monitor/monitor.c

  Log Message:
  -----------
  monitor: Fix order in monitor_cleanup()

We can only destroy Monitor objects after we're sure that they are not
in use by the dispatcher coroutine any more. This fixes crashes like the
following where we tried to destroy a monitor mutex while the dispatcher
coroutine still holds it:

 (gdb) bt
 #0  0x00007fe541cf4bc5 in raise () at /lib64/libc.so.6
 #1  0x00007fe541cdd8a4 in abort () at /lib64/libc.so.6
 #2  0x000055c24e965327 in error_exit (err=16, msg=0x55c24eead3a0 <__func__.33> 
"qemu_mutex_destroy") at ../util/qemu-thread-posix.c:37
 #3  0x000055c24e9654c3 in qemu_mutex_destroy (mutex=0x55c25133e0f0) at 
../util/qemu-thread-posix.c:70
 #4  0x000055c24e7cfaf1 in monitor_data_destroy_qmp (mon=0x55c25133dfd0) at 
../monitor/qmp.c:439
 #5  0x000055c24e7d23bc in monitor_data_destroy (mon=0x55c25133dfd0) at 
../monitor/monitor.c:615
 #6  0x000055c24e7d253a in monitor_cleanup () at ../monitor/monitor.c:644
 #7  0x000055c24e6cb002 in qemu_cleanup () at ../softmmu/vl.c:4549
 #8  0x000055c24e0d259b in main (argc=24, argv=0x7ffff66b0d58, 
envp=0x7ffff66b0e20) at ../softmmu/main.c:51

Reported-by: Alex Bennée <alex.bennee@linaro.org>
Signed-off-by: Kevin Wolf <kwolf@redhat.com>
Message-Id: <20201013125027.41003-1-kwolf@redhat.com>
Tested-by: Ben Widawsky <ben.widawsky@intel.com>
Tested-by: Alex Bennée <alex.bennee@linaro.org>
Reviewed-by: Alex Bennée <alex.bennee@linaro.org>
Signed-off-by: Kevin Wolf <kwolf@redhat.com>


  Commit: 5737eea24f7377d752cdc9475e80266a7e9a5416
      
https://github.com/qemu/qemu/commit/5737eea24f7377d752cdc9475e80266a7e9a5416
  Author: Daniel P. Berrangé <berrange@redhat.com>
  Date:   2020-10-15 (Thu, 15 Oct 2020)

  Changed paths:
    M MAINTAINERS

  Log Message:
  -----------
  block: drop moderated sheepdog mailing list from MAINTAINERS file

The sheepdog mailing list is setup to stop and queue messages from
non-subscribers, pending moderator approval. Unfortunately it seems
that the moderation queue is not actively dealt with. Even when messages
are approved, the sender is never added to the whitelist, so every
future mail from the same sender continues to get stopped for moderation.

MAINTAINERS entries should be responsive and not unneccessarily block
mails from QEMU contributors, so drop the sheepdog mailing list.

Reviewed-by: Thomas Huth <thuth@redhat.com>
Reviewed-by: Vladimir Sementsov-Ogievskiy <vsementsov@virtuozzo.com>
Reviewed-by: Philippe Mathieu-Daudé <philmd@redhat.com>
Signed-off-by: Daniel P. Berrangé <berrange@redhat.com>
Message-Id: <20201002113243.2347710-2-berrange@redhat.com>
Reviewed-by: Neal Gompa <ngompa13@gmail.com>
Signed-off-by: Kevin Wolf <kwolf@redhat.com>


  Commit: e1c4269763999e3b359fff19ad170e0110d3b457
      
https://github.com/qemu/qemu/commit/e1c4269763999e3b359fff19ad170e0110d3b457
  Author: Daniel P. Berrangé <berrange@redhat.com>
  Date:   2020-10-15 (Thu, 15 Oct 2020)

  Changed paths:
    M block/sheepdog.c
    M configure
    M docs/system/deprecated.rst

  Log Message:
  -----------
  block: deprecate the sheepdog block driver

This thread from a little over a year ago:

  http://lists.wpkg.org/pipermail/sheepdog/2019-March/thread.html

states that sheepdog is no longer actively developed. The only mentioned
users are some companies who are said to have it for legacy reasons with
plans to replace it by Ceph. There is talk about cutting out existing
features to turn it into a simple demo of how to write a distributed
block service. There is no evidence of anyone working on that idea:

  https://github.com/sheepdog/sheepdog/commits/master

No real commits to git since Jan 2018, and before then just some minor
technical debt cleanup.

There is essentially no activity on the mailing list aside from
patches to QEMU that get CC'd due to our MAINTAINERS entry.

Fedora packages for sheepdog failed to build from upstream source
because of the more strict linker that no longer merges duplicate
global symbols. Fedora patches it to add the missing "extern"
annotations and presumably other distros do to, but upstream source
remains broken.

There is only basic compile testing, no functional testing of the
driver.

Since there are no build pre-requisites the sheepdog driver is currently
enabled unconditionally. This would result in configure issuing a
deprecation warning by default for all users. Thus the configure default
is changed to disable it, requiring users to pass --enable-sheepdog to
build the driver.

Reviewed-by: Markus Armbruster <armbru@redhat.com>
Reviewed-by: Thomas Huth <thuth@redhat.com>
Reviewed-by: Vladimir Sementsov-Ogievskiy <vsementsov@virtuozzo.com>
Reviewed-by: Philippe Mathieu-Daudé <philmd@redhat.com>
Signed-off-by: Daniel P. Berrangé <berrange@redhat.com>
Message-Id: <20201002113243.2347710-3-berrange@redhat.com>
Reviewed-by: Neal Gompa <ngompa13@gmail.com>
Signed-off-by: Kevin Wolf <kwolf@redhat.com>


  Commit: 7daf8f8d011cdd5d3e86930ed2bde969425c790c
      
https://github.com/qemu/qemu/commit/7daf8f8d011cdd5d3e86930ed2bde969425c790c
  Author: Peter Maydell <peter.maydell@linaro.org>
  Date:   2020-10-16 (Fri, 16 Oct 2020)

  Changed paths:
    M MAINTAINERS
    M block/sheepdog.c
    M configure
    M docs/system/deprecated.rst
    M include/qemu/help_option.h
    M include/qemu/option.h
    M include/qom/object_interfaces.h
    M monitor/monitor.c
    M qapi/qobject-input-visitor.c
    M qom/object_interfaces.c
    M storage-daemon/qemu-storage-daemon.c
    M tests/test-keyval.c
    M util/keyval.c

  Log Message:
  -----------
  Merge remote-tracking branch 'remotes/kevin/tags/for-upstream' into staging

Block layer patches:

- qemu-storage-daemon: Remove QemuOpts from --object parser
- monitor: Fix order in monitor_cleanup()
- Deprecate the sheepdog block driver

# gpg: Signature made Thu 15 Oct 2020 15:48:10 BST
# gpg:                using RSA key DC3DEB159A9AF95D3D7456FE7F09B272C88F2FD6
# gpg:                issuer "kwolf@redhat.com"
# gpg: Good signature from "Kevin Wolf <kwolf@redhat.com>" [full]
# Primary key fingerprint: DC3D EB15 9A9A F95D 3D74  56FE 7F09 B272 C88F 2FD6

* remotes/kevin/tags/for-upstream:
  block: deprecate the sheepdog block driver
  block: drop moderated sheepdog mailing list from MAINTAINERS file
  monitor: Fix order in monitor_cleanup()
  qemu-storage-daemon: Remove QemuOpts from --object parser
  qom: Add user_creatable_print_help_from_qdict()
  qom: Factor out helpers from user_creatable_print_help()
  keyval: Parse help options
  keyval: Fix parsing of ',' in value of implied key
  test-keyval: Demonstrate misparse of ',' with implied key
  keyval: Fix and clarify grammar

Signed-off-by: Peter Maydell <peter.maydell@linaro.org>


Compare: https://github.com/qemu/qemu/compare/6214addcc6b6...7daf8f8d011c



reply via email to

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