qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
* [Qemu-devel] [PATCH 00/36] Rip out dynamic JSON parsing
@ 2016-11-30 19:44 Eric Blake
  2016-11-30 19:44 ` [Qemu-devel] [PATCH 01/36] pci: Use struct instead of QDict to pass back parameters Eric Blake
                   ` (36 more replies)
  0 siblings, 37 replies; 45+ messages in thread
From: Eric Blake @ 2016-11-30 19:44 UTC (permalink / raw)
  To: qemu-devel; +Cc: armbru, pbonzini

Followup series to conversation about PRId64 and MacOS:
https://lists.gnu.org/archive/html/qemu-devel/2016-11/msg04226.html

We have relatively few users of dynamic JSON (the ability to pass
varargs plus a format string with % sequences embedded in the JSON,
to create a final QObject dynamically). Most of them live in the
testsuite.  Converting ALL uses to hand-written QObjects would have
been too invasive, so I hope this series hits a nice compromise
of adjusting the few users that injected non-strings, while moving
the work of string injection out of the JSON parser proper and
instead into libqtest.  Doing this means the testsuite is doing a
lot fewer string->QObject->string round-trips when computing what
to send over a QMP wire transaction.

I'm also pleased that this series has a net overall reduction in
lines of code, while still adding several new useful features (such
as qdict_put_str() in 2/36, QAPI_TO_QOBJECT() in 11/36, qmp_cmd() in
9/36) and fixing a couple of testsuite flaws (7/36, 8/36).  Patch
2/36 may be a candidate for splitting into sub-patches, but the
series is already long enough that I wanted to post it for feedback
on the approaches taken here.

