[Qemu-devel] [PULL v2 00/30] QAPI patches for 2018-03-01

Eric Blake posted 30 patches 7 years, 7 months ago
Only 4 patches received!
There is a newer version of this series
docs/devel/qapi-code-gen.txt                       | 124 ++++---
docs/devel/writing-qmp-commands.txt                |  39 +--
docs/interop/qmp-intro.txt                         |   3 +-
docs/xen-save-devices-state.txt                    |   3 +-
tests/qapi-schema/doc-good.texi                    |   3 +-
configure                                          |   1 -
Makefile                                           | 233 ++++++++++----
Makefile.objs                                      |  80 ++++-
qapi-schema.json => qapi/misc.json                 | 105 +-----
qapi/qapi-schema.json                              |  95 ++++++
qapi/run-state.json                                |   9 +
include/qapi/visitor.h                             |   2 +-
scripts/qapi-gen.py                                |  57 ++++
scripts/qapi/__init__.py                           |   0
scripts/{qapi-commands.py => qapi/commands.py}     | 155 ++++-----
scripts/{qapi.py => qapi/common.py}                | 355 +++++++++++++--------
scripts/{qapi2texi.py => qapi/doc.py}              |  92 +++---
scripts/{qapi-event.py => qapi/events.py}          | 128 +++-----
scripts/{qapi-introspect.py => qapi/introspect.py} | 123 +++----
scripts/{qapi-types.py => qapi/types.py}           | 185 ++++-------
scripts/{qapi-visit.py => qapi/visit.py}           | 189 ++++-------
crypto/cipherpriv.h                                |   2 +-
include/block/block.h                              |   2 +-
include/block/dirty-bitmap.h                       |   2 +-
include/block/nbd.h                                |   2 +-
include/chardev/char.h                             |   1 +
include/crypto/cipher.h                            |   2 +-
include/crypto/hash.h                              |   2 +-
include/crypto/hmac.h                              |   2 +-
include/crypto/secret.h                            |   1 +
include/crypto/tlscreds.h                          |   1 +
include/hw/block/block.h                           |   2 +-
include/hw/block/fdc.h                             |   2 +-
include/hw/ppc/spapr_drc.h                         |   1 +
include/hw/qdev-properties.h                       |   2 +
include/io/dns-resolver.h                          |   1 +
include/migration/colo.h                           |   2 +-
include/migration/failover.h                       |   2 +-
include/migration/global_state.h                   |   1 +
include/monitor/monitor.h                          |   1 +
include/net/filter.h                               |   1 +
include/net/net.h                                  |   2 +-
include/qapi/clone-visitor.h                       |   1 -
include/qapi/error.h                               |   2 +-
include/qapi/qmp/qobject.h                         |   2 +-
include/qemu/sockets.h                             |   2 +-
include/qemu/throttle.h                            |   2 +-
include/qom/cpu.h                                  |   1 +
include/qom/object.h                               |   2 +-
include/sysemu/arch_init.h                         |   2 +-
include/sysemu/balloon.h                           |   2 +-
include/sysemu/dump.h                              |   2 +
include/sysemu/hostmem.h                           |   1 +
include/sysemu/replay.h                            |   2 +
include/sysemu/sysemu.h                            |   1 +
include/sysemu/tpm.h                               |   1 +
include/sysemu/watchdog.h                          |   2 +-
include/ui/console.h                               |   1 +
include/ui/input.h                                 |   2 +-
migration/migration.h                              |   1 +
migration/ram.h                                    |   2 +-
net/tap_int.h                                      |   2 +-
replication.h                                      |   1 +
ui/vnc.h                                           |   1 +
vl.c                                               |   8 +-
arch_init.c                                        |   2 +-
backends/cryptodev.c                               |   1 -
backends/hostmem.c                                 |   3 +-
balloon.c                                          |   2 +-
block.c                                            |   2 -
block/block-backend.c                              |   2 +-
block/crypto.c                                     |   2 +-
block/iscsi.c                                      |   2 +-
block/nbd.c                                        |   2 +-
block/nfs.c                                        |   2 +-
block/qapi.c                                       |   4 +-
block/qcow2.c                                      |   4 +-
block/quorum.c                                     |   2 +-
block/sheepdog.c                                   |   2 +-
block/ssh.c                                        |   2 +-
block/throttle-groups.c                            |   2 +-
block/write-threshold.c                            |   4 +-
blockdev-nbd.c                                     |   2 +-
blockdev.c                                         |   5 +-
blockjob.c                                         |   2 +-
chardev/char-fe.c                                  |   2 +-
chardev/char-ringbuf.c                             |   2 +-
chardev/char-socket.c                              |   1 +
chardev/char.c                                     |   4 +-
cpus.c                                             |   4 +-
dump.c                                             |   4 +-
hmp.c                                              |  12 +-
hw/acpi/core.c                                     |   4 +-
hw/acpi/cpu.c                                      |   2 +-
hw/acpi/memory_hotplug.c                           |   2 +-
hw/acpi/vmgenid.c                                  |   2 +-
hw/block/block.c                                   |   1 +
hw/block/hd-geometry.c                             |   1 +
hw/char/virtio-console.c                           |   2 +-
hw/core/machine.c                                  |   2 +-
hw/core/qdev.c                                     |   2 +-
hw/i386/pc.c                                       |   2 +-
hw/i386/xen/xen-hvm.c                              |   2 +-
hw/ipmi/ipmi.c                                     |   2 +-
hw/mem/nvdimm.c                                    |   1 -
hw/net/rocker/qmp-norocker.c                       |   2 +-
hw/net/rocker/rocker.c                             |   2 +-
hw/net/rocker/rocker_fp.c                          |   2 +-
hw/net/rocker/rocker_of_dpa.c                      |   2 +-
hw/net/virtio-net.c                                |   2 +-
hw/pci/pci-stub.c                                  |   2 +-
hw/pci/pci.c                                       |   2 +-
hw/ppc/spapr_rtas.c                                |   1 -
hw/ppc/spapr_rtc.c                                 |   2 +-
hw/s390x/s390-skeys.c                              |   2 +-
hw/timer/mc146818rtc.c                             |   4 +-
hw/tpm/tpm_emulator.c                              |   1 +
hw/tpm/tpm_passthrough.c                           |   1 +
hw/virtio/virtio-balloon.c                         |   2 +-
hw/watchdog/watchdog.c                             |   4 +-
io/channel-socket.c                                |   1 +
io/dns-resolver.c                                  |   1 +
iothread.c                                         |   2 +-
migration/colo-failover.c                          |   2 +-
migration/colo.c                                   |   2 +-
migration/migration.c                              |   4 +-
migration/ram.c                                    |   2 +-
migration/savevm.c                                 |   3 +-
monitor.c                                          |   8 +-
net/colo-compare.c                                 |   1 -
net/filter-buffer.c                                |   2 +-
net/filter-mirror.c                                |   1 -
net/filter-rewriter.c                              |   1 -
net/net.c                                          |   4 +-
net/vhost-user.c                                   |   2 +-
numa.c                                             |   4 +-
qdev-monitor.c                                     |   2 +-
qemu-img.c                                         |   2 +-
qga/commands-posix.c                               |   2 +-
qga/commands-win32.c                               |   2 +-
qga/commands.c                                     |   2 +-
qga/main.c                                         |   2 +-
qmp.c                                              |  18 +-
qom/object.c                                       |   2 +-
qom/object_interfaces.c                            |   2 +-
replay/replay-input.c                              |   1 +
stubs/tpm.c                                        |   3 +-
stubs/uuid.c                                       |   2 +-
stubs/vmgenid.c                                    |   2 +-
stubs/xen-hvm.c                                    |   2 +-
target/arm/monitor.c                               |   3 +-
target/i386/cpu.c                                  |   4 +-
target/s390x/cpu.c                                 |   3 +-
target/s390x/kvm.c                                 |   1 -
target/s390x/sigp.c                                |   1 +
tests/qmp-test.c                                   |   3 +-
tests/test-char.c                                  |   2 +-
tests/{test-qmp-commands.c => test-qmp-cmds.c}     |   2 +-
tests/test-qmp-event.c                             |   3 +-
tests/test-qobject-input-visitor.c                 |   8 +-
tests/test-visitor-serialization.c                 |   1 -
tpm.c                                              |   5 +-
trace/qmp.c                                        |   2 +-
ui/console.c                                       |   2 +-
ui/gtk.c                                           |   2 +-
ui/input-legacy.c                                  |   2 +-
ui/input.c                                         |   2 +-
ui/spice-core.c                                    |   4 +-
ui/vnc.c                                           |   4 +-
util/qemu-config.c                                 |   2 +-
util/qemu-sockets.c                                |   2 +-
.gitignore                                         |  80 ++++-
qga/Makefile.objs                                  |   2 +-
tests/.gitignore                                   |   9 +-
tests/Makefile.include                             |  70 ++--
tests/qapi-schema/comments.out                     |   3 +-
tests/qapi-schema/doc-bad-section.out              |   5 +-
tests/qapi-schema/doc-good.out                     |  33 +-
tests/qapi-schema/empty.out                        |   2 +-
tests/qapi-schema/event-case.out                   |   3 +-
tests/qapi-schema/ident-with-escape.out            |   7 +-
tests/qapi-schema/include-no-file.err              |   2 +-
tests/qapi-schema/include-relpath.out              |   7 +-
tests/qapi-schema/include-repetition.out           |  12 +-
tests/qapi-schema/include-simple.out               |   5 +-
tests/qapi-schema/indented-expr.out                |   3 +-
tests/qapi-schema/qapi-schema-test.out             | 321 +++++++++----------
tests/qapi-schema/test-qapi.py                     |  19 +-
ui/cocoa.m                                         |   2 +-
189 files changed, 1563 insertions(+), 1356 deletions(-)
rename qapi-schema.json => qapi/misc.json (95%)
create mode 100644 qapi/qapi-schema.json
create mode 100755 scripts/qapi-gen.py
create mode 100644 scripts/qapi/__init__.py
rename scripts/{qapi-commands.py => qapi/commands.py} (67%)
rename scripts/{qapi.py => qapi/common.py} (90%)
rename scripts/{qapi2texi.py => qapi/doc.py} (78%)
mode change 100755 => 100644
rename scripts/{qapi-event.py => qapi/events.py} (61%)
rename scripts/{qapi-introspect.py => qapi/introspect.py} (71%)
rename scripts/{qapi-types.py => qapi/types.py} (53%)
rename scripts/{qapi-visit.py => qapi/visit.py} (64%)
rename tests/{test-qmp-commands.c => test-qmp-cmds.c} (99%)
[Qemu-devel] [PULL v2 00/30] QAPI patches for 2018-03-01
Posted by Eric Blake 7 years, 7 months ago
The following changes since commit 0dc8ae5e8e693737dfe65ba02d0c6eccb58a9c67:

  Merge remote-tracking branch 'remotes/cohuck/tags/s390x-20180301-v2' into staging (2018-03-01 17:08:16 +0000)

