All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH v3 00/19] monitor: explicitly permit QMP commands to be added for all use cases
@ 2021-09-30 13:23 Daniel P. Berrangé
  2021-09-30 13:23 ` [PATCH v3 01/19] docs/devel: rename file for writing monitor commands Daniel P. Berrangé
                   ` (18 more replies)
  0 siblings, 19 replies; 41+ messages in thread
From: Daniel P. Berrangé @ 2021-09-30 13:23 UTC (permalink / raw)
  To: qemu-devel
  Cc: Laurent Vivier, Thomas Huth, Daniel P. Berrangé,
	Eduardo Habkost, David Hildenbrand, Michael Roth, Cornelia Huck,
	Yuval Shaia, Markus Armbruster, Peter Xu, Dr. David Alan Gilbert,
	Halil Pasic, Christian Borntraeger, qemu-s390x, Gerd Hoffmann,
	Paolo Bonzini, Richard Henderson, Eric Blake

Previous postings:

  v1: https://lists.gnu.org/archive/html/qemu-devel/2021-09/msg02295.html
  v2: https://lists.gnu.org/archive/html/qemu-devel/2021-09/msg03703.html

We are still adding HMP commands without any QMP counterparts. This is
done because there are a reasonable number of scenarios where the cost
of designing a QAPI data type for the command is not justified.

This has the downside, however, that we will never be able to fully
isolate the monitor code from the remainder of QEMU internals. It is
desirable to be able to get to a point where subsystems in QEMU are
exclusively implemented using QAPI types and never need to have any
knowledge of the monitor.

The way to get there is to stop adding commands to HMP only. All
commands must be implemented using QMP and any HMP equivalent be
a shim around the QMP implemetation. We don't want to compromise
our supportability of QMP long term though.

This series proposes that we relax our requirements around fine grained
QAPI data design, but with the caveat that any command taking this
design approach is mandated to use the 'x-' name prefix. This tradeoff
should be suitable for any commands we have been adding exclusively to
HMP in recent times, and thus mean we have mandate QMP support for all
new commands going forward.

The series then converts the following HMP commands to be QMP shims.

    info opcount
    info jit
    info irq
    info lapic
    info cmma
    info skeys
    info ramblock
    info rdma
    info usb
    info numa
    info profile
    info roms

A full conversion would also enable HMP to be emulated entirely
outside QEMU. This could be interesting if we introduce a new QEMU
system emulator binary which is legacy free and 100% controlled
via QMP, as it would let us provide HMP backcompat around it
without the burden of HMP being integrated directly.

There are still many HMP commands with no QMP counterpart after
this series.

 - A few are not relevant to port as they directly
   reflect HMP functionality (help, info history).
 - A few are sort of available in QMP but look quite
   different (drive_add vs blockdev_add)
 - A few are complicated. "info usbhost" is a dynamically
   loaded HMP command inside a loadable module and we
   don't have a way to dynamically register QMP handlers
   at runtime.
 - Most are just tedious gruntwork.

Changed in v3:

 - Temporarily spun off the 'info registers' and 'info tlb'
   conversions. These required 30+ patches across all the
   targets and was making this series too large and conflict
   prone and spanning too many subsystems.

   I'll re-submit those two later

 - Pull in a fix for the 'info lapic' command

 - Misc improvements to the documentation after reviews

 - Add helper for GString -> HumanReadableText conversion

Changed in v2:

 - Improved documentation in response to feedback
 - Finished "info registers" conversion on all targets
 - Got a bit carried away and converted many many more
   commands

Daniel P. Berrangé (18):
  docs/devel: rename file for writing monitor commands
  docs/devel: tweak headings in monitor command docs
  docs/devel: document expectations for QAPI data modelling for QMP
  docs/devel: add example of command returning unstructured text
  docs/devel: document expectations for HMP commands in the future
  monitor: remove 'info ioapic' HMP command
  qapi: introduce x-query-roms QMP command
  qapi: introduce x-query-profile QMP command
  qapi: introduce x-query-numa QMP command
  qapi: introduce x-query-usb QMP command
  qapi: introduce x-query-rdma QMP command
  qapi: introduce x-query-ramblock QMP command
  qapi: introduce x-query-skeys QMP command
  qapi: introduce x-query-cmma QMP command
  qapi: introduce x-query-lapic QMP command
  qapi: introduce x-query-irq QMP command
  qapi: introduce x-query-jit QMP command
  qapi: introduce x-query-opcount QMP command

