Skip to content

Fix qapi mangling of downstream names

Eric Blake qemu-devel 3 versions – In review

Get series with b4
b4 am [email protected]

Versions newest first · linked by author and title

  1. v4 Latest16 patches 11 repliesIn review
  2. v314 patches 10 repliesApplied
  3. v24 patches 10 repliesSuperseded

Patches in v4 No applies recorded yet

#Subject and filesSizeRepliesApplied
1/16qapi: Fix C identifiers generated for names containing '.'scripts/qapi.py+5 -20 replies
2/16qapi: Rename identical c_fun()/c_var() into c_name()scripts/qapi-commands.py scripts/qapi-event.py scripts/qapi-types.py +2 more+36 -380 replies
3/16qapi: Rename _generate_enum_string() to camel_to_upper()scripts/qapi.py+6 -60 replies
4/16qapi: Rename generate_enum_full_value() to c_enum_const()scripts/qapi-event.py scripts/qapi-types.py scripts/qapi-visit.py +1 more+10 -110 replies
5/16qapi: Simplify c_enum_const()scripts/qapi.py+1 -32 replies
6/16qapi: Use c_enum_const() in generate_alternate_qtypes()scripts/qapi-types.py scripts/qapi.py+2 -150 replies
7/16qapi: Move camel_to_upper(), c_enum_const() to closely related codescripts/qapi.py+25 -250 replies
8/16qapi: Tidy c_type logicscripts/qapi.py+30 -283 replies
9/16qapi: Make c_type() consistently convert qapi namesscripts/qapi.py+29 -41 reply
10/16qapi: Support downstream enumsscripts/qapi-types.py scripts/qapi-visit.py tests/qapi-schema/qapi-schema-test.json +1 more+18 -121 reply
11/16qapi: Support downstream structsscripts/qapi-types.py scripts/qapi-visit.py tests/qapi-schema/qapi-schema-test.json +1 more+18 -90 replies
12/16qapi: Support downstream simple unionsscripts/qapi-types.py scripts/qapi-visit.py tests/qapi-schema/qapi-schema-test.json +1 more+10 -70 replies
13/16qapi: Support downstream flat unionsscripts/qapi-types.py scripts/qapi-visit.py tests/qapi-schema/qapi-schema-test.json +1 more+13 -50 replies
14/16qapi: Support downstream alternatesscripts/qapi-types.py scripts/qapi-visit.py tests/qapi-schema/qapi-schema-test.json +1 more+13 -80 replies
15/16qapi: Support downstream events and commandsscripts/qapi-commands.py tests/qapi-schema/qapi-schema-test.json tests/qapi-schema/qapi-schema-test.out +1 more+28 -120 replies
16/16qapi: Prefer '"str" + var' over '"str%s" % var'scripts/qapi-commands.py scripts/qapi-event.py scripts/qapi-types.py +3 more+51 -482 replies

Reviews trailers per patch

11 of 16 patches have a Reviewed-by or Acked-by.

PatchMarkus ArmbrusterAlberto Garcia
1/16R-b
2/16R-b
3/16
4/16
5/16R-b
6/16
7/16
8/16R-b
9/16R-b
10/16R-b
11/16R-b
12/16R-b
13/16R-b
14/16R-b
15/16R-b
16/16

Trailers given in replies are filled; those carried in the patches from earlier versions are outlined with dashes.

Read the v4 thread

Cover letter [Qemu-devel] [PATCH v4 00/16] Fix qapi mangling of downstream names

This series makes it possible to use downstream extensions (such as __com.redhat_xyz) and temporary names (such as x-foo) in every position possible in QAPI schemes, with added tests that the generated code still compiles.

There's still some things we could do to the qapi generator, such as normalizing struct member names and C manglings and creating named implicit types up front on the initial parse rather than multiple times in each backend. But that should wait until existing pending patches have landed, to minimize rebase churn.

v3 was here:
https://lists.gnu.org/archive/html/qemu-devel/2015-05/msg00519.html
[already queued in Markus tree, but not yet in a pull request, so that queue can be ruthlessly rebased]

v4 includes 2 new patches (although 14/14 is somewhat unrelated, and could easily be dropped from the series if it needs another spin without holding up the rest of the series), incorporates Markus' suggestions for more comments, and simplifies special-casing of lists of builtin types.

Here's the backport-diff stats (and note that it exposes a bug in the script, as a raw % in the subject line triggered mayhem):

001/16:[----] [--] 'qapi: Fix C identifiers generated for names containing '.'' 002/16:[----] [--] 'qapi: Rename identical c_fun()/c_var() into c_name()' 003/16:[----] [--] 'qapi: Rename _generate_enum_string() to camel_to_upper()' 004/16:[----] [--] 'qapi: Rename generate_enum_full_value() to c_enum_const()' 005/16:[----] [--] 'qapi: Simplify c_enum_const()'
006/16:[----] [--] 'qapi: Use c_enum_const() in generate_alternate_qtypes()' 007/16:[----] [--] 'qapi: Move camel_to_upper(), c_enum_const() to closely related code' 008/16:[down] 'qapi: Tidy c_type logic'
009/16:[0046] [FC] 'qapi: Make c_type() consistently convert qapi names' 010/16:[0007] [FC] 'qapi: Support downstream enums'
011/16:[----] [--] 'qapi: Support downstream structs'
012/16:[----] [--] 'qapi: Support downstream simple unions'
013/16:[----] [--] 'qapi: Support downstream flat unions'
014/16:[----] [--] 'qapi: Support downstream alternates'
015/16:[----] [--] 'qapi: Support downstream events and commands' /home/eblake/bin/git-backport-diff: line 267: printf: `v': invalid format character 016/16:[down] 'qapi: Prefer '"str" + var' over '"str"

Eric Blake (10):
qapi: Rename identical c_fun()/c_var() into c_name()
qapi: Tidy c_type logic
qapi: Make c_type() consistently convert qapi names
qapi: Support downstream enums
qapi: Support downstream structs
qapi: Support downstream simple unions
qapi: Support downstream flat unions
qapi: Support downstream alternates
qapi: Support downstream events and commands
qapi: Prefer '"str" + var' over '"str%s" % var'

Markus Armbruster (6):
qapi: Fix C identifiers generated for names containing '.'
qapi: Rename _generate_enum_string() to camel_to_upper()
qapi: Rename generate_enum_full_value() to c_enum_const()
qapi: Simplify c_enum_const()
qapi: Use c_enum_const() in generate_alternate_qtypes()
qapi: Move camel_to_upper(), c_enum_const() to closely related code

 scripts/qapi-commands.py                |  56 ++++----
 scripts/qapi-event.py                   |  15 +--
 scripts/qapi-types.py                   |  54 ++++----
 scripts/qapi-visit.py                   |  55 ++++----
 scripts/qapi.py                         | 226 +++++++++++++++++---------------
 tests/qapi-schema/include-non-file.err  |   2 +-
 tests/qapi-schema/qapi-schema-test.json |  20 +++
 tests/qapi-schema/qapi-schema-test.out  |  21 ++-
 tests/test-qmp-commands.c               |  15 +++
 9 files changed, 263 insertions(+), 201 deletions(-)
Signature · 1 line
2.1.0