[PATCH 00/20] Immutable QString, and also one JSON writer less

Markus Armbruster posted 20 patches 3 years, 4 months ago
Test checkpatch passed
Patches applied successfully (tree, apply log)
git fetch https://github.com/patchew-project/qemu tags/patchew/20201211171152.146877-1-armbru@redhat.com
Maintainers: Jiaxun Yang <jiaxun.yang@flygoat.com>, Christian Borntraeger <borntraeger@de.ibm.com>, "Daniel P. Berrangé" <berrange@redhat.com>, Laurent Vivier <lvivier@redhat.com>, Yuval Shaia <yuval.shaia.ml@gmail.com>, Laszlo Ersek <lersek@redhat.com>, Gerd Hoffmann <kraxel@redhat.com>, Paolo Bonzini <pbonzini@redhat.com>, Halil Pasic <pasic@linux.ibm.com>, Michael Roth <mdroth@linux.vnet.ibm.com>, Kevin Wolf <kwolf@redhat.com>, Stafford Horne <shorne@gmail.com>, Juan Quintela <quintela@redhat.com>, Markus Armbruster <armbru@redhat.com>, Eduardo Habkost <ehabkost@redhat.com>, "Michael S. Tsirkin" <mst@redhat.com>, Mark Cave-Ayland <mark.cave-ayland@ilande.co.uk>, Artyom Tarasenko <atar4qemu@gmail.com>, Peter Maydell <peter.maydell@linaro.org>, Michael Rolnik <mrolnik@gmail.com>, Aleksandar Rikalo <aleksandar.rikalo@syrmia.com>, Richard Henderson <richard.henderson@linaro.org>, Fam Zheng <fam@euphon.net>, "Edgar E. Iglesias" <edgar.iglesias@gmail.com>, "Dr. David Alan Gilbert" <dgilbert@redhat.com>, "Philippe Mathieu-Daudé" <philmd@redhat.com>, Cornelia Huck <cohuck@redhat.com>, Aurelien Jarno <aurelien@aurel32.net>, Jason Dillaman <dillaman@redhat.com>, Marcel Apfelbaum <marcel.apfelbaum@gmail.com>, David Gibson <david@gibson.dropbear.id.au>, Max Reitz <mreitz@redhat.com>, Andrzej Zaborowski <balrogg@gmail.com>, Sarah Harris <S.E.Harris@kent.ac.uk>, Thomas Huth <thuth@redhat.com>
hw/rdma/rdma_backend_defs.h        |   2 +-
hw/rdma/rdma_utils.h               |  15 +-
include/migration/vmstate.h        |   7 +-
include/qapi/qmp/json-writer.h     |  35 ++++
include/qapi/qmp/qbool.h           |   2 -
include/qapi/qmp/qdict.h           |   2 -
include/qapi/qmp/qjson.h           |   4 +-
include/qapi/qmp/qlist.h           |   2 -
include/qapi/qmp/qnull.h           |   2 -
include/qapi/qmp/qnum.h            |   3 -
include/qapi/qmp/qobject.h         |   9 +-
include/qapi/qmp/qstring.h         |  14 +-
include/qemu/typedefs.h            |   4 +-
migration/qjson.h                  |  29 ----
monitor/monitor-internal.h         |   2 +-
qobject/qobject-internal.h         |  39 +++++
block.c                            |  23 +--
block/rbd.c                        |   2 +-
hw/display/virtio-gpu.c            |   2 +-
hw/intc/s390_flic_kvm.c            |   2 +-
hw/nvram/eeprom93xx.c              |   2 +-
hw/nvram/fw_cfg.c                  |   2 +-
hw/pci/msix.c                      |   2 +-
hw/pci/pci.c                       |   4 +-
hw/pci/shpc.c                      |   2 +-
hw/rdma/rdma_backend.c             |  10 +-
hw/rdma/rdma_utils.c               |  29 ++--
hw/rtc/twl92230.c                  |   2 +-
hw/scsi/scsi-bus.c                 |   2 +-
hw/usb/redirect.c                  |   7 +-
hw/virtio/virtio.c                 |   4 +-
migration/qjson.c                  | 114 -------------
migration/savevm.c                 |  53 ++++---
migration/vmstate-types.c          |  38 ++---
migration/vmstate.c                |  52 +++---
monitor/misc.c                     |   6 +-
monitor/monitor.c                  |  20 +--
monitor/qmp.c                      |  46 +++---
qemu-img.c                         |  33 ++--
qga/main.c                         |  22 +--
qobject/json-parser.c              |  30 ++--
qobject/json-writer.c              | 247 +++++++++++++++++++++++++++++
qobject/qbool.c                    |   1 +
qobject/qdict.c                    |   1 +
qobject/qjson.c                    | 144 ++++-------------
qobject/qlist.c                    |   1 +
qobject/qnull.c                    |   1 +
qobject/qnum.c                     |   6 +-
qobject/qobject.c                  |   1 +
qobject/qstring.c                  | 117 +++-----------
qom/object.c                       |   9 +-
qom/object_interfaces.c            |   4 +-
qom/qom-hmp-cmds.c                 |   7 +-
target/alpha/machine.c             |   2 +-
target/arm/machine.c               |   6 +-
target/avr/machine.c               |   4 +-
target/hppa/machine.c              |   4 +-
target/microblaze/machine.c        |   2 +-
target/mips/machine.c              |   4 +-
target/openrisc/machine.c          |   2 +-
target/ppc/machine.c               |  10 +-
target/sparc/machine.c             |   2 +-
tests/check-qjson.c                |  67 ++++----
tests/check-qobject.c              |   3 +-
tests/check-qstring.c              |  16 --
tests/qtest/libqtest.c             |  20 ++-
tests/test-visitor-serialization.c |   6 +-
util/keyval.c                      |  11 +-
migration/meson.build              |   1 -
qobject/meson.build                |   5 +-
70 files changed, 679 insertions(+), 705 deletions(-)
create mode 100644 include/qapi/qmp/json-writer.h
delete mode 100644 migration/qjson.h
create mode 100644 qobject/qobject-internal.h
delete mode 100644 migration/qjson.c
create mode 100644 qobject/json-writer.c
[PATCH 00/20] Immutable QString, and also one JSON writer less
Posted by Markus Armbruster 3 years, 4 months ago
Based-on: <20201210161452.2813491-1-armbru@redhat.com>

