qemu-e2k/qapi
Kevin Wolf 8bf12c4f75 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>
2020-10-15 16:06:27 +02:00
..
acpi.json qapi: Extract ACPI commands to 'acpi.json' 2020-09-29 15:41:36 +02:00
audio.json qapi: Fix indentation, again 2020-09-07 17:13:19 +02:00
authz.json schemas: Add vim modeline 2020-08-03 08:28:08 +02:00
block-core.json block: Convert 'block_resize' to coroutine 2020-10-09 07:08:20 +02:00
block-export.json nbd: Deprecate nbd-server-add/remove 2020-10-02 15:46:40 +02:00
block.json qapi/block.json: Add newline after "Example:" for block-latency-histogram-set 2020-09-29 17:55:39 +02:00
char.json qapi: Document event VSERPORT_CHANGE is rate-limited 2020-09-03 09:58:26 +02:00
common.json schemas: Add vim modeline 2020-08-03 08:28:08 +02:00
control.json qapi: Fix indentation, again 2020-09-07 17:13:19 +02:00
crypto.json qapi/: fix some comment spelling errors 2020-09-17 20:41:08 +02:00
dump.json schemas: Add vim modeline 2020-08-03 08:28:08 +02:00
error.json schemas: Add vim modeline 2020-08-03 08:28:08 +02:00
introspect.json schemas: Add vim modeline 2020-08-03 08:28:08 +02:00
job.json schemas: Add vim modeline 2020-08-03 08:28:08 +02:00
machine-target.json schemas: Add vim modeline 2020-08-03 08:28:08 +02:00
machine.json qapi/machine.json: Escape a literal '*' in doc comment 2020-09-29 17:55:39 +02:00
meson.build qapi: introduce replay.json for record/replay-related stuff 2020-10-06 08:34:49 +02:00
migration.json migration/dirtyrate: present dirty rate only when querying the rate has completed 2020-10-12 12:39:38 +01:00
misc-target.json schemas: Add vim modeline 2020-08-03 08:28:08 +02:00
misc.json qapi: introduce replay.json for record/replay-related stuff 2020-10-06 08:34:49 +02:00
net.json qapi: Fix indentation, again 2020-09-07 17:13:19 +02:00
opts-visitor.c qapi: Make visitor functions taking Error ** return bool, not void 2020-07-10 15:18:08 +02:00
pci.json qapi: Extract PCI commands to 'pci.json' 2020-09-29 15:41:36 +02:00
pragma.json qapi: Create 'pragma' module 2020-03-06 17:21:28 +01:00
qapi-clone-visitor.c qapi: Make visitor functions taking Error ** return bool, not void 2020-07-10 15:18:08 +02:00
qapi-dealloc-visitor.c qapi: Make visitor functions taking Error ** return bool, not void 2020-07-10 15:18:08 +02:00
qapi-schema.json qapi: introduce replay.json for record/replay-related stuff 2020-10-06 08:34:49 +02:00
qapi-util.c qemu-common: Move qemu_isalnum() etc. to qemu/ctype.h 2019-06-11 20:22:09 +02:00
qapi-visit-core.c qapi: Purge error_propagate() from QAPI core 2020-07-10 15:18:08 +02:00
qdev.json schemas: Add vim modeline 2020-08-03 08:28:08 +02:00
qmp-dispatch.c qmp: Move dispatcher to a coroutine 2020-10-09 07:08:20 +02:00
qmp-event.c Include qemu-common.h exactly where needed 2019-06-12 13:20:20 +02:00
qmp-registry.c qmp: Move dispatcher to a coroutine 2020-10-09 07:08:20 +02:00
qobject-input-visitor.c keyval: Parse help options 2020-10-15 16:06:27 +02:00
qobject-output-visitor.c qapi: Make visitor functions taking Error ** return bool, not void 2020-07-10 15:18:08 +02:00
qom.json schemas: Add vim modeline 2020-08-03 08:28:08 +02:00
rdma.json schemas: Add vim modeline 2020-08-03 08:28:08 +02:00
replay.json replay: implement replay-seek command 2020-10-06 08:34:49 +02:00
rocker.json schemas: Add vim modeline 2020-08-03 08:28:08 +02:00
run-state.json qapi/run-state.json: introduce memory failure event 2020-10-04 18:36:23 +02:00
sockets.json schemas: Add vim modeline 2020-08-03 08:28:08 +02:00
string-input-visitor.c error: Eliminate error_propagate() with Coccinelle, part 1 2020-07-10 15:18:08 +02:00
string-output-visitor.c qapi: Make visitor functions taking Error ** return bool, not void 2020-07-10 15:18:08 +02:00
tpm.json schemas: Add vim modeline 2020-08-03 08:28:08 +02:00
trace-events trace-events: Shorten file names in comments 2019-03-22 16:18:07 +00:00
trace.h trace: switch position of headers to what Meson requires 2020-08-21 06:18:24 -04:00
trace.json qapi: Add blank lines before bulleted lists 2020-02-15 11:41:50 +01:00
transaction.json schemas: Add vim modeline 2020-08-03 08:28:08 +02:00
ui.json schemas: Add vim modeline 2020-08-03 08:28:08 +02:00