Skip to content

qapi: Reduce use of 'prefix'

Markus Armbruster kvm qemu-arm qemu-devel 2 versions – In review

Get series with b4
b4 am [email protected]

Versions newest first · linked by author and title

  1. v2 Latest19 patches 7 repliesIn review
  2. v118 patches 28 repliesSuperseded

Changes in v2 from the cover letter

* PATCH 01: Fix camel_to_upper() to avoid '__' and leading '_'.
* PATCH 01+07: Actually add a 'prefix' to HmatLBMemoryHierarchy in PATCH 01, as the commit message advertizes. Remove it in PATCH 07, and adjust the commit message.
* PATCH 09: Keep pragma documentation-exceptions sorted.
* PATCH 04+09+18: Fix commit message typos.
* PATCH 19: New.

Patches in v2 No applies recorded yet

#Subject and filesSizeRepliesApplied
1/19qapi: Smarter camel_to_upper() to reduce need for 'prefix'qapi/block-core.json qapi/common.json qapi/crypto.json +16 more+38 -334 replies
2/19tests/qapi-schema: Drop temporary 'prefix'tests/qapi-schema/qapi-schema-test.json tests/qapi-schema/qapi-schema-test.out tests/unit/test-qobject-input-visitor.c +1 more+4 -60 replies
3/19qapi/block-core: Drop temporary 'prefix'block.c qapi/block-core.json+3 -42 replies
4/19qapi/common: Drop temporary 'prefix'hw/vfio/pci.c qapi/common.json+5 -60 replies
5/19qapi/crypto: Drop temporary 'prefix'block/crypto.c block/qcow.c block/qcow2.c +4 more+22 -240 replies
6/19qapi/ebpf: Drop temporary 'prefix'ebpf/ebpf_rss.c qapi/ebpf.json+1 -20 replies
7/19qapi/machine: Drop temporary 'prefix'hw/core/numa.c hw/pci-bridge/cxl_upstream.c qapi/machine.json+4 -60 replies
8/19qapi/ui: Drop temporary 'prefix'qapi/ui.json system/vl.c ui/dbus.c +7 more+21 -220 replies
9/19qapi/machine: Rename CpuS390* to S390Cpu*, and drop 'prefix'hw/core/qdev-properties-system.c hw/s390x/cpu-topology.c include/hw/qdev-properties-system.h +6 more+23 -260 replies
10/19qapi/crypto: Drop unwanted 'prefix'backends/cryptodev-builtin.c backends/cryptodev-lkcf.c crypto/akcipher-gcrypt.c.inc +6 more+32 -330 replies
11/19qapi/crypto: Rename QCryptoHashAlgorithm to *Algo, and drop prefixbackends/cryptodev-builtin.c backends/cryptodev-lkcf.c block/parallels-ext.c +49 more+350 -3510 replies
12/19qapi/crypto: Rename QCryptoCipherAlgorithm to *Algo, and drop prefixbackends/cryptodev-builtin.c block/rbd.c crypto/block-luks.c +23 more+277 -2780 replies
13/19qapi/crypto: Rename QCryptoIVGenAlgorithm to *Algo, and drop prefixcrypto/block-luks.c crypto/block-qcow.c crypto/ivgen.c +5 more+44 -450 replies
14/19qapi/crypto: Rename QCryptoAkCipherAlgorithm to *Algo, and drop prefixbackends/cryptodev-builtin.c backends/cryptodev-lkcf.c crypto/akcipher-gcrypt.c.inc +6 more+19 -200 replies
15/19qapi/crypto: Rename QCryptoRSAPaddingAlgorithm to *Algo, and drop prefixbackends/cryptodev-builtin.c backends/cryptodev-lkcf.c crypto/akcipher-gcrypt.c.inc +4 more+41 -420 replies
16/19qapi/crypto: Rename QCryptoAFAlg to QCryptoAFAlgocrypto/afalg.c crypto/afalgpriv.h crypto/cipher-afalg.c +2 more+25 -250 replies
17/19qapi/cryptodev: Drop unwanted 'prefix'backends/cryptodev-builtin.c backends/cryptodev-lkcf.c backends/cryptodev-vhost-user.c +3 more+16 -170 replies
18/19qapi/cryptodev: Rename QCryptodevBackendAlgType to *Algo, and drop prefixbackends/cryptodev-builtin.c backends/cryptodev-lkcf.c backends/cryptodev.c +3 more+18 -190 replies
19/19qapi/vfio: Rename VfioMigrationState to Qapi*, and drop prefixhw/vfio/migration.c qapi/vfio.json+5 -61 reply

Reviews trailers per patch

17 of 19 patches have a Reviewed-by or Acked-by.

PatchDaniel P. BerrangéZhao LiuThomas HuthCédric Le GoaterVladimir Sementsov-Ogievskiy
1/19R-b
2/19R-b
3/19R-b
4/19R-b
5/19A-b
6/19
7/19R-b
8/19
9/19R-b R-b A-b
10/19A-b
11/19A-b
12/19A-b
13/19A-b
14/19A-b
15/19A-b
16/19A-b
17/19R-b
18/19R-b
19/19R-b