Cc: Daniel P. Berrangé <berrange@redhat.com>
Cc: Dr. David Alan Gilbert <dgilbert@redhat.com>
Cc: Eduardo Habkost <ehabkost@redhat.com>
Cc: Juan Quintela <quintela@redhat.com>
Cc: Kevin Wolf <kwolf@redhat.com>
Cc: Marcel Apfelbaum <marcel.apfelbaum@gmail.com>
Cc: Max Reitz <mreitz@redhat.com>
Cc: Paolo Bonzini <pbonzini@redhat.com>
Cc: Yuval Shaia <yuval.shaia.ml@gmail.com>
Cc: qemu-block@nongnu.org

Markus Armbruster (20):
  hmp: Simplify how qmp_human_monitor_command() gets output
  monitor: Use GString instead of QString for output buffer
  qobject: Make qobject_to_json_pretty() take a pretty argument
  qobject: Use GString instead of QString to accumulate JSON
  qobject: Change qobject_to_json()'s value to GString
  Revert "qstring: add qstring_free()"
  hw/rdma: Replace QList by GQueue
  qobject: Move internals to qobject-internal.h
  qmp: Fix tracing of non-string command IDs
  block: Avoid qobject_get_try_str()
  Revert "qobject: let object_property_get_str() use new API"
  qobject: Drop qobject_get_try_str()
  qobject: Drop qstring_get_try_str()
  qobject: Factor quoted_str() out of to_json()
  qobject: Factor JSON writer out of qobject_to_json()
  migration: Replace migration's JSON writer by the general one
  json: Use GString instead of QString to accumulate strings
  keyval: Use GString to accumulate value strings
  block: Use GString instead of QString to build filenames
  qobject: Make QString immutable

 hw/rdma/rdma_backend_defs.h        |   2 +-
 hw/rdma/rdma_utils.h               |  15 +-
 include/migration/vmstate.h        |   7 +-
 include/qapi/qmp/json-writer.h     |  35 ++++
 include/qapi/qmp/qbool.h           |   2 -
 include/qapi/qmp/qdict.h           |   2 -
 include/qapi/qmp/qjson.h           |   4 +-
 include/qapi/qmp/qlist.h           |   2 -
 include/qapi/qmp/qnull.h           |   2 -
 include/qapi/qmp/qnum.h            |   3 -
 include/qapi/qmp/qobject.h         |   9 +-
 include/qapi/qmp/qstring.h         |  14 +-
 include/qemu/typedefs.h            |   4 +-
 migration/qjson.h                  |  29 ----
 monitor/monitor-internal.h         |   2 +-
 qobject/qobject-internal.h         |  39 +++++
 block.c                            |  23 +--
 block/rbd.c                        |   2 +-
 hw/display/virtio-gpu.c            |   2 +-
 hw/intc/s390_flic_kvm.c            |   2 +-
 hw/nvram/eeprom93xx.c              |   2 +-
 hw/nvram/fw_cfg.c                  |   2 +-
 hw/pci/msix.c                      |   2 +-
 hw/pci/pci.c                       |   4 +-
 hw/pci/shpc.c                      |   2 +-
 hw/rdma/rdma_backend.c             |  10 +-
 hw/rdma/rdma_utils.c               |  29 ++--
 hw/rtc/twl92230.c                  |   2 +-
 hw/scsi/scsi-bus.c                 |   2 +-
 hw/usb/redirect.c                  |   7 +-
 hw/virtio/virtio.c                 |   4 +-
 migration/qjson.c                  | 114 -------------
 migration/savevm.c                 |  53 ++++---
 migration/vmstate-types.c          |  38 ++---
 migration/vmstate.c                |  52 +++---
 monitor/misc.c                     |   6 +-
 monitor/monitor.c                  |  20 +--
 monitor/qmp.c                      |  46 +++---
 qemu-img.c                         |  33 ++--
 qga/main.c                         |  22 +--
 qobject/json-parser.c              |  30 ++--
 qobject/json-writer.c              | 247 +++++++++++++++++++++++++++++
 qobject/qbool.c                    |   1 +
 qobject/qdict.c                    |   1 +
 qobject/qjson.c                    | 144 ++++-------------
 qobject/qlist.c                    |   1 +
 qobject/qnull.c                    |   1 +
 qobject/qnum.c                     |   6 +-
 qobject/qobject.c                  |   1 +
 qobject/qstring.c                  | 117 +++-----------
 qom/object.c                       |   9 +-
 qom/object_interfaces.c            |   4 +-
 qom/qom-hmp-cmds.c                 |   7 +-
 target/alpha/machine.c             |   2 +-
 target/arm/machine.c               |   6 +-
 target/avr/machine.c               |   4 +-
 target/hppa/machine.c              |   4 +-
 target/microblaze/machine.c        |   2 +-
 target/mips/machine.c              |   4 +-
 target/openrisc/machine.c          |   2 +-
 target/ppc/machine.c               |  10 +-
 target/sparc/machine.c             |   2 +-
 tests/check-qjson.c                |  67 ++++----
 tests/check-qobject.c              |   3 +-
 tests/check-qstring.c              |  16 --
 tests/qtest/libqtest.c             |  20 ++-
 tests/test-visitor-serialization.c |   6 +-
 util/keyval.c                      |  11 +-
 migration/meson.build              |   1 -
 qobject/meson.build                |   5 +-
 70 files changed, 679 insertions(+), 705 deletions(-)
 create mode 100644 include/qapi/qmp/json-writer.h
 delete mode 100644 migration/qjson.h
 create mode 100644 qobject/qobject-internal.h
 delete mode 100644 migration/qjson.c
 create mode 100644 qobject/json-writer.c