Dongli Zhang (1):
  hmp: synchronize cpu state for lapic info

 accel/tcg/cpu-exec.c                          |  51 +++++-
 accel/tcg/hmp.c                               |  24 ++-
 accel/tcg/translate-all.c                     |  84 ++++-----
 docs/devel/index.rst                          |   2 +-
 ...mands.rst => writing-monitor-commands.rst} | 134 ++++++++++++++-
 hmp-commands-info.hx                          |  15 --
 hw/core/cpu-common.c                          |   7 +
 hw/core/loader.c                              |  53 ++++--
 hw/core/machine-hmp-cmds.c                    |  33 +---
 hw/core/machine-qmp-cmds.c                    |  40 +++++
 hw/rdma/rdma_rm.c                             | 104 +++++------
 hw/rdma/rdma_rm.h                             |   2 +-
 hw/rdma/vmw/pvrdma_main.c                     |  31 ++--
 hw/s390x/s390-skeys.c                         |  35 +++-
 hw/s390x/s390-stattrib.c                      |  56 ++++--
 hw/usb/bus.c                                  |  36 +++-
 include/exec/cpu-all.h                        |   6 +-
 include/exec/ramlist.h                        |   2 +-
 include/hw/core/cpu.h                         |  10 ++
 include/hw/rdma/rdma.h                        |   2 +-
 include/monitor/hmp-target.h                  |   1 -
 include/qapi/type-helpers.h                   |  14 ++
 include/tcg/tcg.h                             |   4 +-
 monitor/hmp-cmds.c                            |  81 +++------
 monitor/misc.c                                |  30 +---
 monitor/qmp-cmds.c                            | 116 +++++++++++++
 qapi/common.json                              |  11 ++
 qapi/machine-target.json                      |  47 +++++
 qapi/machine.json                             | 110 ++++++++++++
 qapi/meson.build                              |   3 +
 qapi/qapi-type-helpers.c                      |  23 +++
 scripts/qapi/commands.py                      |   1 +
 softmmu/physmem.c                             |  19 ++-
 stubs/usb-dev-stub.c                          |   8 +
 target/i386/cpu-dump.c                        | 161 +++++++++---------
 target/i386/cpu.h                             |   4 +-
 target/i386/monitor.c                         |  50 ++++--
 tcg/tcg.c                                     |  98 ++++++-----
 tests/qtest/qmp-cmd-test.c                    |   8 +
 39 files changed, 1063 insertions(+), 453 deletions(-)
 rename docs/devel/{writing-qmp-commands.rst => writing-monitor-commands.rst} (78%)
 create mode 100644 include/qapi/type-helpers.h
 create mode 100644 qapi/qapi-type-helpers.c

-- 
2.31.1




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

end of thread, other threads:[~2021-11-09 14:59 UTC | newest]

Thread overview: 41+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-09-30 13:23 [PATCH v3 00/19] monitor: explicitly permit QMP commands to be added for all use cases Daniel P. Berrangé
2021-09-30 13:23 ` [PATCH v3 01/19] docs/devel: rename file for writing monitor commands Daniel P. Berrangé
2021-10-04 15:50   ` Eric Blake
2021-09-30 13:23 ` [PATCH v3 02/19] docs/devel: tweak headings in monitor command docs Daniel P. Berrangé
2021-09-30 13:23 ` [PATCH v3 03/19] docs/devel: document expectations for QAPI data modelling for QMP Daniel P. Berrangé
2021-10-04 12:13   ` Dr. David Alan Gilbert
2021-10-04 12:23     ` Daniel P. Berrangé
2021-10-28 14:31   ` Markus Armbruster
2021-10-28 15:24     ` Daniel P. Berrangé
2021-11-03 13:52       ` Daniel P. Berrangé
2021-11-04  5:43         ` Markus Armbruster
2021-11-04  8:54           ` Daniel P. Berrangé
2021-11-09  6:39             ` Markus Armbruster
2021-11-09  9:47               ` Daniel P. Berrangé
2021-11-09 14:58                 ` Markus Armbruster
2021-09-30 13:23 ` [PATCH v3 04/19] docs/devel: add example of command returning unstructured text Daniel P. Berrangé
2021-10-04 18:25   ` Eric Blake
2021-10-28 14:47   ` Markus Armbruster
2021-10-28 15:31     ` Daniel P. Berrangé
2021-10-28 17:13       ` Markus Armbruster
2021-09-30 13:23 ` [PATCH v3 05/19] docs/devel: document expectations for HMP commands in the future Daniel P. Berrangé
2021-10-04 18:33   ` Eric Blake
2021-10-28 14:47   ` Markus Armbruster
2021-09-30 13:23 ` [PATCH v3 06/19] monitor: remove 'info ioapic' HMP command Daniel P. Berrangé
2021-09-30 13:23 ` [PATCH v3 07/19] qapi: introduce x-query-roms QMP command Daniel P. Berrangé
2021-10-04 12:32   ` Dr. David Alan Gilbert
2021-10-04 15:57     ` Daniel P. Berrangé
2021-09-30 13:23 ` [PATCH v3 08/19] qapi: introduce x-query-profile " Daniel P. Berrangé
2021-09-30 13:23 ` [PATCH v3 09/19] qapi: introduce x-query-numa " Daniel P. Berrangé
2021-09-30 13:23 ` [PATCH v3 10/19] qapi: introduce x-query-usb " Daniel P. Berrangé
2021-09-30 13:23 ` [PATCH v3 11/19] qapi: introduce x-query-rdma " Daniel P. Berrangé
2021-09-30 13:23 ` [PATCH v3 12/19] qapi: introduce x-query-ramblock " Daniel P. Berrangé
2021-09-30 13:23 ` [PATCH v3 13/19] qapi: introduce x-query-skeys " Daniel P. Berrangé
2021-10-12  7:12   ` Thomas Huth
2021-10-18  9:50     ` Daniel P. Berrangé
2021-09-30 13:23 ` [PATCH v3 14/19] qapi: introduce x-query-cmma " Daniel P. Berrangé
2021-09-30 13:23 ` [PATCH v3 15/19] hmp: synchronize cpu state for lapic info Daniel P. Berrangé
2021-09-30 13:23 ` [PATCH v3 16/19] qapi: introduce x-query-lapic QMP command Daniel P. Berrangé
2021-09-30 13:23 ` [PATCH v3 17/19] qapi: introduce x-query-irq " Daniel P. Berrangé
2021-09-30 13:23 ` [PATCH v3 18/19] qapi: introduce x-query-jit " Daniel P. Berrangé
2021-09-30 13:23 ` [PATCH v3 19/19] qapi: introduce x-query-opcount " Daniel P. Berrangé

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.