Trailers given in replies are filled; those carried in the patches from earlier versions are outlined with dashes. Scroll the table sideways for all 5 reviewers.

Read the v2 thread

Cover letter [PATCH v2 00/19] qapi: Reduce use of 'prefix'

QAPI's 'prefix' feature can make the connection between enumeration type and its constants less than obvious. It's best used with restraint.

We use 'prefix' for a number of reasons:

* To override an ugly default.

* To shorten the prefix.

* To work around name clashes.

This series attacks the first two. It additionally improves a number of ugly prefixes we don't override.

PATCH 01 improves the default prefix, and drops 'prefix' where it is now redundant. The patch adds temporary 'prefix' to not change generated code.

PATCH 02-08 revert the temporary 'prefix'.

PATCH 10,17 drop 'prefix' where the default is now better.

PATCH 09,11-15,18,19 rename QAPI types, and drop their 'prefix'. I'm prepared to adjust the renames according to maintainers' preference.

PATCH 16 renames a non-QAPI type for consistency.

v2:
* PATCH 01: Fix camel_to_upper() to avoid '__' and leading '_'.
* PATCH 01+07: Actually add a 'prefix' to HmatLBMemoryHierarchy in PATCH 01, as the commit message advertizes. Remove it in PATCH 07, and adjust the commit message.
* PATCH 09: Keep pragma documentation-exceptions sorted.
* PATCH 04+09+18: Fix commit message typos.
* PATCH 19: New.