-- 
2.26.2


Re: [PATCH 00/20] Immutable QString, and also one JSON writer less
Posted by Paolo Bonzini 3 years, 4 months ago
On 11/12/20 18:11, Markus Armbruster wrote:
> Based-on: <20201210161452.2813491-1-armbru@redhat.com>
> 
> Cc: Daniel P. Berrangé <berrange@redhat.com>
> Cc: Dr. David Alan Gilbert <dgilbert@redhat.com>
> Cc: Eduardo Habkost <ehabkost@redhat.com>
> Cc: Juan Quintela <quintela@redhat.com>
> Cc: Kevin Wolf <kwolf@redhat.com>
> Cc: Marcel Apfelbaum <marcel.apfelbaum@gmail.com>
> Cc: Max Reitz <mreitz@redhat.com>
> Cc: Paolo Bonzini <pbonzini@redhat.com>
> Cc: Yuval Shaia <yuval.shaia.ml@gmail.com>
> Cc: qemu-block@nongnu.org

Looks good, my only comment was on conflicts with other pending series.

Paolo

> Markus Armbruster (20):
>    hmp: Simplify how qmp_human_monitor_command() gets output
>    monitor: Use GString instead of QString for output buffer
>    qobject: Make qobject_to_json_pretty() take a pretty argument
>    qobject: Use GString instead of QString to accumulate JSON
>    qobject: Change qobject_to_json()'s value to GString
>    Revert "qstring: add qstring_free()"
>    hw/rdma: Replace QList by GQueue
>    qobject: Move internals to qobject-internal.h
>    qmp: Fix tracing of non-string command IDs
>    block: Avoid qobject_get_try_str()
>    Revert "qobject: let object_property_get_str() use new API"
>    qobject: Drop qobject_get_try_str()
>    qobject: Drop qstring_get_try_str()
>    qobject: Factor quoted_str() out of to_json()
>    qobject: Factor JSON writer out of qobject_to_json()
>    migration: Replace migration's JSON writer by the general one
>    json: Use GString instead of QString to accumulate strings
>    keyval: Use GString to accumulate value strings
>    block: Use GString instead of QString to build filenames
>    qobject: Make QString immutable
> 
>   hw/rdma/rdma_backend_defs.h        |   2 +-
>   hw/rdma/rdma_utils.h               |  15 +-
>   include/migration/vmstate.h        |   7 +-
>   include/qapi/qmp/json-writer.h     |  35 ++++
>   include/qapi/qmp/qbool.h           |   2 -
>   include/qapi/qmp/qdict.h           |   2 -
>   include/qapi/qmp/qjson.h           |   4 +-
>   include/qapi/qmp/qlist.h           |   2 -
>   include/qapi/qmp/qnull.h           |   2 -
>   include/qapi/qmp/qnum.h            |   3 -
>   include/qapi/qmp/qobject.h         |   9 +-
>   include/qapi/qmp/qstring.h         |  14 +-
>   include/qemu/typedefs.h            |   4 +-
>   migration/qjson.h                  |  29 ----
>   monitor/monitor-internal.h         |   2 +-
>   qobject/qobject-internal.h         |  39 +++++
>   block.c                            |  23 +--
>   block/rbd.c                        |   2 +-
>   hw/display/virtio-gpu.c            |   2 +-
>   hw/intc/s390_flic_kvm.c            |   2 +-
>   hw/nvram/eeprom93xx.c              |   2 +-
>   hw/nvram/fw_cfg.c                  |   2 +-
>   hw/pci/msix.c                      |   2 +-
>   hw/pci/pci.c                       |   4 +-
>   hw/pci/shpc.c                      |   2 +-
>   hw/rdma/rdma_backend.c             |  10 +-
>   hw/rdma/rdma_utils.c               |  29 ++--
>   hw/rtc/twl92230.c                  |   2 +-
>   hw/scsi/scsi-bus.c                 |   2 +-
>   hw/usb/redirect.c                  |   7 +-
>   hw/virtio/virtio.c                 |   4 +-
>   migration/qjson.c                  | 114 -------------
>   migration/savevm.c                 |  53 ++++---
>   migration/vmstate-types.c          |  38 ++---
>   migration/vmstate.c                |  52 +++---
>   monitor/misc.c                     |   6 +-
>   monitor/monitor.c                  |  20 +--
>   monitor/qmp.c                      |  46 +++---
>   qemu-img.c                         |  33 ++--
>   qga/main.c                         |  22 +--
>   qobject/json-parser.c              |  30 ++--
>   qobject/json-writer.c              | 247 +++++++++++++++++++++++++++++
>   qobject/qbool.c                    |   1 +
>   qobject/qdict.c                    |   1 +
>   qobject/qjson.c                    | 144 ++++-------------
>   qobject/qlist.c                    |   1 +
>   qobject/qnull.c                    |   1 +
>   qobject/qnum.c                     |   6 +-
>   qobject/qobject.c                  |   1 +
>   qobject/qstring.c                  | 117 +++-----------
>   qom/object.c                       |   9 +-
>   qom/object_interfaces.c            |   4 +-
>   qom/qom-hmp-cmds.c                 |   7 +-
>   target/alpha/machine.c             |   2 +-
>   target/arm/machine.c               |   6 +-
>   target/avr/machine.c               |   4 +-
>   target/hppa/machine.c              |   4 +-
>   target/microblaze/machine.c        |   2 +-
>   target/mips/machine.c              |   4 +-
>   target/openrisc/machine.c          |   2 +-
>   target/ppc/machine.c               |  10 +-
>   target/sparc/machine.c             |   2 +-
>   tests/check-qjson.c                |  67 ++++----
>   tests/check-qobject.c              |   3 +-
>   tests/check-qstring.c              |  16 --
>   tests/qtest/libqtest.c             |  20 ++-
>   tests/test-visitor-serialization.c |   6 +-
>   util/keyval.c                      |  11 +-
>   migration/meson.build              |   1 -
>   qobject/meson.build                |   5 +-
>   70 files changed, 679 insertions(+), 705 deletions(-)
>   create mode 100644 include/qapi/qmp/json-writer.h
>   delete mode 100644 migration/qjson.h
>   create mode 100644 qobject/qobject-internal.h
>   delete mode 100644 migration/qjson.c
>   create mode 100644 qobject/json-writer.c
>