are available in the Git repository at:

  git://repo.or.cz/qemu/ericb.git tags/pull-qapi-2018-03-01-v2

for you to fetch changes up to 76b2baeed38089c19f69c7117b8eaa64b0e7d227:

  qapi: Don't create useless directory qapi-generated (2018-03-01 19:16:40 -0600)

v2: fix rebase on top of s390x work so that build is successful
(if I do it right, I'm sending just the changed patches)

Again, this series will be a conflict magnet due to content motion
from qapi-schema.json to qapi/misc.json; hopefully, the level of
rebasing required is not too painful

----------------------------------------------------------------
qapi patches for 2018-03-01

- Markus Armbruster: Modularize generated QAPI code

----------------------------------------------------------------
Eric Blake (1):
      watchdog: Consolidate QAPI into single file

Markus Armbruster (29):
      Include qapi/qmp/qerror.h exactly where needed
      qapi: Streamline boilerplate comment generation
      qapi: Generate up-to-date copyright notice
      qapi: Rename variable holding the QAPISchemaGenFOOVisitor
      qapi: New classes QAPIGenC, QAPIGenH, QAPIGenDoc
      qapi: Reduce use of global variables in generators some
      qapi: Turn generators into modules
      qapi-gen: New common driver for code and doc generators
      qapi-gen: Convert from getopt to argparse
      qapi: Touch generated files only when they change
      qapi: Improve include file name reporting in error messages
      qapi/common: Eliminate QAPISchema.exprs
      qapi: Lift error reporting from QAPISchema.__init__() to callers
      qapi: Concentrate QAPISchemaParser.exprs updates in .__init__()
      qapi: Record 'include' directives in parse tree
      qapi: Generate in source order
      qapi: Record 'include' directives in intermediate representation
      qapi: Rename generated qmp-marshal.c to qmp-commands.c
      qapi: Make code-generating visitors use QAPIGen more
      qapi/types qapi/visit: Generate built-in stuff into separate files
      qapi/common: Fix guardname() for funny filenames
      qapi: Generate separate .h, .c for each module
      Include less of the generated modular QAPI headers
      qapi: Empty out qapi-schema.json
      docs/devel/writing-qmp-commands: Update for modular QAPI
      docs: Correct outdated information on QAPI
      qapi: Move qapi-schema.json to qapi/, rename generated files
      Fix up dangling references to qmp-commands.* in comment and doc
      qapi: Don't create useless directory qapi-generated

 docs/devel/qapi-code-gen.txt                       | 124 ++++---
 docs/devel/writing-qmp-commands.txt                |  39 +--
 docs/interop/qmp-intro.txt                         |   3 +-
 docs/xen-save-devices-state.txt                    |   3 +-
 tests/qapi-schema/doc-good.texi                    |   3 +-
 configure                                          |   1 -
 Makefile                                           | 233 ++++++++++----
 Makefile.objs                                      |  80 ++++-
 qapi-schema.json => qapi/misc.json                 | 105 +-----
 qapi/qapi-schema.json                              |  95 ++++++
 qapi/run-state.json                                |   9 +
 include/qapi/visitor.h                             |   2 +-
 scripts/qapi-gen.py                                |  57 ++++
 scripts/qapi/__init__.py                           |   0
 scripts/{qapi-commands.py => qapi/commands.py}     | 155 ++++-----
 scripts/{qapi.py => qapi/common.py}                | 355 +++++++++++++--------
 scripts/{qapi2texi.py => qapi/doc.py}              |  92 +++---
 scripts/{qapi-event.py => qapi/events.py}          | 128 +++-----
 scripts/{qapi-introspect.py => qapi/introspect.py} | 123 +++----
 scripts/{qapi-types.py => qapi/types.py}           | 185 ++++-------
 scripts/{qapi-visit.py => qapi/visit.py}           | 189 ++++-------
 crypto/cipherpriv.h                                |   2 +-
 include/block/block.h                              |   2 +-
 include/block/dirty-bitmap.h                       |   2 +-
 include/block/nbd.h                                |   2 +-
 include/chardev/char.h                             |   1 +
 include/crypto/cipher.h                            |   2 +-
 include/crypto/hash.h                              |   2 +-
 include/crypto/hmac.h                              |   2 +-
 include/crypto/secret.h                            |   1 +
 include/crypto/tlscreds.h                          |   1 +
 include/hw/block/block.h                           |   2 +-
 include/hw/block/fdc.h                             |   2 +-
 include/hw/ppc/spapr_drc.h                         |   1 +
 include/hw/qdev-properties.h                       |   2 +
 include/io/dns-resolver.h                          |   1 +
 include/migration/colo.h                           |   2 +-
 include/migration/failover.h                       |   2 +-
 include/migration/global_state.h                   |   1 +
 include/monitor/monitor.h                          |   1 +
 include/net/filter.h                               |   1 +
 include/net/net.h                                  |   2 +-
 include/qapi/clone-visitor.h                       |   1 -
 include/qapi/error.h                               |   2 +-
 include/qapi/qmp/qobject.h                         |   2 +-
 include/qemu/sockets.h                             |   2 +-
 include/qemu/throttle.h                            |   2 +-
 include/qom/cpu.h                                  |   1 +
 include/qom/object.h                               |   2 +-
 include/sysemu/arch_init.h                         |   2 +-
 include/sysemu/balloon.h                           |   2 +-
 include/sysemu/dump.h                              |   2 +
 include/sysemu/hostmem.h                           |   1 +
 include/sysemu/replay.h                            |   2 +
 include/sysemu/sysemu.h                            |   1 +
 include/sysemu/tpm.h                               |   1 +
 include/sysemu/watchdog.h                          |   2 +-
 include/ui/console.h                               |   1 +
 include/ui/input.h                                 |   2 +-
 migration/migration.h                              |   1 +
 migration/ram.h                                    |   2 +-
 net/tap_int.h                                      |   2 +-
 replication.h                                      |   1 +
 ui/vnc.h                                           |   1 +
 vl.c                                               |   8 +-
 arch_init.c                                        |   2 +-
 backends/cryptodev.c                               |   1 -
 backends/hostmem.c                                 |   3 +-
 balloon.c                                          |   2 +-
 block.c                                            |   2 -
 block/block-backend.c                              |   2 +-
 block/crypto.c                                     |   2 +-
 block/iscsi.c                                      |   2 +-
 block/nbd.c                                        |   2 +-
 block/nfs.c                                        |   2 +-
 block/qapi.c                                       |   4 +-
 block/qcow2.c                                      |   4 +-
 block/quorum.c                                     |   2 +-
 block/sheepdog.c                                   |   2 +-
 block/ssh.c                                        |   2 +-
 block/throttle-groups.c                            |   2 +-
 block/write-threshold.c                            |   4 +-
 blockdev-nbd.c                                     |   2 +-
 blockdev.c                                         |   5 +-
 blockjob.c                                         |   2 +-
 chardev/char-fe.c                                  |   2 +-
 chardev/char-ringbuf.c                             |   2 +-
 chardev/char-socket.c                              |   1 +
 chardev/char.c                                     |   4 +-
 cpus.c                                             |   4 +-
 dump.c                                             |   4 +-
 hmp.c                                              |  12 +-
 hw/acpi/core.c                                     |   4 +-
 hw/acpi/cpu.c                                      |   2 +-
 hw/acpi/memory_hotplug.c                           |   2 +-
 hw/acpi/vmgenid.c                                  |   2 +-
 hw/block/block.c                                   |   1 +
 hw/block/hd-geometry.c                             |   1 +
 hw/char/virtio-console.c                           |   2 +-
 hw/core/machine.c                                  |   2 +-
 hw/core/qdev.c                                     |   2 +-
 hw/i386/pc.c                                       |   2 +-
 hw/i386/xen/xen-hvm.c                              |   2 +-
 hw/ipmi/ipmi.c                                     |   2 +-
 hw/mem/nvdimm.c                                    |   1 -
 hw/net/rocker/qmp-norocker.c                       |   2 +-
 hw/net/rocker/rocker.c                             |   2 +-
 hw/net/rocker/rocker_fp.c                          |   2 +-
 hw/net/rocker/rocker_of_dpa.c                      |   2 +-
 hw/net/virtio-net.c                                |   2 +-
 hw/pci/pci-stub.c                                  |   2 +-
 hw/pci/pci.c                                       |   2 +-
 hw/ppc/spapr_rtas.c                                |   1 -
 hw/ppc/spapr_rtc.c                                 |   2 +-
 hw/s390x/s390-skeys.c                              |   2 +-
 hw/timer/mc146818rtc.c                             |   4 +-
 hw/tpm/tpm_emulator.c                              |   1 +
 hw/tpm/tpm_passthrough.c                           |   1 +
 hw/virtio/virtio-balloon.c                         |   2 +-
 hw/watchdog/watchdog.c                             |   4 +-
 io/channel-socket.c                                |   1 +
 io/dns-resolver.c                                  |   1 +
 iothread.c                                         |   2 +-
 migration/colo-failover.c                          |   2 +-
 migration/colo.c                                   |   2 +-
 migration/migration.c                              |   4 +-
 migration/ram.c                                    |   2 +-
 migration/savevm.c                                 |   3 +-
 monitor.c                                          |   8 +-
 net/colo-compare.c                                 |   1 -
 net/filter-buffer.c                                |   2 +-
 net/filter-mirror.c                                |   1 -
 net/filter-rewriter.c                              |   1 -
 net/net.c                                          |   4 +-
 net/vhost-user.c                                   |   2 +-
 numa.c                                             |   4 +-
 qdev-monitor.c                                     |   2 +-
 qemu-img.c                                         |   2 +-
 qga/commands-posix.c                               |   2 +-
 qga/commands-win32.c                               |   2 +-
 qga/commands.c                                     |   2 +-
 qga/main.c                                         |   2 +-
 qmp.c                                              |  18 +-
 qom/object.c                                       |   2 +-
 qom/object_interfaces.c                            |   2 +-
 replay/replay-input.c                              |   1 +
 stubs/tpm.c                                        |   3 +-
 stubs/uuid.c                                       |   2 +-
 stubs/vmgenid.c                                    |   2 +-
 stubs/xen-hvm.c                                    |   2 +-
 target/arm/monitor.c                               |   3 +-
 target/i386/cpu.c                                  |   4 +-
 target/s390x/cpu.c                                 |   3 +-
 target/s390x/kvm.c                                 |   1 -
 target/s390x/sigp.c                                |   1 +
 tests/qmp-test.c                                   |   3 +-
 tests/test-char.c                                  |   2 +-
 tests/{test-qmp-commands.c => test-qmp-cmds.c}     |   2 +-
 tests/test-qmp-event.c                             |   3 +-
 tests/test-qobject-input-visitor.c                 |   8 +-
 tests/test-visitor-serialization.c                 |   1 -
 tpm.c                                              |   5 +-
 trace/qmp.c                                        |   2 +-
 ui/console.c                                       |   2 +-
 ui/gtk.c                                           |   2 +-
 ui/input-legacy.c                                  |   2 +-
 ui/input.c                                         |   2 +-
 ui/spice-core.c                                    |   4 +-
 ui/vnc.c                                           |   4 +-
 util/qemu-config.c                                 |   2 +-
 util/qemu-sockets.c                                |   2 +-
 .gitignore                                         |  80 ++++-
 qga/Makefile.objs                                  |   2 +-
 tests/.gitignore                                   |   9 +-
 tests/Makefile.include                             |  70 ++--
 tests/qapi-schema/comments.out                     |   3 +-
 tests/qapi-schema/doc-bad-section.out              |   5 +-
 tests/qapi-schema/doc-good.out                     |  33 +-
 tests/qapi-schema/empty.out                        |   2 +-
 tests/qapi-schema/event-case.out                   |   3 +-
 tests/qapi-schema/ident-with-escape.out            |   7 +-
 tests/qapi-schema/include-no-file.err              |   2 +-
 tests/qapi-schema/include-relpath.out              |   7 +-
 tests/qapi-schema/include-repetition.out           |  12 +-
 tests/qapi-schema/include-simple.out               |   5 +-
 tests/qapi-schema/indented-expr.out                |   3 +-
 tests/qapi-schema/qapi-schema-test.out             | 321 +++++++++----------
 tests/qapi-schema/test-qapi.py                     |  19 +-
 ui/cocoa.m                                         |   2 +-
 189 files changed, 1563 insertions(+), 1356 deletions(-)
 rename qapi-schema.json => qapi/misc.json (95%)
 create mode 100644 qapi/qapi-schema.json
 create mode 100755 scripts/qapi-gen.py
 create mode 100644 scripts/qapi/__init__.py
 rename scripts/{qapi-commands.py => qapi/commands.py} (67%)
 rename scripts/{qapi.py => qapi/common.py} (90%)
 rename scripts/{qapi2texi.py => qapi/doc.py} (78%)
 mode change 100755 => 100644
 rename scripts/{qapi-event.py => qapi/events.py} (61%)
 rename scripts/{qapi-introspect.py => qapi/introspect.py} (71%)
 rename scripts/{qapi-types.py => qapi/types.py} (53%)
 rename scripts/{qapi-visit.py => qapi/visit.py} (64%)
 rename tests/{test-qmp-commands.c => test-qmp-cmds.c} (99%)

-- 
2.14.3


Re: [Qemu-devel] [PULL v2 00/30] QAPI patches for 2018-03-01
Posted by Peter Maydell 7 years, 7 months ago
On 2 March 2018 at 01:29, Eric Blake <eblake@redhat.com> wrote:
> The following changes since commit 0dc8ae5e8e693737dfe65ba02d0c6eccb58a9c67:
>
>   Merge remote-tracking branch 'remotes/cohuck/tags/s390x-20180301-v2' into staging (2018-03-01 17:08:16 +0000)
>
> are available in the Git repository at:
>
>   git://repo.or.cz/qemu/ericb.git tags/pull-qapi-2018-03-01-v2
>
> for you to fetch changes up to 76b2baeed38089c19f69c7117b8eaa64b0e7d227:
>
>   qapi: Don't create useless directory qapi-generated (2018-03-01 19:16:40 -0600)
>
> v2: fix rebase on top of s390x work so that build is successful
> (if I do it right, I'm sending just the changed patches)
>
> Again, this series will be a conflict magnet due to content motion
> from qapi-schema.json to qapi/misc.json; hopefully, the level of
> rebasing required is not too painful
>
> ----------------------------------------------------------------
> qapi patches for 2018-03-01
>
> - Markus Armbruster: Modularize generated QAPI code
>

This produces a huge pile of warnings from my OSX toolchain.

When running ar on libqemuutil.a:
  AR      libqemuutil.a
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/ranlib:
file: libqemuutil.a(qapi-types.o) has no symbols
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/ranlib:
file: libqemuutil.a(qapi-visit.o) has no symbols
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/ranlib:
file: libqemuutil.a(qapi-events.o) has no symbols
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/ranlib:
file: libqemuutil.a(qapi-events-common.o) has no symbols
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/ranlib:
file: libqemuutil.a(qapi-events-crypto.o) has no symbols
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/ranlib:
file: libqemuutil.a(qapi-events-introspect.o) has no symbols
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/ranlib:
file: libqemuutil.a(qapi-events-rocker.o) has no symbols
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/ranlib:
file: libqemuutil.a(qapi-events-sockets.o) has no symbols
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/ranlib:
file: libqemuutil.a(qapi-events-tpm.o) has no symbols
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/ranlib:
file: libqemuutil.a(qapi-events-trace.o) has no symbols
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/ranlib:
file: libqemuutil.a(qapi-events-transaction.o) has no symbols

On every link of a binary:
warning: /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/nm:
no name list
warning: /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/nm:
no name list
warning: /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/nm:
no name list
warning: /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/nm:
no name list
warning: /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/nm:
no name list
warning: /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/nm:
no name list
warning: /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/nm:
no name list
warning: /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/nm:
no name list
warning: /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/nm:
no name list
warning: /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/nm:
no name list
warning: /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/nm:
no name list

I think these are related -- nm complains once for every .o file in the archive
that doesn't have any symbols in it.

I had a look at the autogenerated .c files on my Linux build, and they
seem to consist only of a bunch of #includes. Why are we not generating
any code here?

thanks
-- PMM

Re: [Qemu-devel] [PULL v2 00/30] QAPI patches for 2018-03-01
Posted by Eric Blake 7 years, 7 months ago
On 03/02/2018 06:38 AM, Peter Maydell wrote:
> On 2 March 2018 at 01:29, Eric Blake <eblake@redhat.com> wrote:
>> The following changes since commit 0dc8ae5e8e693737dfe65ba02d0c6eccb58a9c67:
>>
>>    Merge remote-tracking branch 'remotes/cohuck/tags/s390x-20180301-v2' into staging (2018-03-01 17:08:16 +0000)
>>
>> are available in the Git repository at:
>>
>>    git://repo.or.cz/qemu/ericb.git tags/pull-qapi-2018-03-01-v2
>>
>> for you to fetch changes up to 76b2baeed38089c19f69c7117b8eaa64b0e7d227:
>>
>>    qapi: Don't create useless directory qapi-generated (2018-03-01 19:16:40 -0600)
>>

> 
> This produces a huge pile of warnings from my OSX toolchain.
> 
> When running ar on libqemuutil.a:
>    AR      libqemuutil.a
> /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/ranlib:
> file: libqemuutil.a(qapi-types.o) has no symbols

Part of this change was moving the location of the generated 
./qapi-types.c to qapi/qapi-types.c.  Could it be that you are doing an 
incremental build, rather than a clean build, and the compiler is 
picking up the stale version of the file rather than its new location?

> /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/ranlib:
> file: libqemuutil.a(qapi-visit.o) has no symbols

Same thing.

> /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/ranlib:
> file: libqemuutil.a(qapi-events.o) has no symbols

Here, we renamed ./qapi-event.c to qapi/qapi-events.c, so the fact that 
the compiler named the right file is promising, but the fact that the 
file has no symbols is not good.

> 
> I think these are related -- nm complains once for every .o file in the archive
> that doesn't have any symbols in it.
> 
> I had a look at the autogenerated .c files on my Linux build, and they
> seem to consist only of a bunch of #includes. Why are we not generating
> any code here?

I don't have easy access to an OSX machine.  What version of python is 
in use?  My first thought was that it could be a subtle bug due to 
differences in the python engine running the qapi generators.

But I just checked, and at least for qapi/qapi-types.c, the generated 
file IS just a list of includes; and in fact, it looks like all of the 
mentioned files are in that boat (for example, qapi/transaction.json has 
no events, so qapi/qapi-events-transaction.c being empty makes sense).

I know that some compilers are picky about that.  Is a typedef enough to 
cause the compiler to have something to compile without warnings?  If 
so, does this patch solve things?  If it does, I'll squash it in the 
right place within the series and submit a v3 pull request.

diff --git i/scripts/qapi/common.py w/scripts/qapi/common.py
index 077e0fde4f4..aed32646c00 100644
--- i/scripts/qapi/common.py
+++ w/scripts/qapi/common.py
@@ -2035,6 +2035,13 @@ class QAPIGenC(QAPIGen):
  ''',
                       blurb=self._blurb, copyright=self._copyright)

+    def _bottom(self, fname):
+        return mcgen('''
+/* Dummy typedef to prevent empty .o file */
+typedef int %(name)s;
+''',
+                     name=c_name(fname))
+

  class QAPIGenH(QAPIGenC):


-- 
Eric Blake, Principal Software Engineer
Red Hat, Inc.           +1-919-301-3266
Virtualization:  qemu.org | libvirt.org

Re: [Qemu-devel] [PULL v2 00/30] QAPI patches for 2018-03-01
Posted by Peter Maydell 7 years, 7 months ago
On 2 March 2018 at 14:05, Eric Blake <eblake@redhat.com> wrote:
> On 03/02/2018 06:38 AM, Peter Maydell wrote:
>> This produces a huge pile of warnings from my OSX toolchain.
>>
>> When running ar on libqemuutil.a:
>>    AR      libqemuutil.a
>>
>> /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/ranlib:
>> file: libqemuutil.a(qapi-types.o) has no symbols
>
>
> Part of this change was moving the location of the generated ./qapi-types.c
> to qapi/qapi-types.c.  Could it be that you are doing an incremental build,
> rather than a clean build, and the compiler is picking up the stale version
> of the file rather than its new location?

I am doing an incremental build, yes. That needs to work, not break...

>> I had a look at the autogenerated .c files on my Linux build, and they
>> seem to consist only of a bunch of #includes. Why are we not generating
>> any code here?

> But I just checked, and at least for qapi/qapi-types.c, the generated file
> IS just a list of includes; and in fact, it looks like all of the mentioned
> files are in that boat (for example, qapi/transaction.json has no events, so
> qapi/qapi-events-transaction.c being empty makes sense).

> I know that some compilers are picky about that.

Yes, I think this is what is causing the problem.

> Is a typedef enough to
> cause the compiler to have something to compile without warnings?

Given that the warnings are coming from nm and ranlib, anything that
doesn't actually cause a symbol to be put into the .o file isn't going
to be enough I suspect.

> If so,
> does this patch solve things?  If it does, I'll squash it in the right place
> within the series and submit a v3 pull request.
>
> diff --git i/scripts/qapi/common.py w/scripts/qapi/common.py
> index 077e0fde4f4..aed32646c00 100644
> --- i/scripts/qapi/common.py
> +++ w/scripts/qapi/common.py
> @@ -2035,6 +2035,13 @@ class QAPIGenC(QAPIGen):
>  ''',
>                       blurb=self._blurb, copyright=self._copyright)
>
> +    def _bottom(self, fname):
> +        return mcgen('''
> +/* Dummy typedef to prevent empty .o file */
> +typedef int %(name)s;
> +''',
> +                     name=c_name(fname))
> +
>
>  class QAPIGenH(QAPIGenC):

I just tested this, and it isn't sufficient.

thanks
-- PMM

Re: [Qemu-devel] [PULL v2 00/30] QAPI patches for 2018-03-01
Posted by Eric Blake 7 years, 7 months ago
On 03/02/2018 08:34 AM, Peter Maydell wrote:
> On 2 March 2018 at 14:05, Eric Blake <eblake@redhat.com> wrote:
>> On 03/02/2018 06:38 AM, Peter Maydell wrote:
>>> This produces a huge pile of warnings from my OSX toolchain.
>>>
>>> When running ar on libqemuutil.a:
>>>     AR      libqemuutil.a
>>>
>>> /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/ranlib:
>>> file: libqemuutil.a(qapi-types.o) has no symbols
>>
>>
>> Part of this change was moving the location of the generated ./qapi-types.c
>> to qapi/qapi-types.c.  Could it be that you are doing an incremental build,
>> rather than a clean build, and the compiler is picking up the stale version
>> of the file rather than its new location?
> 
> I am doing an incremental build, yes. That needs to work, not break...

And since it was warnings and you picked up qapi/qapi-events.c, it looks 
like it does work; phew.

> 
>>> I had a look at the autogenerated .c files on my Linux build, and they
>>> seem to consist only of a bunch of #includes. Why are we not generating
>>> any code here?
> 
>> But I just checked, and at least for qapi/qapi-types.c, the generated file
>> IS just a list of includes; and in fact, it looks like all of the mentioned
>> files are in that boat (for example, qapi/transaction.json has no events, so
>> qapi/qapi-events-transaction.c being empty makes sense).
> 
>> I know that some compilers are picky about that.
> 
> Yes, I think this is what is causing the problem.

Okay, we've narrowed in on root cause, and it's now just a matter of 
finding the magic formula to shut up the toolchain.

> 
>> Is a typedef enough to
>> cause the compiler to have something to compile without warnings?
> 
> Given that the warnings are coming from nm and ranlib, anything that
> doesn't actually cause a symbol to be put into the .o file isn't going
> to be enough I suspect.

As I mentioned on IRC, gnulib has used typedefs to prevent empty files 
before:

https://git.savannah.gnu.org/cgit/gnulib.git/commit/lib/binary-io.c?id=c5d07ce91a8ad51591154450442fa4376441fdfa
https://lists.gnu.org/archive/html/bug-gnulib/2015-10/msg00019.html
https://lists.gnu.org/archive/html/bug-gnulib/2004-07/msg00029.html

>> +    def _bottom(self, fname):
>> +        return mcgen('''
>> +/* Dummy typedef to prevent empty .o file */
>> +typedef int %(name)s;
>> +''',
>> +                     name=c_name(fname))
>> +
>>
>>   class QAPIGenH(QAPIGenC):
> 
> I just tested this, and it isn't sufficient.

Oh well, we'll have to burn actual storage, then.  My next try is:

static char dummy_%(name)s;

perhaps with an __attribute__((unused)); if that gets by without 
warnings on the toolchains I have available, it should hopefully be 
stronger than just the typedef and therefore enough for your toolchain. 
I'll submit v3 shortly.

-- 
Eric Blake, Principal Software Engineer
Red Hat, Inc.           +1-919-301-3266
Virtualization:  qemu.org | libvirt.org