Partially overlaps with my earlier v6 posting of a qapi JSON visitor
(https://lists.gnu.org/archive/html/qemu-devel/2016-10/msg01915.html);
whichever series goes in first has two patches that the other
series will use as-is (28/36, 29/36).

Eric Blake (36):
  pci: Use struct instead of QDict to pass back parameters
  qdict: Add convenience helpers for wrapped puts
  qlist: Add convenience helpers for wrapped appends
  qmp-event: Avoid dynamic JSON
  qmp-dispatch: Avoid dynamic JSON
  qobject-input-visitor: Avoid dynamic JSON in tests
  fdc-test: Avoid deprecated 'change' command
  test-qga: Actually test 0xff sync bytes
  qtest: Add a new helper qmp_cmd() and friends
  qtest: Avoid dynamic JSON in libqtest
  qapi: Add QAPI_TO_QOBJECT() convenience macro
  nbd: Use simpler QAPI_TO_QOBJECT()
  nfs: Use simpler QAPI_TO_QOBJECT()
  qapi: Use simpler QAPI_TO_QOBJECT()
  blockdev: Use simpler QAPI_TO_QOBJECT()
  qapi: Promote blockdev-change-medium arguments to QAPI type
  qtest: Avoid dynamic JSON in ahci-test
  qtest: Avoid dynamic JSON in fdc-test
  qtest: Change qmp_discard_response() to drop varargs
  qtest: Avoid dynamic JSON in device-introspect-test
  qtest: Avoid dynamic JSON in tmp105-test
  qtest: Avoid dynamic JSON in pc-cpu-test
  qtest: Avoid dynamic JSON in virtio-blk-test
  qtest: Drop unused qmp_fdv()
  qtest: Change qmp_fd_send() to drop varags
  qtest: Drop unused qtest_qmp_async()
  qtest: Avoid dynamic JSON in qmp_cmd()
  qapi: Factor out JSON string escaping
  qapi: Add qstring_append_printf()
  qtest: Avoid dynamic JSON in qmp_fd_sendv()
  qtest: Document calling conventions
  qtest: Avoid dynamic JSON in qom-test
  qtest: Avoid dynamic JSON in test-x86-cpuid-compat
  qapi: Rip out dynamic JSON parser frontend
  qapi: Rip out dynamic JSON parser escape sequence support
  qapi: Rip out dynamic JSON parser backend

 qapi/block-core.json                  |  11 ++-
 include/qapi/qmp/json-lexer.h         |   1 -
 include/qapi/qmp/json-parser.h        |   6 +-
 include/qapi/qmp/qdict.h              |   8 ++
 include/qapi/qmp/qjson.h              |   4 +-
 include/qapi/qmp/qlist.h              |   8 ++
 include/qapi/qmp/qstring.h            |   7 +-
 include/qapi/qobject-output-visitor.h |  19 ++++
 tests/libqtest.h                      |  78 +++++++--------
 block.c                               |  59 +++++-------
 block/archipelago.c                   |   4 +-
 block/blkdebug.c                      |   6 +-
 block/blkverify.c                     |  11 +--
 block/curl.c                          |   2 +-
 block/iscsi.c                         |   2 +-
 block/nbd.c                           |  47 ++++-----
 block/nfs.c                           |  49 ++++------
 block/null.c                          |   2 +-
 block/qapi.c                          |   6 +-
 block/qcow2.c                         |   4 +-
 block/quorum.c                        |  13 +--
 block/raw-posix.c                     |   8 +-
 block/raw-win32.c                     |   4 +-
 block/ssh.c                           |  16 ++-
 block/vvfat.c                         |  10 +-
 blockdev.c                            |  42 +++-----
 hw/block/xen_disk.c                   |   2 +-
 hw/pci/pcie_aer.c                     |  36 ++++---
 hw/usb/xen-usb.c                      |  12 +--
 migration/qjson.c                     |  12 +--
 monitor.c                             |  30 +++---
 qapi/qmp-dispatch.c                   |   8 +-
 qapi/qmp-event.c                      |  15 +--
 qapi/qobject-output-visitor.c         |  16 +++
 qemu-img.c                            |   6 +-
 qemu-io.c                             |   2 +-
 qemu-nbd.c                            |   2 +-
 qga/main.c                            |   2 +-
 qobject/json-lexer.c                  |  40 --------
 qobject/json-parser.c                 |  66 ++++---------
 qobject/qdict.c                       |   2 +-
 qobject/qjson.c                       | 177 ++++++++++++++--------------------
 qobject/qstring.c                     |  26 ++++-
 target-s390x/cpu_models.c             |   4 +-
 tests/ahci-test.c                     |  26 ++++-
 tests/check-qdict.c                   | 142 +++++++++++++--------------
 tests/check-qjson.c                   | 113 +---------------------
 tests/check-qlist.c                   |   2 +-
 tests/device-introspect-test.c        |  15 +--
 tests/fdc-test.c                      |  15 ++-
 tests/libqtest.c                      | 147 ++++++++++++++--------------
 tests/pc-cpu-test.c                   |  12 ++-
 tests/qom-test.c                      |  15 +--
 tests/test-qga.c                      |  12 ++-
 tests/test-qmp-commands.c             |  30 +++---
 tests/test-qmp-event.c                |  30 +++---
 tests/test-qobject-input-strict.c     |  37 +------
 tests/test-qobject-input-visitor.c    |  75 ++++++--------
 tests/test-qobject-output-visitor.c   |   6 +-
 tests/test-x86-cpuid-compat.c         |  14 ++-
 tests/tmp105-test.c                   |   7 +-
 tests/virtio-blk-test.c               |  22 +++--
 util/qemu-option.c                    |   6 +-
 63 files changed, 726 insertions(+), 885 deletions(-)

-- 
2.7.4

^ permalink raw reply	[flat|nested] 45+ messages in thread

end of thread, other threads:[~2016-12-09 14:07 UTC | newest]

Thread overview: 45+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2016-11-30 19:44 [Qemu-devel] [PATCH 00/36] Rip out dynamic JSON parsing Eric Blake
2016-11-30 19:44 ` [Qemu-devel] [PATCH 01/36] pci: Use struct instead of QDict to pass back parameters Eric Blake
2016-11-30 21:15   ` Michael S. Tsirkin
2016-11-30 19:44 ` [Qemu-devel] [PATCH 02/36] qdict: Add convenience helpers for wrapped puts Eric Blake
2016-12-09 14:06   ` Alberto Garcia
2016-11-30 19:44 ` [Qemu-devel] [PATCH 03/36] qlist: Add convenience helpers for wrapped appends Eric Blake
2016-11-30 19:44 ` [Qemu-devel] [PATCH 04/36] qmp-event: Avoid dynamic JSON Eric Blake
2016-11-30 19:44 ` [Qemu-devel] [PATCH 05/36] qmp-dispatch: " Eric Blake
2016-11-30 19:44 ` [Qemu-devel] [PATCH 06/36] qobject-input-visitor: Avoid dynamic JSON in tests Eric Blake
2016-11-30 19:44 ` [Qemu-devel] [PATCH 07/36] fdc-test: Avoid deprecated 'change' command Eric Blake
2016-11-30 20:58   ` John Snow
2016-11-30 19:44 ` [Qemu-devel] [PATCH 08/36] test-qga: Actually test 0xff sync bytes Eric Blake
2016-11-30 19:44 ` [Qemu-devel] [PATCH 09/36] qtest: Add a new helper qmp_cmd() and friends Eric Blake
2016-11-30 19:44 ` [Qemu-devel] [PATCH 10/36] qtest: Avoid dynamic JSON in libqtest Eric Blake
2016-11-30 19:44 ` [Qemu-devel] [PATCH 11/36] qapi: Add QAPI_TO_QOBJECT() convenience macro Eric Blake
2016-11-30 19:44 ` [Qemu-devel] [PATCH 12/36] nbd: Use simpler QAPI_TO_QOBJECT() Eric Blake
2016-11-30 19:44 ` [Qemu-devel] [PATCH 13/36] nfs: " Eric Blake
2016-11-30 19:44 ` [Qemu-devel] [PATCH 14/36] qapi: " Eric Blake
2016-11-30 19:44 ` [Qemu-devel] [PATCH 15/36] blockdev: " Eric Blake
2016-11-30 19:44 ` [Qemu-devel] [PATCH 16/36] qapi: Promote blockdev-change-medium arguments to QAPI type Eric Blake
2016-11-30 19:44 ` [Qemu-devel] [PATCH 17/36] qtest: Avoid dynamic JSON in ahci-test Eric Blake
2016-11-30 21:02   ` John Snow
2016-11-30 21:19     ` Eric Blake
2016-11-30 19:44 ` [Qemu-devel] [PATCH 18/36] qtest: Avoid dynamic JSON in fdc-test Eric Blake
2016-11-30 21:14   ` John Snow
2016-11-30 19:44 ` [Qemu-devel] [PATCH 19/36] qtest: Change qmp_discard_response() to drop varargs Eric Blake
2016-11-30 19:44 ` [Qemu-devel] [PATCH 20/36] qtest: Avoid dynamic JSON in device-introspect-test Eric Blake
2016-11-30 19:44 ` [Qemu-devel] [PATCH 21/36] qtest: Avoid dynamic JSON in tmp105-test Eric Blake
2016-11-30 19:44 ` [Qemu-devel] [PATCH 22/36] qtest: Avoid dynamic JSON in pc-cpu-test Eric Blake
2016-11-30 19:44 ` [Qemu-devel] [PATCH 23/36] qtest: Avoid dynamic JSON in virtio-blk-test Eric Blake
2016-11-30 19:44 ` [Qemu-devel] [PATCH 24/36] qtest: Drop unused qmp_fdv() Eric Blake
2016-11-30 19:44 ` [Qemu-devel] [PATCH 25/36] qtest: Change qmp_fd_send() to drop varags Eric Blake
2016-11-30 19:44 ` [Qemu-devel] [PATCH 26/36] qtest: Drop unused qtest_qmp_async() Eric Blake
2016-11-30 19:44 ` [Qemu-devel] [PATCH 27/36] qtest: Avoid dynamic JSON in qmp_cmd() Eric Blake
2016-11-30 19:44 ` [Qemu-devel] [PATCH 28/36] qapi: Factor out JSON string escaping Eric Blake
2016-11-30 19:44 ` [Qemu-devel] [PATCH 29/36] qapi: Add qstring_append_printf() Eric Blake
2016-11-30 19:44 ` [Qemu-devel] [PATCH 30/36] qtest: Avoid dynamic JSON in qmp_fd_sendv() Eric Blake
2016-11-30 19:44 ` [Qemu-devel] [PATCH 31/36] qtest: Document calling conventions Eric Blake
2016-11-30 19:44 ` [Qemu-devel] [PATCH 32/36] qtest: Avoid dynamic JSON in qom-test Eric Blake
2016-11-30 19:44 ` [Qemu-devel] [PATCH 33/36] qtest: Avoid dynamic JSON in test-x86-cpuid-compat Eric Blake
2016-11-30 19:44 ` [Qemu-devel] [PATCH 34/36] qapi: Rip out dynamic JSON parser frontend Eric Blake
2016-11-30 19:44 ` [Qemu-devel] [PATCH 35/36] qapi: Rip out dynamic JSON parser escape sequence support Eric Blake
2016-11-30 19:44 ` [Qemu-devel] [PATCH 36/36] qapi: Rip out dynamic JSON parser backend Eric Blake
2016-11-30 19:50 ` [Qemu-devel] [PATCH 00/36] Rip out dynamic JSON parsing Eric Blake
2016-11-30 20:42   ` Paolo Bonzini

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).