From: Markus Armbruster <armbru@redhat.com>
To: qemu-devel@nongnu.org
Cc: marcandre.lureau@redhat.com, mdroth@linux.vnet.ibm.com
Subject: [Qemu-devel] [PATCH 00/16] qapi: Rework mapping of enum value to string
Date: Thu, 24 Aug 2017 10:45:55 +0200 [thread overview]
Message-ID: <1503564371-26090-1-git-send-email-armbru@redhat.com> (raw)
The purpose of this work is to make holes in QAPI enumerations
possible.
Why holes? Because we want to be able to suppress enumeration
constants with #if. Holes could be avoided, e.g. by letting the
compiler assign the values. Falls apart when the conditions are
target-specific, because then target-specific code would get different
values.
Why are holes a problem? The tables mapping enumeration constants to
strings use a NULL sentinel.
This is PATCH 06-13 of "[PATCH v2 00/54] qapi: add #if pre-processor
conditions to generated code" reworked for reviewability. Took a bit
of time, but it was probably less work and certainly more fun than
reviewing the old PATCH 06 and 12 (almost 300 hunks!) in sufficient
depth would have been.
* PATCH 01: New, included only so I can update qapi-code-gen.txt
sanely in PATCH 12
* PATCH 02: New, factored out of old PATCH 12 (sort of)
* PATCH 03: Old PATCH 07 rebased, superfluous initializer dropped,
commit message rewritten
* PATCH 04: New, to finish PATCH 03's cleanup job
* PATCH 05: Old PATCH 08 rebased, commit message rewritten
* PATCH 06: Old PATCH 09 rebased, assertion added, commit message
rewritten
* PATCH 07: Old PATCH 10 rebased, commit message rewritten
* PATCH 08: Old PATCH 11 rebased, qemu_opt_get() factored out, commit
message tweaked
* PATCH 09: New, factored out of old PATCH 12
* PATCH 10: New, to complete PATCH 03-09
* PATCH 11: New, to make these loops cope with holes
* PATCH 12: New, split off old PATCH 06, with macros spliced in
* PATCH 13: New, replacing parts of old PATCH 06
* PATCH 14: New, replacing parts of old PATCH 06
* PATCH 15: Old PATCH 12 basically redone
* PATCH 16: Old PATCH 13 rebased, superfluous local variable dropped,
missing check-qom-proplist.c update added
Not included: old PATCH 12's change to make output_type_enum() fail on
"hole". I think this is best done together with the patches that
punch holes, so it can be tested.
Old diffstat:
68 files changed, 425 insertions(+), 396 deletions(-)
New diffstat:
71 files changed, 410 insertions(+), 463 deletions(-)
Marc-André Lureau (7):
tpm: Clean up driver registration & lookup
hmp: Use qapi_enum_parse() in hmp_migrate_set_capability()
hmp: Use qapi_enum_parse() in hmp_migrate_set_parameter()
block: Use qemu_enum_parse() in blkdebug_debug_breakpoint()
quorum: Use qapi_enum_parse() in quorum_open()
qapi: Change data type of the FOO_lookup generated for enum FOO
qapi: drop the sentinel in enum array
Markus Armbruster (9):
qapi: Update qapi-code-gen.txt examples to match current code
qapi: Drop superfluous qapi_enum_parse() parameter max
tpm: Clean up model registration & lookup
crypto: Use qapi_enum_parse() in qcrypto_block_luks_name_lookup()
qapi: Use qapi_enum_parse() in input_type_enum()
qapi: Avoid unnecessary use of enum lookup table's sentinel
qapi: Generate FOO_str() macro for QAPI enum FOO
qapi: Mechanically convert FOO_lookup[...] to FOO_str(...)
qapi: Convert indirect uses of FOO_lookup[...] to qapi_enum_lookup()
backends/hostmem.c | 4 +-
block.c | 4 +-
block/backup.c | 2 +-
block/blkdebug.c | 27 ++---
block/file-posix.c | 20 ++--
block/file-win32.c | 5 +-
block/gluster.c | 11 +-
block/iscsi.c | 2 +-
block/nfs.c | 2 +-
block/parallels.c | 17 +--
block/qcow2.c | 15 +--
block/qed.c | 2 +-
block/quorum.c | 27 ++---
block/rbd.c | 2 +-
block/sheepdog.c | 2 +-
blockdev.c | 8 +-
blockjob.c | 6 +-
chardev/char.c | 4 +-
crypto/block-luks.c | 38 +++----
crypto/block.c | 4 +-
crypto/cipher-afalg.c | 2 +-
crypto/cipher-builtin.c | 8 +-
crypto/cipher-gcrypt.c | 4 +-
crypto/cipher-nettle.c | 8 +-
crypto/hmac-gcrypt.c | 2 +-
crypto/hmac-glib.c | 2 +-
crypto/hmac-nettle.c | 2 +-
crypto/pbkdf-gcrypt.c | 2 +-
crypto/pbkdf-nettle.c | 2 +-
crypto/secret.c | 2 +-
crypto/tlscreds.c | 2 +-
docs/devel/qapi-code-gen.txt | 50 ++++++--
hmp.c | 220 ++++++++++++++++++------------------
hw/block/fdc.c | 6 +-
hw/char/escc.c | 2 +-
hw/core/qdev-properties.c | 17 +--
hw/input/virtio-input-hid.c | 4 +-
include/hw/qdev-core.h | 2 +-
include/qapi/util.h | 10 +-
include/qapi/visitor.h | 2 +-
include/qom/object.h | 4 +-
include/sysemu/tpm_backend.h | 4 +-
migration/colo-failover.c | 4 +-
migration/colo.c | 14 +--
migration/global_state.c | 6 +-
migration/migration.c | 1 -
monitor.c | 20 ++--
net/filter.c | 2 +-
net/net.c | 4 +-
qapi/qapi-util.c | 16 ++-
qapi/qapi-visit-core.c | 34 +++---
qapi/qmp-dispatch.c | 2 +-
qemu-img.c | 6 +-
qemu-nbd.c | 4 +-
qom/object.c | 16 +--
scripts/qapi-event.py | 1 +
scripts/qapi-types.py | 4 +
scripts/qapi-visit.py | 2 +-
scripts/qapi.py | 16 ++-
tests/check-qom-proplist.c | 14 ++-
tests/test-qapi-util.c | 18 +--
tests/test-qobject-input-visitor.c | 8 +-
tests/test-qobject-output-visitor.c | 2 +-
tests/test-string-input-visitor.c | 4 +-
tests/test-string-output-visitor.c | 4 +-
tpm.c | 81 +++----------
ui/input-legacy.c | 6 +-
ui/input.c | 12 +-
ui/vnc.c | 6 +-
util/keyval.c | 1 -
vl.c | 6 +-
71 files changed, 410 insertions(+), 463 deletions(-)
--
2.7.5
next reply other threads:[~2017-08-24 8:46 UTC|newest]
Thread overview: 37+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-08-24 8:45 Markus Armbruster [this message]
2017-08-24 8:45 ` [Qemu-devel] [PATCH 01/16] qapi: Update qapi-code-gen.txt examples to match current code Markus Armbruster
2017-08-24 10:43 ` Marc-André Lureau
2017-08-24 16:32 ` Eric Blake
2017-08-24 18:29 ` Markus Armbruster
2017-08-24 8:45 ` [Qemu-devel] [PATCH 02/16] qapi: Drop superfluous qapi_enum_parse() parameter max Markus Armbruster
2017-08-24 10:45 ` Marc-André Lureau
2017-08-24 16:38 ` Eric Blake
2017-08-24 18:35 ` Markus Armbruster
2017-08-24 18:56 ` Eric Blake
2017-08-24 19:24 ` Markus Armbruster
2017-08-24 8:45 ` [Qemu-devel] [PATCH 03/16] tpm: Clean up driver registration & lookup Markus Armbruster
2017-08-24 8:45 ` [Qemu-devel] [PATCH 04/16] tpm: Clean up model " Markus Armbruster
2017-08-24 10:50 ` Marc-André Lureau
2017-08-24 18:35 ` Markus Armbruster
2017-08-24 8:46 ` [Qemu-devel] [PATCH 05/16] hmp: Use qapi_enum_parse() in hmp_migrate_set_capability() Markus Armbruster
2017-08-24 8:46 ` [Qemu-devel] [PATCH 06/16] hmp: Use qapi_enum_parse() in hmp_migrate_set_parameter() Markus Armbruster
2017-08-24 8:46 ` [Qemu-devel] [PATCH 07/16] block: Use qemu_enum_parse() in blkdebug_debug_breakpoint() Markus Armbruster
2017-08-24 8:46 ` [Qemu-devel] [PATCH 08/16] quorum: Use qapi_enum_parse() in quorum_open() Markus Armbruster
2017-08-24 8:46 ` [Qemu-devel] [PATCH 09/16] crypto: Use qapi_enum_parse() in qcrypto_block_luks_name_lookup() Markus Armbruster
2017-08-24 10:53 ` Marc-André Lureau
2017-08-29 11:10 ` Daniel P. Berrange
2017-08-24 8:46 ` [Qemu-devel] [PATCH 10/16] qapi: Use qapi_enum_parse() in input_type_enum() Markus Armbruster
2017-08-24 11:30 ` Marc-André Lureau
2017-08-24 8:46 ` [Qemu-devel] [PATCH 11/16] qapi: Avoid unnecessary use of enum lookup table's sentinel Markus Armbruster
2017-08-24 11:34 ` Marc-André Lureau
2017-08-24 8:46 ` [Qemu-devel] [PATCH 12/16] qapi: Generate FOO_str() macro for QAPI enum FOO Markus Armbruster
2017-08-30 13:42 ` Marc-André Lureau
2017-08-24 8:46 ` [Qemu-devel] [PATCH 13/16] qapi: Mechanically convert FOO_lookup[...] to FOO_str(...) Markus Armbruster
2017-08-24 11:52 ` Marc-André Lureau
2017-08-24 8:46 ` [Qemu-devel] [PATCH 14/16] qapi: Convert indirect uses of FOO_lookup[...] to qapi_enum_lookup() Markus Armbruster
2017-08-24 12:02 ` Marc-André Lureau
2017-08-24 8:46 ` [Qemu-devel] [PATCH 15/16] qapi: Change data type of the FOO_lookup generated for enum FOO Markus Armbruster
2017-08-24 9:55 ` Markus Armbruster
2017-08-24 8:46 ` [Qemu-devel] [PATCH 16/16] qapi: drop the sentinel in enum array Markus Armbruster
2017-08-24 9:22 ` [Qemu-devel] [PATCH 00/16] qapi: Rework mapping of enum value to string no-reply
2017-09-01 12:43 ` Markus Armbruster
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1503564371-26090-1-git-send-email-armbru@redhat.com \
--to=armbru@redhat.com \
--cc=marcandre.lureau@redhat.com \
--cc=mdroth@linux.vnet.ibm.com \
--cc=qemu-devel@nongnu.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).