Markus Armbruster (19):
qapi: Smarter camel_to_upper() to reduce need for 'prefix' tests/qapi-schema: Drop temporary 'prefix' qapi/block-core: Drop temporary 'prefix'
qapi/common: Drop temporary 'prefix'
qapi/crypto: Drop temporary 'prefix'
qapi/ebpf: Drop temporary 'prefix'
qapi/machine: Drop temporary 'prefix'
qapi/ui: Drop temporary 'prefix'
qapi/machine: Rename CpuS390* to S390Cpu*, and drop 'prefix' qapi/crypto: Drop unwanted 'prefix'
qapi/crypto: Rename QCryptoHashAlgorithm to *Algo, and drop prefix qapi/crypto: Rename QCryptoCipherAlgorithm to *Algo, and drop prefix qapi/crypto: Rename QCryptoIVGenAlgorithm to *Algo, and drop prefix qapi/crypto: Rename QCryptoAkCipherAlgorithm to *Algo, and drop prefix qapi/crypto: Rename QCryptoRSAPaddingAlgorithm to *Algo, and drop
prefix
qapi/crypto: Rename QCryptoAFAlg to QCryptoAFAlgo qapi/cryptodev: Drop unwanted 'prefix'
qapi/cryptodev: Rename QCryptodevBackendAlgType to *Algo, and drop
prefix
qapi/vfio: Rename VfioMigrationState to Qapi*, and drop prefix

 qapi/block-core.json                     |   4 +-
 qapi/crypto.json                         |  56 ++++------
 qapi/cryptodev.json                      |   7 +-
 qapi/machine-common.json                 |   5 +-
 qapi/machine-target.json                 |  11 +-
 qapi/machine.json                        |   9 +-
 qapi/migration.json                      |   1 +
 qapi/pragma.json                         |   6 +-
 qapi/ui.json                             |   1 +
 qapi/vfio.json                           |   9 +-
 crypto/afalgpriv.h                       |  14 +--
 crypto/akcipherpriv.h                    |   2 +-
 crypto/blockpriv.h                       |   6 +-
 crypto/cipherpriv.h                      |   2 +-
 crypto/hashpriv.h                        |   2 +-
 crypto/hmacpriv.h                        |   4 +-
 crypto/ivgenpriv.h                       |   6 +-
 include/crypto/afsplit.h                 |   8 +-
 include/crypto/block.h                   |   2 +-
 include/crypto/cipher.h                  |  18 ++--
 include/crypto/hash.h                    |  18 ++--
 include/crypto/hmac.h                    |   6 +-
 include/crypto/ivgen.h                   |  30 +++---
 include/crypto/pbkdf.h                   |  14 +--
 include/hw/qdev-properties-system.h      |   2 +-
 include/hw/s390x/cpu-topology.h          |   2 +-
 include/sysemu/cryptodev.h               |   2 +-
 target/s390x/cpu.h                       |   2 +-
 backends/cryptodev-builtin.c             |  52 ++++-----
 backends/cryptodev-lkcf.c                |  36 +++----
 backends/cryptodev-vhost-user.c          |   6 +-
 backends/cryptodev.c                     |  12 +--
 block.c                                  |   6 +-
 block/crypto.c                           |  10 +-
 block/parallels-ext.c                    |   2 +-
 block/qcow.c                             |   2 +-
 block/qcow2.c                            |  10 +-
 block/quorum.c                           |   4 +-
 block/rbd.c                              |   4 +-
 crypto/afalg.c                           |   8 +-
 crypto/afsplit.c                         |   6 +-
 crypto/akcipher.c                        |   2 +-
 crypto/block-luks.c                      | 128 +++++++++++------------
 crypto/block-qcow.c                      |   6 +-
 crypto/block.c                           |   8 +-
 crypto/cipher-afalg.c                    |  36 +++----
 crypto/cipher.c                          |  72 ++++++-------
 crypto/hash-afalg.c                      |  40 +++----
 crypto/hash-gcrypt.c                     |  20 ++--
 crypto/hash-glib.c                       |  20 ++--
 crypto/hash-gnutls.c                     |  20 ++--
 crypto/hash-nettle.c                     |  18 ++--
 crypto/hash.c                            |  30 +++---
 crypto/hmac-gcrypt.c                     |  22 ++--
 crypto/hmac-glib.c                       |  22 ++--
 crypto/hmac-gnutls.c                     |  22 ++--
 crypto/hmac-nettle.c                     |  22 ++--
 crypto/hmac.c                            |   2 +-
 crypto/ivgen.c                           |  18 ++--
 crypto/pbkdf-gcrypt.c                    |  36 +++----
 crypto/pbkdf-gnutls.c                    |  36 +++----
 crypto/pbkdf-nettle.c                    |  32 +++---
 crypto/pbkdf-stub.c                      |   4 +-
 crypto/pbkdf.c                           |   2 +-
 crypto/secret_common.c                   |   2 +-
 ebpf/ebpf_rss.c                          |   2 +-
 hw/core/numa.c                           |   4 +-
 hw/core/qdev-properties-system.c         |   6 +-
 hw/misc/aspeed_hace.c                    |  16 +--
 hw/pci-bridge/cxl_upstream.c             |   4 +-
 hw/s390x/cpu-topology.c                  |   6 +-
 hw/vfio/migration.c                      |   2 +-
 hw/vfio/pci.c                            |  10 +-
 hw/virtio/virtio-crypto.c                |  24 ++---
 io/channel-websock.c                     |   2 +-
 system/vl.c                              |   2 +-
 target/i386/sev.c                        |   6 +-
 tests/bench/benchmark-crypto-akcipher.c  |  28 ++---
 tests/bench/benchmark-crypto-cipher.c    |  22 ++--
 tests/bench/benchmark-crypto-hash.c      |  10 +-
 tests/bench/benchmark-crypto-hmac.c      |   6 +-
 tests/unit/test-crypto-afsplit.c         |  10 +-
 tests/unit/test-crypto-akcipher.c        |  54 +++++-----
 tests/unit/test-crypto-block.c           |  58 +++++-----
 tests/unit/test-crypto-cipher.c          |  66 ++++++------
 tests/unit/test-crypto-hash.c            |  42 ++++----
 tests/unit/test-crypto-hmac.c            |  16 +--
 tests/unit/test-crypto-ivgen.c           |  38 +++----
 tests/unit/test-crypto-pbkdf.c           |  44 ++++----
 tests/unit/test-qobject-input-visitor.c  |   4 +-
 tests/unit/test-qobject-output-visitor.c |   4 +-
 ui/dbus.c                                |   8 +-
 ui/egl-context.c                         |   2 +-
 ui/egl-headless.c                        |   2 +-
 ui/egl-helpers.c                         |  12 +--
 ui/gtk.c                                 |   4 +-
 ui/sdl2-gl.c                             |   8 +-
 ui/sdl2.c                                |   2 +-
 ui/spice-core.c                          |   2 +-
 ui/vnc.c                                 |   6 +-
 util/hbitmap.c                           |   2 +-
 crypto/akcipher-gcrypt.c.inc             |  44 ++++----
 crypto/akcipher-nettle.c.inc             |  56 +++++-----
 crypto/cipher-builtin.c.inc              |  18 ++--
 crypto/cipher-gcrypt.c.inc               |  56 +++++-----
 crypto/cipher-gnutls.c.inc               |  38 +++----
 crypto/cipher-nettle.c.inc               |  58 +++++-----
 crypto/rsakey-builtin.c.inc              |   4 +-
 crypto/rsakey-nettle.c.inc               |   4 +-
 scripts/qapi/common.py                   |  42 ++++----
 scripts/qapi/schema.py                   |   2 +-
 tests/qapi-schema/alternate-array.out    |   1 -
 tests/qapi-schema/comments.out           |   1 -
 tests/qapi-schema/doc-good.out           |   1 -
 tests/qapi-schema/empty.out              |   1 -
 tests/qapi-schema/include-repetition.out |   1 -
 tests/qapi-schema/include-simple.out     |   1 -
 tests/qapi-schema/indented-expr.out      |   1 -
 tests/qapi-schema/qapi-schema-test.out   |   1 -
 119 files changed, 937 insertions(+), 954 deletions(-)
Signature · 1 line
2.46.0