Skip to contentSkip to conversation

Move QOM, qdev, machine core and dump code

PATCH In review Markus Armbruster 8 participants 57 messages Jun 19, 2019 – Jul 9, 2019

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

cover Move QOM, qdev, machine core and dump code

Split qom.json, qdev.json, machine.json, machine-target.json and dump.json off misc.json, so MAINTAINERS can cover them properly.

Move their QMP and HMP code similarly.

Move some code out of the the tree's root directory to better places.

Markus Armbruster (16):
Makefile: Don't add monitor/ twice to common-obj-y
hmp: Move hmp.h to include/monitor/
qapi: Split qom.json and qdev.json off misc.json
qom: Move QMP command handlers to qom/
qom: Move HMP command handlers to qom/
MAINTAINERS: Merge sections CPU, NUMA into Machine core
qapi: Split machine.json off misc.json
hw/core: Move numa.c to hw/core/
hw/core: Collect QMP command handlers in hw/core/ hw/core: Collect HMP command handlers in hw/core/
qapi: Split machine-target.json off target.json and misc.json
qapi: Rename target.json to misc-target.json
qapi: Split dump.json off misc.json
dump: Move the code to dump/
MAINTAINERS: Add Windows dump to section "Dump"
dump: Move HMP command handlers to dump/

Paolo Bonzini (1):
MAINTAINERS: new maintainers for QOM

 MAINTAINERS                               |   29 +-
 Makefile.objs                             |    2 +-
 Makefile.target                           |    5 +-
 cpus.c                                    |  187 ---
 dump/Makefile.objs                        |    3 +
 dump/dump-hmp-cmds.c                      |   88 ++
 dump.c => dump/dump.c                     |    4 +-
 win_dump.c => dump/win_dump.c             |    0
 win_dump.h => dump/win_dump.h             |    0
 hw/block/xen-block.c                      |    2 +-
 hw/core/Makefile.objs                     |    4 +
 hw/core/machine-hmp-cmds.c                |  164 +++
 hw/core/machine-qmp-cmds.c                |  328 ++++++
 numa.c => hw/core/numa.c                  |   64 +-
 hw/core/qdev.c                            |    2 +-
 hw/ppc/spapr_rtc.c                        |    2 +-
 hw/s390x/s390-skeys.c                     |    2 +-
 hw/timer/mc146818rtc.c                    |    4 +-
 include/hw/boards.h                       |    1 +
 hmp.h => include/monitor/hmp.h            |    3 +
 include/sysemu/dump.h                     |    2 +-
 include/sysemu/hostmem.h                  |    2 +-
 include/sysemu/numa.h                     |    2 +
 monitor/hmp-cmds.c                        |  238 +---
 monitor/misc.c                            |   47 +-
 monitor/qmp-cmds.c                        |  315 +----
 qapi/Makefile.objs                        |    7 +-
 qapi/dump.json                            |  200 ++++
 qapi/{target.json => machine-target.json} |  304 +----
 qapi/machine.json                         |  697 +++++++++++
 qapi/misc-target.json                     |  268 +++++
 qapi/misc.json                            | 1304 ---------------------
 qapi/qapi-schema.json                     |    7 +-
 qapi/qdev.json                            |  125 ++
 qapi/qom.json                             |  244 ++++
 qdev-monitor.c                            |    2 +-
 qom/Makefile.objs                         |    1 +
 qom/qom-hmp-cmds.c                        |   62 +
 qom/qom-qmp-cmds.c                        |  323 +++++
 target/arm/helper.c                       |    2 +-
 target/arm/monitor.c                      |    2 +-
 target/i386/cpu.c                         |    4 +-
 target/i386/monitor.c                     |    2 +-
 target/i386/sev_i386.h                    |    2 +-
 target/mips/helper.c                      |    2 +-
 target/nios2/monitor.c                    |    2 +-
 target/ppc/monitor.c                      |    2 +-
 target/ppc/translate_init.inc.c           |    2 +-
 target/s390x/cpu.c                        |    2 +-
 target/s390x/cpu_models.c                 |    2 +-
 target/s390x/sigp.c                       |    2 +-
 target/sh4/monitor.c                      |    2 +-
 target/sparc/monitor.c                    |    2 +-
 target/xtensa/monitor.c                   |    2 +-
 vl.c                                      |   45 -
 55 files changed, 2629 insertions(+), 2492 deletions(-)
 create mode 100644 dump/Makefile.objs
 create mode 100644 dump/dump-hmp-cmds.c
 rename dump.c => dump/dump.c (99%)
 rename win_dump.c => dump/win_dump.c (100%)
 rename win_dump.h => dump/win_dump.h (100%)
 create mode 100644 hw/core/machine-hmp-cmds.c
 create mode 100644 hw/core/machine-qmp-cmds.c
 rename numa.c => hw/core/numa.c (90%)
 rename hmp.h => include/monitor/hmp.h (98%)
 create mode 100644 qapi/dump.json
 rename qapi/{target.json => machine-target.json} (61%)
 create mode 100644 qapi/machine.json
 create mode 100644 qapi/misc-target.json
 create mode 100644 qapi/qdev.json
 create mode 100644 qapi/qom.json
 create mode 100644 qom/qom-hmp-cmds.c
 create mode 100644 qom/qom-qmp-cmds.c
Signature · 1 line
2.21.0
#1 lore raw

PATCH 1/17 MAINTAINERS: new maintainers for QOM

From: Paolo Bonzini <[email protected]>

QOM is not a particularly active subsystem now: 51 commits in two years. But, we need active maintainers to review and merge patches, and Git shows the following top committers taking on QOM:

Markus Armbruster <[email protected]> Eduardo Habkost <[email protected]> Paolo Bonzini <[email protected]> Marc-André Lureau <[email protected]> Eric Blake <[email protected]>

I volunteer myself, and also volunteer Eduardo and Daniel as reviewers since they understand the code well.

Cc Andreas Färber <[email protected]>
Cc Daniel P. Berrange <[email protected]>
Cc Eduardo Habkost <[email protected]>

Message-Id: <[email protected]>

---
 MAINTAINERS | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)
MAINTAINERS +3 -2
index d32c5c2313..63390eadb5 100644
@@ -2029,9 +2029,10 @@ F: docs/interop/qemu-ga-ref.texi
 T: git https://github.com/mdroth/qemu.git qga
 
 QOM
-M: Andreas Färber <[email protected]>
+M: Paolo Bonzini <[email protected]>
+R: Daniel P. Berrange <[email protected]>
+R: Eduardo Habkost <[email protected]>
 S: Supported
-T: git https://github.com/afaerber/qemu-cpu.git qom-next
 F: include/qom/
 X: include/qom/cpu.h
 F: qom/
Signature · 1 line
2.21.0
#2 lore raw

Re: [Qemu-devel] [PATCH 01/17] MAINTAINERS: new maintainers for QOM

Am 19.06.19 um 22:10 schrieb Markus Armbruster:

Quoted 15 lines

From: Paolo Bonzini <[email protected]>

QOM is not a particularly active subsystem now: 51 commits in two years. But, we need active maintainers to review and merge patches, and Git shows the following top committers taking on QOM:

Markus Armbruster <[email protected]> Eduardo Habkost <[email protected]> Paolo Bonzini <[email protected]> Marc-André Lureau <[email protected]> Eric Blake <[email protected]>

I volunteer myself, and also volunteer Eduardo and Daniel as reviewers since they understand the code well.

Quoted 7 lines
Cc Andreas Färber <[email protected]>
Cc Daniel P. Berrange <[email protected]>
Cc Eduardo Habkost <[email protected]>

Message-Id: <[email protected]>

I'm pretty sure I gave an Acked-by that's missing above?

Regards,
Andreas

Signature · 3 lines
SUSE Linux GmbH, Maxfeldstr. 5, 90409 Nürnberg, Germany
GF: Felix Imendörffer, Mary Higgins, Sri Rasiah
HRB 21284 (AG Nürnberg)
#3 lore raw

Re: [Qemu-devel] [PATCH 01/17] MAINTAINERS: new maintainers for QOM

Quoted 24 lines · Andreas Färber

Am 19.06.19 um 22:10 schrieb Markus Armbruster:

Quoted 15 lines

From: Paolo Bonzini <[email protected]>

QOM is not a particularly active subsystem now: 51 commits in two years. But, we need active maintainers to review and merge patches, and Git shows the following top committers taking on QOM:

Markus Armbruster <[email protected]> Eduardo Habkost <[email protected]> Paolo Bonzini <[email protected]> Marc-André Lureau <[email protected]> Eric Blake <[email protected]>

I volunteer myself, and also volunteer Eduardo and Daniel as reviewers since they understand the code well.

Quoted 7 lines
Cc Andreas Färber <[email protected]>
Cc Daniel P. Berrange <[email protected]>
Cc Eduardo Habkost <[email protected]>

Message-Id: <[email protected]>

Quoted 1 line

I'm pretty sure I gave an Acked-by that's missing above?

Yes, and Markus even replied to it:

https://patchew.org/QEMU/[email protected]/

Paolo

#4 lore raw

Re: [Qemu-devel] [PATCH 01/17] MAINTAINERS: new maintainers for QOM

In reply to Andreas Färber
Quoted 24 lines · Andreas Färber

Am 19.06.19 um 22:10 schrieb Markus Armbruster:

Quoted 15 lines

From: Paolo Bonzini <[email protected]>

QOM is not a particularly active subsystem now: 51 commits in two years. But, we need active maintainers to review and merge patches, and Git shows the following top committers taking on QOM:

Markus Armbruster <[email protected]> Eduardo Habkost <[email protected]> Paolo Bonzini <[email protected]> Marc-André Lureau <[email protected]> Eric Blake <[email protected]>

I volunteer myself, and also volunteer Eduardo and Daniel as reviewers since they understand the code well.

Quoted 7 lines
Cc Andreas Färber <[email protected]>
Cc Daniel P. Berrange <[email protected]>
Cc Eduardo Habkost <[email protected]>

Message-Id: <[email protected]>

Quoted 1 line

I'm pretty sure I gave an Acked-by that's missing above?

My fault. I'll make sure it's in v2 or else the pull request.

Reviewed-by on v1 1/17
#5 lore raw

Re: [Qemu-devel] [PATCH 01/17] MAINTAINERS: new maintainers for QOM

In reply to Markus Armbruster
Quoted 20 lines · Markus Armbruster

From: Paolo Bonzini <[email protected]>

QOM is not a particularly active subsystem now: 51 commits in two years. But, we need active maintainers to review and merge patches, and Git shows the following top committers taking on QOM:

Markus Armbruster <[email protected]> Eduardo Habkost <[email protected]> Paolo Bonzini <[email protected]> Marc-André Lureau <[email protected]> Eric Blake <[email protected]>

I volunteer myself, and also volunteer Eduardo and Daniel as reviewers since they understand the code well.

Cc Andreas Färber <[email protected]>
Cc Daniel P. Berrange <[email protected]>
Cc Eduardo Habkost <[email protected]>
Quoted 5 lines

Message-Id: <[email protected]>

---
 MAINTAINERS | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

Regards,
Daniel

Signature · 3 lines
|: https://berrange.com      -o-    https://www.flickr.com/photos/dberrange :|
|: https://libvirt.org         -o-            https://fstop138.berrange.com :|
|: https://entangle-photo.org    -o-    https://www.instagram.com/dberrange :|
#6 lore raw

PATCH 2/17 Makefile: Don't add monitor/ twice to common-obj-y

In reply to Markus Armbruster

Both commit f1b3ccfaa68 "monitor: Move {hmp, qmp}.c to monitor/{hmp, qmp}-cmds.c" and commit 7e3c0deab1b "monitor: Split out monitor/qmp.c" added monitor/ to common-obj-y ifeq ($(CONFIG_SOFTMMU),y). Revert the second addition.

---
 Makefile.objs | 1 -
 1 file changed, 1 deletion(-)
Makefile.objs +0 -1
index 658cfc9d9f..7494d6143b 100644
@@ -85,7 +85,6 @@ common-obj-$(CONFIG_FDT) += device_tree.o
 # qapi
 
 common-obj-y += qapi/
-common-obj-y += monitor/
 endif
 
 #######################################################################
Signature · 1 line
2.21.0
Reviewed-by on v1 2/17
#7 lore raw

Re: [Qemu-devel] [PATCH 02/17] Makefile: Don't add monitor/ twice to common-obj-y

Quoted 9 lines · Markus Armbruster

Both commit f1b3ccfaa68 "monitor: Move {hmp, qmp}.c to monitor/{hmp, qmp}-cmds.c" and commit 7e3c0deab1b "monitor: Split out monitor/qmp.c" added monitor/ to common-obj-y ifeq ($(CONFIG_SOFTMMU),y). Revert the second addition.

---
 Makefile.objs | 1 -
 1 file changed, 1 deletion(-)

Regards,
Daniel

Signature · 3 lines
|: https://berrange.com      -o-    https://www.flickr.com/photos/dberrange :|
|: https://libvirt.org         -o-            https://fstop138.berrange.com :|
|: https://entangle-photo.org    -o-    https://www.instagram.com/dberrange :|
#8 lore raw

PATCH 3/17 hmp: Move hmp.h to include/monitor/

In reply to Markus Armbruster
Cc "Dr. David Alan Gilbert" <[email protected]>
---
 hmp.h => include/monitor/hmp.h | 0
 monitor/hmp-cmds.c             | 2 +-
 monitor/misc.c                 | 2 +-
 target/i386/monitor.c          | 2 +-
 target/nios2/monitor.c         | 2 +-
 target/ppc/monitor.c           | 2 +-
 target/sh4/monitor.c           | 2 +-
 target/sparc/monitor.c         | 2 +-
 target/xtensa/monitor.c        | 2 +-
 9 files changed, 8 insertions(+), 8 deletions(-)
 rename hmp.h => include/monitor/hmp.h (100%)
include/monitor/hmp.h renamed from hmp.h +0 -0
similarity index 100%
rename from hmp.h
rename to include/monitor/hmp.h
monitor/hmp-cmds.c +1 -1
index c283dde0e9..5082fcd016 100644
@@ -14,7 +14,7 @@
  */
 
 #include "qemu/osdep.h"
-#include "hmp.h"
+#include "monitor/hmp.h"
 #include "net/net.h"
 #include "net/eth.h"
 #include "chardev/char.h"
monitor/misc.c +1 -1
index bf9faceb86..2fb6896e84 100644
@@ -56,13 +56,13 @@
 #include "qom/object_interfaces.h"
 #include "trace/control.h"
 #include "monitor/hmp-target.h"
+#include "monitor/hmp.h"
 #ifdef CONFIG_TRACE_SIMPLE
 #include "trace/simple.h"
 #endif
 #include "exec/memory.h"
 #include "exec/exec-all.h"
 #include "qemu/option.h"
-#include "hmp.h"
 #include "qemu/thread.h"
 #include "block/qapi.h"
 #include "qapi/qapi-commands.h"
target/i386/monitor.c +1 -1
index 56e2dbece7..1f3b532fc2 100644
@@ -26,11 +26,11 @@
 #include "cpu.h"
 #include "monitor/monitor.h"
 #include "monitor/hmp-target.h"
+#include "monitor/hmp.h"
 #include "qapi/qmp/qdict.h"
 #include "hw/i386/pc.h"
 #include "sysemu/kvm.h"
 #include "sysemu/sev.h"
-#include "hmp.h"
 #include "qapi/error.h"
 #include "sev_i386.h"
 #include "qapi/qapi-commands-misc.h"
target/nios2/monitor.c +1 -1
index d5e3393716..6646836df5 100644
@@ -25,7 +25,7 @@
 #include "cpu.h"
 #include "monitor/monitor.h"
 #include "monitor/hmp-target.h"
-#include "hmp.h"
+#include "monitor/hmp.h"
 
 void hmp_info_tlb(Monitor *mon, const QDict *qdict)
 {
target/ppc/monitor.c +1 -1
index 7f8360d903..a5a177d717 100644
@@ -27,7 +27,7 @@
 #include "monitor/monitor.h"
 #include "qemu/ctype.h"
 #include "monitor/hmp-target.h"
-#include "hmp.h"
+#include "monitor/hmp.h"
 
 static target_long monitor_get_ccr(const struct MonitorDef *md, int val)
 {
target/sh4/monitor.c +1 -1
index 4c7f36c9cc..918a5ccfc6 100644
@@ -25,7 +25,7 @@
 #include "cpu.h"
 #include "monitor/monitor.h"
 #include "monitor/hmp-target.h"
-#include "hmp.h"
+#include "monitor/hmp.h"
 
 static void print_tlb(Monitor *mon, int idx, tlb_t *tlb)
 {
target/sparc/monitor.c +1 -1
index 3ec3b51a3d..a7ea287cbc 100644
@@ -25,7 +25,7 @@
 #include "cpu.h"
 #include "monitor/monitor.h"
 #include "monitor/hmp-target.h"
-#include "hmp.h"
+#include "monitor/hmp.h"
 
 
 void hmp_info_tlb(Monitor *mon, const QDict *qdict)
target/xtensa/monitor.c +1 -1
index cf7957bb63..608173c238 100644
@@ -25,7 +25,7 @@
 #include "cpu.h"
 #include "monitor/monitor.h"
 #include "monitor/hmp-target.h"
-#include "hmp.h"
+#include "monitor/hmp.h"
 
 void hmp_info_tlb(Monitor *mon, const QDict *qdict)
 {
Signature · 1 line
2.21.0
Reviewed-by on v1 3/17
#9 lore raw

Re: [Qemu-devel] [PATCH 03/17] hmp: Move hmp.h to include/monitor/

Quoted 14 lines · Markus Armbruster
Cc "Dr. David Alan Gilbert" <[email protected]>
---
 hmp.h => include/monitor/hmp.h | 0
 monitor/hmp-cmds.c             | 2 +-
 monitor/misc.c                 | 2 +-
 target/i386/monitor.c          | 2 +-
 target/nios2/monitor.c         | 2 +-
 target/ppc/monitor.c           | 2 +-
 target/sh4/monitor.c           | 2 +-
 target/sparc/monitor.c         | 2 +-
 target/xtensa/monitor.c        | 2 +-
 9 files changed, 8 insertions(+), 8 deletions(-)
 rename hmp.h => include/monitor/hmp.h (100%)

Regards,
Daniel

Signature · 3 lines
|: https://berrange.com      -o-    https://www.flickr.com/photos/dberrange :|
|: https://libvirt.org         -o-            https://fstop138.berrange.com :|
|: https://entangle-photo.org    -o-    https://www.instagram.com/dberrange :|
Reviewed-by on v1 3/17
#10 lore raw

Re: [Qemu-devel] [PATCH 03/17] hmp: Move hmp.h to include/monitor/

In reply to Markus Armbruster
Quoted 2 lines · * Markus Armbruster ([email protected]) wrote:
Cc "Dr. David Alan Gilbert" <[email protected]>
Quoted 134 lines
---
 hmp.h => include/monitor/hmp.h | 0
 monitor/hmp-cmds.c             | 2 +-
 monitor/misc.c                 | 2 +-
 target/i386/monitor.c          | 2 +-
 target/nios2/monitor.c         | 2 +-
 target/ppc/monitor.c           | 2 +-
 target/sh4/monitor.c           | 2 +-
 target/sparc/monitor.c         | 2 +-
 target/xtensa/monitor.c        | 2 +-
 9 files changed, 8 insertions(+), 8 deletions(-)
 rename hmp.h => include/monitor/hmp.h (100%)
include/monitor/hmp.h renamed from hmp.h +0 -0
similarity index 100%
rename from hmp.h
rename to include/monitor/hmp.h
monitor/hmp-cmds.c +1 -1
index c283dde0e9..5082fcd016 100644
@@ -14,7 +14,7 @@
  */
 
 #include "qemu/osdep.h"
-#include "hmp.h"
+#include "monitor/hmp.h"
 #include "net/net.h"
 #include "net/eth.h"
 #include "chardev/char.h"
monitor/misc.c +1 -1
index bf9faceb86..2fb6896e84 100644
@@ -56,13 +56,13 @@
 #include "qom/object_interfaces.h"
 #include "trace/control.h"
 #include "monitor/hmp-target.h"
+#include "monitor/hmp.h"
 #ifdef CONFIG_TRACE_SIMPLE
 #include "trace/simple.h"
 #endif
 #include "exec/memory.h"
 #include "exec/exec-all.h"
 #include "qemu/option.h"
-#include "hmp.h"
 #include "qemu/thread.h"
 #include "block/qapi.h"
 #include "qapi/qapi-commands.h"
target/i386/monitor.c +1 -1
index 56e2dbece7..1f3b532fc2 100644
@@ -26,11 +26,11 @@
 #include "cpu.h"
 #include "monitor/monitor.h"
 #include "monitor/hmp-target.h"
+#include "monitor/hmp.h"
 #include "qapi/qmp/qdict.h"
 #include "hw/i386/pc.h"
 #include "sysemu/kvm.h"
 #include "sysemu/sev.h"
-#include "hmp.h"
 #include "qapi/error.h"
 #include "sev_i386.h"
 #include "qapi/qapi-commands-misc.h"
target/nios2/monitor.c +1 -1
index d5e3393716..6646836df5 100644
@@ -25,7 +25,7 @@
 #include "cpu.h"
 #include "monitor/monitor.h"
 #include "monitor/hmp-target.h"
-#include "hmp.h"
+#include "monitor/hmp.h"
 
 void hmp_info_tlb(Monitor *mon, const QDict *qdict)
 {
target/ppc/monitor.c +1 -1
index 7f8360d903..a5a177d717 100644
@@ -27,7 +27,7 @@
 #include "monitor/monitor.h"
 #include "qemu/ctype.h"
 #include "monitor/hmp-target.h"
-#include "hmp.h"
+#include "monitor/hmp.h"
 
 static target_long monitor_get_ccr(const struct MonitorDef *md, int val)
 {
target/sh4/monitor.c +1 -1
index 4c7f36c9cc..918a5ccfc6 100644
@@ -25,7 +25,7 @@
 #include "cpu.h"
 #include "monitor/monitor.h"
 #include "monitor/hmp-target.h"
-#include "hmp.h"
+#include "monitor/hmp.h"
 
 static void print_tlb(Monitor *mon, int idx, tlb_t *tlb)
 {
target/sparc/monitor.c +1 -1
index 3ec3b51a3d..a7ea287cbc 100644
@@ -25,7 +25,7 @@
 #include "cpu.h"
 #include "monitor/monitor.h"
 #include "monitor/hmp-target.h"
-#include "hmp.h"
+#include "monitor/hmp.h"
 
 
 void hmp_info_tlb(Monitor *mon, const QDict *qdict)
target/xtensa/monitor.c +1 -1
index cf7957bb63..608173c238 100644
@@ -25,7 +25,7 @@
 #include "cpu.h"
 #include "monitor/monitor.h"
 #include "monitor/hmp-target.h"
-#include "hmp.h"
+#include "monitor/hmp.h"
 
 void hmp_info_tlb(Monitor *mon, const QDict *qdict)
 {
Signature · 1 line
2.21.0

--
Dr. David Alan Gilbert / [email protected] / Manchester, UK

#11 lore raw

PATCH 4/17 qapi: Split qom.json and qdev.json off misc.json

In reply to Markus Armbruster

Move commands object-add, object-del, qom-get, qom-list, qom-list-properties, qom-list-types, and qom-set with their types from misc.json to new qom.json. Add qom.json to MAINTAINERS section QOM.

Move commands device-list-properties, device_add, device-del, and event DEVICE_DELETED from misc.json to new qdev.json. qdev.json remains uncovered by MAINTAINERS, like the rest of qdev.

Cc Paolo Bonzini <[email protected]>
Cc "Daniel P. Berrange" <[email protected]>
Cc Eduardo Habkost <[email protected]>
---
 MAINTAINERS           |   1 +
 hw/block/xen-block.c  |   2 +-
 hw/core/qdev.c        |   2 +-
 monitor/hmp-cmds.c    |   1 +
 monitor/qmp-cmds.c    |   1 +
 qapi/Makefile.objs    |   5 +-
 qapi/misc.json        | 351 ------------------------------------------
 qapi/qapi-schema.json |   2 +
 qapi/qdev.json        | 125 +++++++++++++++
 qapi/qom.json         | 244 +++++++++++++++++++++++++++++
 qdev-monitor.c        |   2 +-
 11 files changed, 380 insertions(+), 356 deletions(-)
 create mode 100644 qapi/qdev.json
 create mode 100644 qapi/qom.json
MAINTAINERS +1 -0
index 63390eadb5..1aef0afaf7 100644
@@ -2035,6 +2035,7 @@ R: Eduardo Habkost <[email protected]>
 S: Supported
 F: include/qom/
 X: include/qom/cpu.h
+F: qapi/qom.json
 F: qom/
 X: qom/cpu.c
 F: tests/check-qom-interface.c
hw/block/xen-block.c +1 -1
index 4de537aef4..654b79f921 100644
@@ -11,7 +11,7 @@
 #include "qemu/option.h"
 #include "qapi/error.h"
 #include "qapi/qapi-commands-block-core.h"
-#include "qapi/qapi-commands-misc.h"
+#include "qapi/qapi-commands-qom.h"
 #include "qapi/qapi-visit-block-core.h"
 #include "qapi/qobject-input-visitor.h"
 #include "qapi/visitor.h"
hw/core/qdev.c +1 -1
index f9b6efe509..94ebc0a4a1 100644
@@ -29,7 +29,7 @@
 #include "hw/qdev.h"
 #include "sysemu/sysemu.h"
 #include "qapi/error.h"
-#include "qapi/qapi-events-misc.h"
+#include "qapi/qapi-events-qdev.h"
 #include "qapi/qmp/qerror.h"
 #include "qapi/visitor.h"
 #include "qemu/error-report.h"
monitor/hmp-cmds.c +1 -0
index 5082fcd016..d94ab7563e 100644
@@ -34,6 +34,7 @@
 #include "qapi/qapi-commands-migration.h"
 #include "qapi/qapi-commands-misc.h"
 #include "qapi/qapi-commands-net.h"
+#include "qapi/qapi-commands-qdev.h"
 #include "qapi/qapi-commands-rocker.h"
 #include "qapi/qapi-commands-run-state.h"
 #include "qapi/qapi-commands-tpm.h"
monitor/qmp-cmds.c +1 -0
index f1b1e4f08b..ae7f201dc0 100644
@@ -34,6 +34,7 @@
 #include "qapi/error.h"
 #include "qapi/qapi-commands-block-core.h"
 #include "qapi/qapi-commands-misc.h"
+#include "qapi/qapi-commands-qdev.h"
 #include "qapi/qapi-commands-ui.h"
 #include "qapi/qmp/qdict.h"
 #include "qapi/qmp/qerror.h"
qapi/Makefile.objs +3 -2
index 729e5185c5..40b1dcffc4 100644
@@ -6,8 +6,9 @@ util-obj-y += qmp-event.o
 util-obj-y += qapi-util.o
 
 QAPI_COMMON_MODULES = audio authz block-core block char common crypto
-QAPI_COMMON_MODULES += introspect job migration misc net rdma rocker
-QAPI_COMMON_MODULES += run-state sockets tpm trace transaction ui
+QAPI_COMMON_MODULES += introspect job migration misc net
+QAPI_COMMON_MODULES += qdev qom rdma rocker run-state sockets tpm
+QAPI_COMMON_MODULES += trace transaction ui
 QAPI_TARGET_MODULES = target
 QAPI_MODULES = $(QAPI_COMMON_MODULES) $(QAPI_TARGET_MODULES)
 
qapi/misc.json +0 -351

375 lines not on this page · raw message

qapi/qapi-schema.json +2 -0
index 4bd1223637..d6cf90a85a 100644
@@ -97,6 +97,8 @@
 { 'include': 'transaction.json' }
 { 'include': 'trace.json' }
 { 'include': 'introspect.json' }
+{ 'include': 'qom.json' }
+{ 'include': 'qdev.json' }
 { 'include': 'misc.json' }
 { 'include': 'target.json' }
 { 'include': 'audio.json' }
qapi/qdev.json new file +125 -0

125 lines not on this page · raw message

qapi/qom.json new file +244 -0

244 lines not on this page · raw message

qdev-monitor.c +1 -1
index 373b9ad445..63a87e9632 100644
@@ -24,7 +24,7 @@
 #include "monitor/qdev.h"
 #include "sysemu/arch_init.h"
 #include "qapi/error.h"
-#include "qapi/qapi-commands-misc.h"
+#include "qapi/qapi-commands-qdev.h"
 #include "qapi/qmp/qdict.h"
 #include "qapi/qmp/qerror.h"
 #include "qemu/config-file.h"
Signature · 1 line
2.21.0
#12 lore raw

Re: [Qemu-devel] [PATCH 04/17] qapi: Split qom.json and qdev.json off misc.json

Quoted 3 lines · Markus Armbruster

Move commands device-list-properties, device_add, device-del, and event DEVICE_DELETED from misc.json to new qdev.json. qdev.json remains uncovered by MAINTAINERS, like the rest of qdev.

qdev should be added to either QOM or machine core. QOM would be fine for me as the (newly,self)-appointed maintainer.

Paolo

#13 lore raw

Re: [Qemu-devel] [PATCH 04/17] qapi: Split qom.json and qdev.json off misc.json

Quoted 7 lines · Paolo Bonzini
Quoted 3 lines · Markus Armbruster

Move commands device-list-properties, device_add, device-del, and event DEVICE_DELETED from misc.json to new qdev.json. qdev.json remains uncovered by MAINTAINERS, like the rest of qdev.

qdev should be added to either QOM or machine core. QOM would be fine for me as the (newly,self)-appointed maintainer.

Awesome! Daniel, Eduardo, any objections?

I figure these are the files to add:

MAINTAINERS +6 -0
index 63390eadb5..e2cb1726dd 100644
@@ -2033,12 +2033,18 @@ M: Paolo Bonzini <[email protected]>
 R: Daniel P. Berrange <[email protected]>
 R: Eduardo Habkost <[email protected]>
 S: Supported
+F: docs/qdev-device-use.txt
+F: hw/core/qdev*
+F: include/hw/qdev*
+F: include/monitor/qdev.h
 F: include/qom/
 X: include/qom/cpu.h
+F: qdev-monitor.c
 F: qom/
 X: qom/cpu.c
 F: tests/check-qom-interface.c
 F: tests/check-qom-proplist.c
+F: tests/test-qdev-global-props.c
 
 QMP
 M: Markus Armbruster <[email protected]>
#14 lore raw

Re: [Qemu-devel] [PATCH 04/17] qapi: Split qom.json and qdev.json off misc.json

Quoted 27 lines · Markus Armbruster
Quoted 7 lines · Paolo Bonzini
Quoted 3 lines · Markus Armbruster

Move commands device-list-properties, device_add, device-del, and event DEVICE_DELETED from misc.json to new qdev.json. qdev.json remains uncovered by MAINTAINERS, like the rest of qdev.

qdev should be added to either QOM or machine core. QOM would be fine for me as the (newly,self)-appointed maintainer.

Awesome! Daniel, Eduardo, any objections?

I figure these are the files to add:

MAINTAINERS +4 -0
index 63390eadb5..e2cb1726dd 100644
@@ -2033,12 +2033,18 @@ M: Paolo Bonzini <[email protected]>
 R: Daniel P. Berrange <[email protected]>
 R: Eduardo Habkost <[email protected]>
 S: Supported
+F: docs/qdev-device-use.txt
+F: hw/core/qdev*
+F: include/hw/qdev*
+F: include/monitor/qdev.h
 F: include/qom/

MAINTAINERS M: Paolo Bonzini <[email protected]> · line 2050

Quoted 10 lines
MAINTAINERS +2 -0
 X: include/qom/cpu.h
+F: qdev-monitor.c
 F: qom/
 X: qom/cpu.c
 F: tests/check-qom-interface.c
 F: tests/check-qom-proplist.c
+F: tests/test-qdev-global-props.c
 
 QMP
 M: Markus Armbruster <[email protected]>

For this addition

Regards,
Daniel

Signature · 3 lines
|: https://berrange.com      -o-    https://www.flickr.com/photos/dberrange :|
|: https://libvirt.org         -o-            https://fstop138.berrange.com :|
|: https://entangle-photo.org    -o-    https://www.instagram.com/dberrange :|
Reviewed-by on v1 4/17
#15 lore raw

Re: [Qemu-devel] [PATCH 04/17] qapi: Split qom.json and qdev.json off misc.json

In reply to Markus Armbruster
Quoted 12 lines · Markus Armbruster

Move commands object-add, object-del, qom-get, qom-list, qom-list-properties, qom-list-types, and qom-set with their types from misc.json to new qom.json. Add qom.json to MAINTAINERS section QOM.

Move commands device-list-properties, device_add, device-del, and event DEVICE_DELETED from misc.json to new qdev.json. qdev.json remains uncovered by MAINTAINERS, like the rest of qdev.

Cc Paolo Bonzini <[email protected]>
Cc "Daniel P. Berrange" <[email protected]>
Cc Eduardo Habkost <[email protected]>
Quoted 15 lines
---
 MAINTAINERS           |   1 +
 hw/block/xen-block.c  |   2 +-
 hw/core/qdev.c        |   2 +-
 monitor/hmp-cmds.c    |   1 +
 monitor/qmp-cmds.c    |   1 +
 qapi/Makefile.objs    |   5 +-
 qapi/misc.json        | 351 ------------------------------------------
 qapi/qapi-schema.json |   2 +
 qapi/qdev.json        | 125 +++++++++++++++
 qapi/qom.json         | 244 +++++++++++++++++++++++++++++
 qdev-monitor.c        |   2 +-
 11 files changed, 380 insertions(+), 356 deletions(-)
 create mode 100644 qapi/qdev.json
 create mode 100644 qapi/qom.json

MAINTAINERS R: Eduardo Habkost <[email protected]> · line 2041

Quoted 13 lines
MAINTAINERS +1 -0
index 63390eadb5..1aef0afaf7 100644
@@ -2035,6 +2035,7 @@ R: Eduardo Habkost <[email protected]>
 S: Supported
 F: include/qom/
 X: include/qom/cpu.h
+F: qapi/qom.json
 F: qom/
 X: qom/cpu.c
 F: tests/check-qom-interface.c

So we don't have any designated "qdev" maintainers i see.

Regards,
Daniel

Signature · 3 lines
|: https://berrange.com      -o-    https://www.flickr.com/photos/dberrange :|
|: https://libvirt.org         -o-            https://fstop138.berrange.com :|
|: https://entangle-photo.org    -o-    https://www.instagram.com/dberrange :|
#16 lore raw

PATCH 5/17 qom: Move QMP command handlers to qom/

In reply to Markus Armbruster

The handlers for qapi/qom.json's QMP commands are in monitor/qmp-cmds.c. Move them to new qom/qom-qmp-cmds.c, where they are covered by MAINTAINERS section QOM, just like qapi/qom.json.

Move along qmp_device_list_properties() even though it's specified in qapi/qdev.json, because it's so similar to qmp_qom_list_properties().

Cc Paolo Bonzini <[email protected]>
Cc "Daniel P. Berrange" <[email protected]>
Cc Eduardo Habkost <[email protected]>
---
 monitor/qmp-cmds.c | 303 ------------------------------------------
 qom/Makefile.objs  |   1 +
 qom/qom-qmp-cmds.c | 323 +++++++++++++++++++++++++++++++++++++++++++++
 3 files changed, 324 insertions(+), 303 deletions(-)
 create mode 100644 qom/qom-qmp-cmds.c
monitor/qmp-cmds.c +0 -303
index ae7f201dc0..884eeaab80 100644
@@ -27,20 +27,14 @@
 #include "ui/vnc.h"
 #include "sysemu/kvm.h"
 #include "sysemu/arch_init.h"
-#include "hw/qdev.h"
 #include "sysemu/blockdev.h"
 #include "sysemu/block-backend.h"
-#include "qom/qom-qobject.h"
 #include "qapi/error.h"
 #include "qapi/qapi-commands-block-core.h"
 #include "qapi/qapi-commands-misc.h"
-#include "qapi/qapi-commands-qdev.h"
 #include "qapi/qapi-commands-ui.h"
-#include "qapi/qmp/qdict.h"
 #include "qapi/qmp/qerror.h"
-#include "qapi/qobject-input-visitor.h"
 #include "hw/boards.h"
-#include "qom/object_interfaces.h"
 #include "hw/mem/memory-device.h"
 #include "hw/acpi/acpi_dev_interface.h"
 
@@ -197,69 +191,6 @@ void qmp_system_wakeup(Error **errp)
     qemu_system_wakeup_request(QEMU_WAKEUP_REASON_OTHER, errp);
 }
 
-ObjectPropertyInfoList *qmp_qom_list(const char *path, Error **errp)
-{
-    Object *obj;
-    bool ambiguous = false;
-    ObjectPropertyInfoList *props = NULL;
-    ObjectProperty *prop;
-    ObjectPropertyIterator iter;
-
-    obj = object_resolve_path(path, &ambiguous);
-    if (obj == NULL) {
-        if (ambiguous) {
-            error_setg(errp, "Path '%s' is ambiguous", path);
-        } else {
-            error_set(errp, ERROR_CLASS_DEVICE_NOT_FOUND,
-                      "Device '%s' not found", path);
-        }
-        return NULL;
-    }
-
-    object_property_iter_init(&iter, obj);
-    while ((prop = object_property_iter_next(&iter))) {
-        ObjectPropertyInfoList *entry = g_malloc0(sizeof(*entry));
-
-        entry->value = g_malloc0(sizeof(ObjectPropertyInfo));
-        entry->next = props;
-        props = entry;
-
-        entry->value->name = g_strdup(prop->name);
-        entry->value->type = g_strdup(prop->type);
-    }
-
-    return props;
-}
-
-void qmp_qom_set(const char *path, const char *property, QObject *value,
-                 Error **errp)
-{
-    Object *obj;
-
-    obj = object_resolve_path(path, NULL);
-    if (!obj) {
-        error_set(errp, ERROR_CLASS_DEVICE_NOT_FOUND,
-                  "Device '%s' not found", path);
-        return;
-    }
-
-    object_property_set_qobject(obj, value, property, errp);
-}
-
-QObject *qmp_qom_get(const char *path, const char *property, Error **errp)
-{
-    Object *obj;
-
-    obj = object_resolve_path(path, NULL);
-    if (!obj) {
-        error_set(errp, ERROR_CLASS_DEVICE_NOT_FOUND,
-                  "Device '%s' not found", path);
-        return NULL;
-    }
-
-    return object_property_get_qobject(obj, property, errp);
-}
-
 void qmp_set_password(const char *protocol, const char *password,
                       bool has_connected, const char *connected, Error **errp)
 {
@@ -408,208 +339,6 @@ void qmp_change(const char *device, const char *target,
     }
 }
 
-static void qom_list_types_tramp(ObjectClass *klass, void *data)
-{
-    ObjectTypeInfoList *e, **pret = data;
-    ObjectTypeInfo *info;
-    ObjectClass *parent = object_class_get_parent(klass);
-
-    info = g_malloc0(sizeof(*info));
-    info->name = g_strdup(object_class_get_name(klass));
-    info->has_abstract = info->abstract = object_class_is_abstract(klass);
-    if (parent) {
-        info->has_parent = true;
-        info->parent = g_strdup(object_class_get_name(parent));
-    }
-
-    e = g_malloc0(sizeof(*e));
-    e->value = info;
-    e->next = *pret;
-    *pret = e;
-}
-
-ObjectTypeInfoList *qmp_qom_list_types(bool has_implements,
-                                       const char *implements,
-                                       bool has_abstract,
-                                       bool abstract,
-                                       Error **errp)
-{
-    ObjectTypeInfoList *ret = NULL;
-
-    object_class_foreach(qom_list_types_tramp, implements, abstract, &ret);
-
-    return ret;
-}
-
-/* Return a DevicePropertyInfo for a qdev property.
- *
- * If a qdev property with the given name does not exist, use the given default
- * type.  If the qdev property info should not be shown, return NULL.
- *
- * The caller must free the return value.
- */
-static ObjectPropertyInfo *make_device_property_info(ObjectClass *klass,
-                                                  const char *name,
-                                                  const char *default_type,
-                                                  const char *description)
-{
-    ObjectPropertyInfo *info;
-    Property *prop;
-
-    do {
-        for (prop = DEVICE_CLASS(klass)->props; prop && prop->name; prop++) {
-            if (strcmp(name, prop->name) != 0) {
-                continue;
-            }
-
-            /*
-             * TODO Properties without a parser are just for dirty hacks.
-             * qdev_prop_ptr is the only such PropertyInfo.  It's marked
-             * for removal.  This conditional should be removed along with
-             * it.
-             */
-            if (!prop->info->set && !prop->info->create) {
-                return NULL;           /* no way to set it, don't show */
-            }
-
-            info = g_malloc0(sizeof(*info));
-            info->name = g_strdup(prop->name);
-            info->type = default_type ? g_strdup(default_type)
-                                      : g_strdup(prop->info->name);
-            info->has_description = !!prop->info->description;
-            info->description = g_strdup(prop->info->description);
-            return info;
-        }
-        klass = object_class_get_parent(klass);
-    } while (klass != object_class_by_name(TYPE_DEVICE));
-
-    /* Not a qdev property, use the default type */
-    info = g_malloc0(sizeof(*info));
-    info->name = g_strdup(name);
-    info->type = g_strdup(default_type);
-    info->has_description = !!description;
-    info->description = g_strdup(description);
-
-    return info;
-}
-
-ObjectPropertyInfoList *qmp_device_list_properties(const char *typename,
-                                                Error **errp)
-{
-    ObjectClass *klass;
-    Object *obj;
-    ObjectProperty *prop;
-    ObjectPropertyIterator iter;
-    ObjectPropertyInfoList *prop_list = NULL;
-
-    klass = object_class_by_name(typename);
-    if (klass == NULL) {
-        error_set(errp, ERROR_CLASS_DEVICE_NOT_FOUND,
-                  "Device '%s' not found", typename);
-        return NULL;
-    }
-
-    klass = object_class_dynamic_cast(klass, TYPE_DEVICE);
-    if (klass == NULL) {
-        error_setg(errp, QERR_INVALID_PARAMETER_VALUE, "typename", TYPE_DEVICE);
-        return NULL;
-    }
-
-    if (object_class_is_abstract(klass)) {
-        error_setg(errp, QERR_INVALID_PARAMETER_VALUE, "typename",
-                   "non-abstract device type");
-        return NULL;
-    }
-
-    obj = object_new(typename);
-
-    object_property_iter_init(&iter, obj);
-    while ((prop = object_property_iter_next(&iter))) {
-        ObjectPropertyInfo *info;
-        ObjectPropertyInfoList *entry;
-
-        /* Skip Object and DeviceState properties */
-        if (strcmp(prop->name, "type") == 0 ||
-            strcmp(prop->name, "realized") == 0 ||
-            strcmp(prop->name, "hotpluggable") == 0 ||
-            strcmp(prop->name, "hotplugged") == 0 ||
-            strcmp(prop->name, "parent_bus") == 0) {
-            continue;
-        }
-
-        /* Skip legacy properties since they are just string versions of
-         * properties that we already list.
-         */
-        if (strstart(prop->name, "legacy-", NULL)) {
-            continue;
-        }
-
-        info = make_device_property_info(klass, prop->name, prop->type,
-                                         prop->description);
-        if (!info) {
-            continue;
-        }
-
-        entry = g_malloc0(sizeof(*entry));
-        entry->value = info;
-        entry->next = prop_list;
-        prop_list = entry;
-    }
-
-    object_unref(obj);
-
-    return prop_list;
-}
-
-ObjectPropertyInfoList *qmp_qom_list_properties(const char *typename,
-                                             Error **errp)
-{
-    ObjectClass *klass;
-    Object *obj = NULL;
-    ObjectProperty *prop;
-    ObjectPropertyIterator iter;
-    ObjectPropertyInfoList *prop_list = NULL;
-
-    klass = object_class_by_name(typename);
-    if (klass == NULL) {
-        error_set(errp, ERROR_CLASS_DEVICE_NOT_FOUND,
-                  "Class '%s' not found", typename);
-        return NULL;
-    }
-
-    klass = object_class_dynamic_cast(klass, TYPE_OBJECT);
-    if (klass == NULL) {
-        error_setg(errp, QERR_INVALID_PARAMETER_VALUE, "typename", TYPE_OBJECT);
-        return NULL;
-    }
-
-    if (object_class_is_abstract(klass)) {
-        object_class_property_iter_init(&iter, klass);
-    } else {
-        obj = object_new(typename);
-        object_property_iter_init(&iter, obj);
-    }
-    while ((prop = object_property_iter_next(&iter))) {
-        ObjectPropertyInfo *info;
-        ObjectPropertyInfoList *entry;
-
-        info = g_malloc0(sizeof(*info));
-        info->name = g_strdup(prop->name);
-        info->type = g_strdup(prop->type);
-        info->has_description = !!prop->description;
-        info->description = g_strdup(prop->description);
-
-        entry = g_malloc0(sizeof(*entry));
-        entry->value = info;
-        entry->next = prop_list;
-        prop_list = entry;
-    }
-
-    object_unref(obj);
-
-    return prop_list;
-}
-
 void qmp_add_client(const char *protocol, const char *fdname,
                     bool has_skipauth, bool skipauth, bool has_tls, bool tls,
                     Error **errp)
@@ -654,38 +383,6 @@ void qmp_add_client(const char *protocol, const char *fdname,
 }
 
 
-void qmp_object_add(const char *type, const char *id,
-                    bool has_props, QObject *props, Error **errp)
-{
-    QDict *pdict;
-    Visitor *v;
-    Object *obj;
-
-    if (props) {
-        pdict = qobject_to(QDict, props);
-        if (!pdict) {
-            error_setg(errp, QERR_INVALID_PARAMETER_TYPE, "props", "dict");
-            return;
-        }
-        qobject_ref(pdict);
-    } else {
-        pdict = qdict_new();
-    }
-
-    v = qobject_input_visitor_new(QOBJECT(pdict));
-    obj = user_creatable_add_type(type, id, pdict, v, errp);
-    visit_free(v);
-    if (obj) {
-        object_unref(obj);
-    }
-    qobject_unref(pdict);
-}
-
-void qmp_object_del(const char *id, Error **errp)
-{
-    user_creatable_del(id, errp);
-}
-
 MemoryDeviceInfoList *qmp_query_memory_devices(Error **errp)
 {
     return qmp_memory_device_list();
qom/Makefile.objs +1 -0
index 516349eec3..5fb43b842c 100644
@@ -2,3 +2,4 @@ qom-obj-y = object.o container.o qom-qobject.o
 qom-obj-y += object_interfaces.o
 
 common-obj-y = cpu.o
+common-obj-$(CONFIG_SOFTMMU) += qom-qmp-cmds.o
qom/qom-qmp-cmds.c new file +323 -0

323 lines not on this page · raw message

Signature · 1 line
2.21.0
Reviewed-by on v1 5/17
#17 lore raw

Re: [Qemu-devel] [PATCH 05/17] qom: Move QMP command handlers to qom/

Quoted 11 lines · Markus Armbruster

The handlers for qapi/qom.json's QMP commands are in monitor/qmp-cmds.c. Move them to new qom/qom-qmp-cmds.c, where they are covered by MAINTAINERS section QOM, just like qapi/qom.json.

Move along qmp_device_list_properties() even though it's specified in qapi/qdev.json, because it's so similar to qmp_qom_list_properties().

Cc Paolo Bonzini <[email protected]>
Cc "Daniel P. Berrange" <[email protected]>
Cc Eduardo Habkost <[email protected]>
Quoted 6 lines
---
 monitor/qmp-cmds.c | 303 ------------------------------------------
 qom/Makefile.objs  |   1 +
 qom/qom-qmp-cmds.c | 323 +++++++++++++++++++++++++++++++++++++++++++++
 3 files changed, 324 insertions(+), 303 deletions(-)
 create mode 100644 qom/qom-qmp-cmds.c

Regards,
Daniel

Signature · 3 lines
|: https://berrange.com      -o-    https://www.flickr.com/photos/dberrange :|
|: https://libvirt.org         -o-            https://fstop138.berrange.com :|
|: https://entangle-photo.org    -o-    https://www.instagram.com/dberrange :|
#18 lore raw

PATCH 6/17 qom: Move HMP command handlers to qom/

In reply to Markus Armbruster

There are just two HMP commands related to QOM: qom-list and qom-set. Move their handlers from monitor/hmp-cmds.c to new qom/qom-hmp-cmds.c, where they are covered by MAINTAINERS section QOM.

Cc Paolo Bonzini <[email protected]>
Cc "Daniel P. Berrange" <[email protected]>
Cc Eduardo Habkost <[email protected]>
Cc "Dr. David Alan Gilbert" <[email protected]>
---
 include/monitor/hmp.h |  2 ++
 monitor/hmp-cmds.c    | 50 +---------------------------------
 qom/Makefile.objs     |  2 +-
 qom/qom-hmp-cmds.c    | 62 +++++++++++++++++++++++++++++++++++++++++++
 4 files changed, 66 insertions(+), 50 deletions(-)
 create mode 100644 qom/qom-hmp-cmds.c
include/monitor/hmp.h +2 -0
index 1d095d5837..f46ccdaa35 100644
@@ -16,6 +16,8 @@
 
 #include "qemu/readline.h"
 
+void hmp_handle_error(Monitor *mon, Error **errp);
+
 void hmp_info_name(Monitor *mon, const QDict *qdict);
 void hmp_info_version(Monitor *mon, const QDict *qdict);
 void hmp_info_kvm(Monitor *mon, const QDict *qdict);
monitor/hmp-cmds.c +1 -49

62 lines not on this page · raw message

qom/Makefile.objs +1 -1
index 5fb43b842c..aae478fc21 100644
@@ -2,4 +2,4 @@ qom-obj-y = object.o container.o qom-qobject.o
 qom-obj-y += object_interfaces.o
 
 common-obj-y = cpu.o
-common-obj-$(CONFIG_SOFTMMU) += qom-qmp-cmds.o
+common-obj-$(CONFIG_SOFTMMU) += qom-hmp-cmds.o qom-qmp-cmds.o
qom/qom-hmp-cmds.c new file +62 -0

62 lines not on this page · raw message

Signature · 1 line
2.21.0
Reviewed-by on v1 6/17
#19 lore raw

Re: [Qemu-devel] [PATCH 06/17] qom: Move HMP command handlers to qom/

Quoted 9 lines · Markus Armbruster

There are just two HMP commands related to QOM: qom-list and qom-set. Move their handlers from monitor/hmp-cmds.c to new qom/qom-hmp-cmds.c, where they are covered by MAINTAINERS section QOM.

Cc Paolo Bonzini <[email protected]>
Cc "Daniel P. Berrange" <[email protected]>
Cc Eduardo Habkost <[email protected]>
Cc "Dr. David Alan Gilbert" <[email protected]>
Quoted 7 lines
---
 include/monitor/hmp.h |  2 ++
 monitor/hmp-cmds.c    | 50 +---------------------------------
 qom/Makefile.objs     |  2 +-
 qom/qom-hmp-cmds.c    | 62 +++++++++++++++++++++++++++++++++++++++++++
 4 files changed, 66 insertions(+), 50 deletions(-)
 create mode 100644 qom/qom-hmp-cmds.c

Regards,
Daniel

Signature · 3 lines
|: https://berrange.com      -o-    https://www.flickr.com/photos/dberrange :|
|: https://libvirt.org         -o-            https://fstop138.berrange.com :|
|: https://entangle-photo.org    -o-    https://www.instagram.com/dberrange :|
Reviewed-by on v1 6/17
#20 lore raw

Re: [Qemu-devel] [PATCH 06/17] qom: Move HMP command handlers to qom/

In reply to Markus Armbruster
Quoted 9 lines · * Markus Armbruster ([email protected]) wrote:

There are just two HMP commands related to QOM: qom-list and qom-set. Move their handlers from monitor/hmp-cmds.c to new qom/qom-hmp-cmds.c, where they are covered by MAINTAINERS section QOM.

Cc Paolo Bonzini <[email protected]>
Cc "Daniel P. Berrange" <[email protected]>
Cc Eduardo Habkost <[email protected]>
Cc "Dr. David Alan Gilbert" <[email protected]>

I look forward to those gaining the qom_get at some stage!

Quoted 170 lines
---
 include/monitor/hmp.h |  2 ++
 monitor/hmp-cmds.c    | 50 +---------------------------------
 qom/Makefile.objs     |  2 +-
 qom/qom-hmp-cmds.c    | 62 +++++++++++++++++++++++++++++++++++++++++++
 4 files changed, 66 insertions(+), 50 deletions(-)
 create mode 100644 qom/qom-hmp-cmds.c
include/monitor/hmp.h +2 -0
index 1d095d5837..f46ccdaa35 100644
@@ -16,6 +16,8 @@
 
 #include "qemu/readline.h"
 
+void hmp_handle_error(Monitor *mon, Error **errp);
+
 void hmp_info_name(Monitor *mon, const QDict *qdict);
 void hmp_info_version(Monitor *mon, const QDict *qdict);
 void hmp_info_kvm(Monitor *mon, const QDict *qdict);
monitor/hmp-cmds.c +1 -49
index d94ab7563e..5641036dc3 100644
@@ -60,7 +60,7 @@
 #include <spice/enums.h>
 #endif
 
-static void hmp_handle_error(Monitor *mon, Error **errp)
+void hmp_handle_error(Monitor *mon, Error **errp)
 {
     assert(errp);
     if (*errp) {
@@ -2714,54 +2714,6 @@ void hmp_info_iothreads(Monitor *mon, const QDict *qdict)
     qapi_free_IOThreadInfoList(info_list);
 }
 
-void hmp_qom_list(Monitor *mon, const QDict *qdict)
-{
-    const char *path = qdict_get_try_str(qdict, "path");
-    ObjectPropertyInfoList *list;
-    Error *err = NULL;
-
-    if (path == NULL) {
-        monitor_printf(mon, "/\n");
-        return;
-    }
-
-    list = qmp_qom_list(path, &err);
-    if (err == NULL) {
-        ObjectPropertyInfoList *start = list;
-        while (list != NULL) {
-            ObjectPropertyInfo *value = list->value;
-
-            monitor_printf(mon, "%s (%s)\n",
-                           value->name, value->type);
-            list = list->next;
-        }
-        qapi_free_ObjectPropertyInfoList(start);
-    }
-    hmp_handle_error(mon, &err);
-}
-
-void hmp_qom_set(Monitor *mon, const QDict *qdict)
-{
-    const char *path = qdict_get_str(qdict, "path");
-    const char *property = qdict_get_str(qdict, "property");
-    const char *value = qdict_get_str(qdict, "value");
-    Error *err = NULL;
-    bool ambiguous = false;
-    Object *obj;
-
-    obj = object_resolve_path(path, &ambiguous);
-    if (obj == NULL) {
-        error_set(&err, ERROR_CLASS_DEVICE_NOT_FOUND,
-                  "Device '%s' not found", path);
-    } else {
-        if (ambiguous) {
-            monitor_printf(mon, "Warning: Path '%s' is ambiguous\n", path);
-        }
-        object_property_parse(obj, value, property, &err);
-    }
-    hmp_handle_error(mon, &err);
-}
-
 void hmp_rocker(Monitor *mon, const QDict *qdict)
 {
     const char *name = qdict_get_str(qdict, "name");
qom/Makefile.objs +1 -1
index 5fb43b842c..aae478fc21 100644
@@ -2,4 +2,4 @@ qom-obj-y = object.o container.o qom-qobject.o
 qom-obj-y += object_interfaces.o
 
 common-obj-y = cpu.o
-common-obj-$(CONFIG_SOFTMMU) += qom-qmp-cmds.o
+common-obj-$(CONFIG_SOFTMMU) += qom-hmp-cmds.o qom-qmp-cmds.o
qom/qom-hmp-cmds.c new file +62 -0
new file mode 100644
index 0000000000..2028a21052
@@ -0,0 +1,62 @@
+/*
+ * HMP commands related to QOM
+ *
+ * This work is licensed under the terms of the GNU GPL, version 2 or
+ * later.  See the COPYING file in the top-level directory.
+ */
+
+#include "qemu/osdep.h"
+#include "monitor/hmp.h"
+#include "qapi/qapi-commands-qom.h"
+#include "qapi/qmp/qdict.h"
+#include "monitor/monitor.h"
+#include "qom/object.h"
+#include "qapi/error.h"
+
+void hmp_qom_list(Monitor *mon, const QDict *qdict)
+{
+    const char *path = qdict_get_try_str(qdict, "path");
+    ObjectPropertyInfoList *list;
+    Error *err = NULL;
+
+    if (path == NULL) {
+        monitor_printf(mon, "/\n");
+        return;
+    }
+
+    list = qmp_qom_list(path, &err);
+    if (err == NULL) {
+        ObjectPropertyInfoList *start = list;
+        while (list != NULL) {
+            ObjectPropertyInfo *value = list->value;
+
+            monitor_printf(mon, "%s (%s)\n",
+                           value->name, value->type);
+            list = list->next;
+        }
+        qapi_free_ObjectPropertyInfoList(start);
+    }
+    hmp_handle_error(mon, &err);
+}
+
+void hmp_qom_set(Monitor *mon, const QDict *qdict)
+{
+    const char *path = qdict_get_str(qdict, "path");
+    const char *property = qdict_get_str(qdict, "property");
+    const char *value = qdict_get_str(qdict, "value");
+    Error *err = NULL;
+    bool ambiguous = false;
+    Object *obj;
+
+    obj = object_resolve_path(path, &ambiguous);
+    if (obj == NULL) {
+        error_set(&err, ERROR_CLASS_DEVICE_NOT_FOUND,
+                  "Device '%s' not found", path);
+    } else {
+        if (ambiguous) {
+            monitor_printf(mon, "Warning: Path '%s' is ambiguous\n", path);
+        }
+        object_property_parse(obj, value, property, &err);
+    }
+    hmp_handle_error(mon, &err);
+}
Signature · 1 line
2.21.0

--
Dr. David Alan Gilbert / [email protected] / Manchester, UK

#21 lore raw

Re: [Qemu-devel] [PATCH 06/17] qom: Move HMP command handlers to qom/

In reply to Markus Armbruster
Quoted 3 lines · Markus Armbruster

There are just two HMP commands related to QOM: qom-list and qom-set. Move their handlers from monitor/hmp-cmds.c to new qom/qom-hmp-cmds.c, where they are covered by MAINTAINERS section QOM.

Actually three: hmp_info_qom_tree(). I'm squashing the obvious movement into this patch (appended), updating the commit message to

Move the HMP command handlers related to QOM handlers from monitor/hmp-cmds.c and qdev-monitor.c to new qom/qom-hmp-cmds.c, where they are covered by MAINTAINERS section QOM.

Hope that's okay.

Quoted 162 lines
Cc Paolo Bonzini <[email protected]>
Cc "Daniel P. Berrange" <[email protected]>
Cc Eduardo Habkost <[email protected]>
Cc "Dr. David Alan Gilbert" <[email protected]>
---
 include/monitor/hmp.h |  2 ++
 monitor/hmp-cmds.c    | 50 +---------------------------------
 qom/Makefile.objs     |  2 +-
 qom/qom-hmp-cmds.c    | 62 +++++++++++++++++++++++++++++++++++++++++++
 4 files changed, 66 insertions(+), 50 deletions(-)
 create mode 100644 qom/qom-hmp-cmds.c
include/monitor/hmp.h +2 -0
index 1d095d5837..f46ccdaa35 100644
@@ -16,6 +16,8 @@
 
 #include "qemu/readline.h"
 
+void hmp_handle_error(Monitor *mon, Error **errp);
+
 void hmp_info_name(Monitor *mon, const QDict *qdict);
 void hmp_info_version(Monitor *mon, const QDict *qdict);
 void hmp_info_kvm(Monitor *mon, const QDict *qdict);
monitor/hmp-cmds.c +1 -49
index d94ab7563e..5641036dc3 100644
@@ -60,7 +60,7 @@
 #include <spice/enums.h>
 #endif
 
-static void hmp_handle_error(Monitor *mon, Error **errp)
+void hmp_handle_error(Monitor *mon, Error **errp)
 {
     assert(errp);
     if (*errp) {
@@ -2714,54 +2714,6 @@ void hmp_info_iothreads(Monitor *mon, const QDict *qdict)
     qapi_free_IOThreadInfoList(info_list);
 }
 
-void hmp_qom_list(Monitor *mon, const QDict *qdict)
-{
-    const char *path = qdict_get_try_str(qdict, "path");
-    ObjectPropertyInfoList *list;
-    Error *err = NULL;
-
-    if (path == NULL) {
-        monitor_printf(mon, "/\n");
-        return;
-    }
-
-    list = qmp_qom_list(path, &err);
-    if (err == NULL) {
-        ObjectPropertyInfoList *start = list;
-        while (list != NULL) {
-            ObjectPropertyInfo *value = list->value;
-
-            monitor_printf(mon, "%s (%s)\n",
-                           value->name, value->type);
-            list = list->next;
-        }
-        qapi_free_ObjectPropertyInfoList(start);
-    }
-    hmp_handle_error(mon, &err);
-}
-
-void hmp_qom_set(Monitor *mon, const QDict *qdict)
-{
-    const char *path = qdict_get_str(qdict, "path");
-    const char *property = qdict_get_str(qdict, "property");
-    const char *value = qdict_get_str(qdict, "value");
-    Error *err = NULL;
-    bool ambiguous = false;
-    Object *obj;
-
-    obj = object_resolve_path(path, &ambiguous);
-    if (obj == NULL) {
-        error_set(&err, ERROR_CLASS_DEVICE_NOT_FOUND,
-                  "Device '%s' not found", path);
-    } else {
-        if (ambiguous) {
-            monitor_printf(mon, "Warning: Path '%s' is ambiguous\n", path);
-        }
-        object_property_parse(obj, value, property, &err);
-    }
-    hmp_handle_error(mon, &err);
-}
-
 void hmp_rocker(Monitor *mon, const QDict *qdict)
 {
     const char *name = qdict_get_str(qdict, "name");
qom/Makefile.objs +1 -1
index 5fb43b842c..aae478fc21 100644
@@ -2,4 +2,4 @@ qom-obj-y = object.o container.o qom-qobject.o
 qom-obj-y += object_interfaces.o
 
 common-obj-y = cpu.o
-common-obj-$(CONFIG_SOFTMMU) += qom-qmp-cmds.o
+common-obj-$(CONFIG_SOFTMMU) += qom-hmp-cmds.o qom-qmp-cmds.o
qom/qom-hmp-cmds.c new file +52 -0
new file mode 100644
index 0000000000..2028a21052
@@ -0,0 +1,62 @@
+/*
+ * HMP commands related to QOM
+ *
+ * This work is licensed under the terms of the GNU GPL, version 2 or
+ * later.  See the COPYING file in the top-level directory.
+ */
+
+#include "qemu/osdep.h"
+#include "monitor/hmp.h"
+#include "qapi/qapi-commands-qom.h"
+#include "qapi/qmp/qdict.h"
+#include "monitor/monitor.h"
+#include "qom/object.h"
+#include "qapi/error.h"
+
+void hmp_qom_list(Monitor *mon, const QDict *qdict)
+{
+    const char *path = qdict_get_try_str(qdict, "path");
+    ObjectPropertyInfoList *list;
+    Error *err = NULL;
+
+    if (path == NULL) {
+        monitor_printf(mon, "/\n");
+        return;
+    }
+
+    list = qmp_qom_list(path, &err);
+    if (err == NULL) {
+        ObjectPropertyInfoList *start = list;
+        while (list != NULL) {
+            ObjectPropertyInfo *value = list->value;
+
+            monitor_printf(mon, "%s (%s)\n",
+                           value->name, value->type);
+            list = list->next;
+        }
+        qapi_free_ObjectPropertyInfoList(start);
+    }
+    hmp_handle_error(mon, &err);
+}
+
+void hmp_qom_set(Monitor *mon, const QDict *qdict)
+{
+    const char *path = qdict_get_str(qdict, "path");
+    const char *property = qdict_get_str(qdict, "property");
+    const char *value = qdict_get_str(qdict, "value");
+    Error *err = NULL;
+    bool ambiguous = false;
+    Object *obj;
+
+    obj = object_resolve_path(path, &ambiguous);
+    if (obj == NULL) {

qom/qom-hmp-cmds.c line 62

Quoted 10 lines
qom/qom-hmp-cmds.c new file +10 -0
+        error_set(&err, ERROR_CLASS_DEVICE_NOT_FOUND,
+                  "Device '%s' not found", path);
+    } else {
+        if (ambiguous) {
+            monitor_printf(mon, "Warning: Path '%s' is ambiguous\n", path);
+        }
+        object_property_parse(obj, value, property, &err);
+    }
+    hmp_handle_error(mon, &err);
+}
include/monitor/hmp.h +1 -0
index 9d558e9d78..a0e9511440 100644
@@ -121,6 +121,7 @@ void hmp_info_numa(Monitor *mon, const QDict *qdict);
 void hmp_info_memory_devices(Monitor *mon, const QDict *qdict);
 void hmp_qom_list(Monitor *mon, const QDict *qdict);
 void hmp_qom_set(Monitor *mon, const QDict *qdict);
+void hmp_info_qom_tree(Monitor *mon, const QDict *dict);
 void object_add_completion(ReadLineState *rs, int nb_args, const char *str);
 void object_del_completion(ReadLineState *rs, int nb_args, const char *str);
 void device_add_completion(ReadLineState *rs, int nb_args, const char *str);
include/monitor/qdev.h +0 -1
index 0ff3331284..084799e4d9 100644
@@ -7,7 +7,6 @@
 
 void hmp_info_qtree(Monitor *mon, const QDict *qdict);
 void hmp_info_qdm(Monitor *mon, const QDict *qdict);
-void hmp_info_qom_tree(Monitor *mon, const QDict *dict);
 void qmp_device_add(QDict *qdict, QObject **ret_data, Error **errp);
 
 int qdev_device_help(QemuOpts *opts);
qdev-monitor.c +0 -57

63 lines not on this page · raw message

qom/qom-hmp-cmds.c +60 -2

75 lines not on this page · raw message

#22 lore raw

PATCH 7/17 MAINTAINERS: Merge sections CPU, NUMA into Machine core

In reply to Markus Armbruster
---
 MAINTAINERS | 16 ++++------------
 1 file changed, 4 insertions(+), 12 deletions(-)
MAINTAINERS +4 -12
index 1aef0afaf7..f18fddbbbb 100644
@@ -1268,8 +1268,12 @@ S: Supported
 F: hw/core/machine.c
 F: hw/core/null-machine.c
 F: hw/cpu/cluster.c
+F: numa.c
+F: qom/cpu.c
 F: include/hw/boards.h
 F: include/hw/cpu/cluster.h
+F: include/qom/cpu.h
+F: include/sysemu/numa.h
 T: git https://github.com/ehabkost/qemu.git machine-next
 
 Xtensa Machines
@@ -1833,11 +1837,6 @@ M: Markus Armbruster <[email protected]>
 S: Supported
 F: scripts/coverity-model.c
 
-CPU
-S: Supported
-F: qom/cpu.c
-F: include/qom/cpu.h
-
 Device Tree
 M: Alistair Francis <[email protected]>
 R: David Gibson <[email protected]>
@@ -1945,13 +1944,6 @@ W: http://info.iet.unipi.it/~luigi/netmap/
 S: Maintained
 F: net/netmap.c
 
-NUMA
-M: Eduardo Habkost <[email protected]>
-S: Maintained
-F: numa.c
-F: include/sysemu/numa.h
-T: git https://github.com/ehabkost/qemu.git machine-next
-
 Host Memory Backends
 M: Eduardo Habkost <[email protected]>
 M: Igor Mammedov <[email protected]>
Signature · 1 line
2.21.0
Reviewed-by on v1 7/17
#23 lore raw

Re: [Qemu-devel] [PATCH 07/17] MAINTAINERS: Merge sections CPU, NUMA into Machine core

Quoted 7 lines · Markus Armbruster
---
 MAINTAINERS | 16 ++++------------
 1 file changed, 4 insertions(+), 12 deletions(-)

MAINTAINERS S: Supported · line 1272

Quoted 11 lines
MAINTAINERS +2 -0
index 1aef0afaf7..f18fddbbbb 100644
@@ -1268,8 +1268,12 @@ S: Supported
 F: hw/core/machine.c
 F: hw/core/null-machine.c
 F: hw/cpu/cluster.c
+F: numa.c
+F: qom/cpu.c

Not a blocker for this patch, but as a later patch, I'd encourage you to move qom/cpu.c somewhere else. Pretty much anywhere else would be better than under qom/ IMHO :-)

MAINTAINERS S: Supported · line 1275

Quoted 3 lines
MAINTAINERS +1 -0
 F: include/hw/boards.h
 F: include/hw/cpu/cluster.h
+F: include/qom/cpu.h

Likewise

Quoted 34 lines
MAINTAINERS +1 -12
+F: include/sysemu/numa.h
 T: git https://github.com/ehabkost/qemu.git machine-next
 
 Xtensa Machines
@@ -1833,11 +1837,6 @@ M: Markus Armbruster <[email protected]>
 S: Supported
 F: scripts/coverity-model.c
 
-CPU
-S: Supported
-F: qom/cpu.c
-F: include/qom/cpu.h
-
 Device Tree
 M: Alistair Francis <[email protected]>
 R: David Gibson <[email protected]>
@@ -1945,13 +1944,6 @@ W: http://info.iet.unipi.it/~luigi/netmap/
 S: Maintained
 F: net/netmap.c
 
-NUMA
-M: Eduardo Habkost <[email protected]>
-S: Maintained
-F: numa.c
-F: include/sysemu/numa.h
-T: git https://github.com/ehabkost/qemu.git machine-next
-
 Host Memory Backends
 M: Eduardo Habkost <[email protected]>
 M: Igor Mammedov <[email protected]>
Signature · 1 line
2.21.0

Regards,
Daniel

Signature · 3 lines
|: https://berrange.com      -o-    https://www.flickr.com/photos/dberrange :|
|: https://libvirt.org         -o-            https://fstop138.berrange.com :|
|: https://entangle-photo.org    -o-    https://www.instagram.com/dberrange :|
#24 lore raw

Re: [Qemu-devel] [PATCH 07/17] MAINTAINERS: Merge sections CPU, NUMA into Machine core

Quoted 12 lines · Daniel P. Berrangé
Quoted 7 lines · Markus Armbruster
---
 MAINTAINERS | 16 ++++------------
 1 file changed, 4 insertions(+), 12 deletions(-)
Quoted 1 line
Quoted 14 lines

MAINTAINERS S: Supported · line 1272

Quoted 10 lines
MAINTAINERS +2 -0
index 1aef0afaf7..f18fddbbbb 100644
@@ -1268,8 +1268,12 @@ S: Supported
 F: hw/core/machine.c
 F: hw/core/null-machine.c
 F: hw/cpu/cluster.c
+F: numa.c
+F: qom/cpu.c

Not a blocker for this patch, but as a later patch, I'd encourage you to move qom/cpu.c somewhere else. Pretty much anywhere else would be better than under qom/ IMHO :-)

Eduardo, any ideas?

Quoted 10 lines

MAINTAINERS S: Supported · line 1275

Quoted 3 lines
MAINTAINERS +1 -0
 F: include/hw/boards.h
 F: include/hw/cpu/cluster.h
+F: include/qom/cpu.h

Likewise

Quoted 4 lines
MAINTAINERS +1 -0
+F: include/sysemu/numa.h
 T: git https://github.com/ehabkost/qemu.git machine-next
 
 Xtensa Machines

[...]

#25 lore raw

Re: [Qemu-devel] [PATCH 07/17] MAINTAINERS: Merge sections CPU, NUMA into Machine core

Quoted 29 lines · Markus Armbruster
Quoted 12 lines · Daniel P. Berrangé
Quoted 7 lines · Markus Armbruster
---
 MAINTAINERS | 16 ++++------------
 1 file changed, 4 insertions(+), 12 deletions(-)
Quoted 1 line
Quoted 14 lines

MAINTAINERS S: Supported · line 1272

Quoted 10 lines
MAINTAINERS +2 -0
index 1aef0afaf7..f18fddbbbb 100644
@@ -1268,8 +1268,12 @@ S: Supported
 F: hw/core/machine.c
 F: hw/core/null-machine.c
 F: hw/cpu/cluster.c
+F: numa.c
+F: qom/cpu.c

Not a blocker for this patch, but as a later patch, I'd encourage you to move qom/cpu.c somewhere else. Pretty much anywhere else would be better than under qom/ IMHO :-)

Quoted 1 line

Eduardo, any ideas?

Sorry for the late reply. I suggest hw/core/cpu.c.

Signature · 1 line
Eduardo
#26 lore raw

Re: [Qemu-devel] [PATCH 07/17] MAINTAINERS: Merge sections CPU, NUMA into Machine core

Quoted 30 lines · Eduardo Habkost
Quoted 29 lines · Markus Armbruster
Quoted 26 lines · Daniel P. Berrangé
Quoted 7 lines · Markus Armbruster
---
 MAINTAINERS | 16 ++++------------
 1 file changed, 4 insertions(+), 12 deletions(-)

MAINTAINERS S: Supported · line 1272

Quoted 11 lines
MAINTAINERS +2 -0
index 1aef0afaf7..f18fddbbbb 100644
@@ -1268,8 +1268,12 @@ S: Supported
 F: hw/core/machine.c
 F: hw/core/null-machine.c
 F: hw/cpu/cluster.c
+F: numa.c
+F: qom/cpu.c

Not a blocker for this patch, but as a later patch, I'd encourage you to move qom/cpu.c somewhere else. Pretty much anywhere else would be better than under qom/ IMHO :-)

Quoted 3 lines
Quoted 1 line

Eduardo, any ideas?

Sorry for the late reply. I suggest hw/core/cpu.c.

Can do. Also: include/qom/cpu.h -> include/hw/core/cpu.h.

There's also hw/cpu/ and include/hw/cpu/. I presume they are less suited than hw/core and include/hw/core/.

#27 lore raw

PATCH 8/17 qapi: Split machine.json off misc.json

In reply to Markus Armbruster

Move commands cpu-add, query-cpus, query-cpus-fast, query-current-machine, query-hotpluggable-cpus, query-machines, query-memdev, and set-numa-node with their types from misc.json to new machine.json. Also move types X86CPURegister32 and X86CPUFeatureWordInfo. Add machine.json to MAINTAINERS section "Machine core".

Cc Eduardo Habkost <[email protected]>
Cc Marcel Apfelbaum <[email protected]>
---
 MAINTAINERS              |   1 +
 cpus.c                   |   1 +
 include/hw/boards.h      |   1 +
 include/sysemu/hostmem.h |   2 +-
 monitor/hmp-cmds.c       |   1 +
 monitor/qmp-cmds.c       |   1 +
 numa.c                   |   4 +-
 qapi/Makefile.objs       |   2 +-
 qapi/machine.json        | 697 +++++++++++++++++++++++++++++++++++++++
 qapi/misc.json           | 687 --------------------------------------
 qapi/qapi-schema.json    |   1 +
 target/i386/cpu.c        |   2 +-
 target/s390x/cpu.c       |   2 +-
 target/s390x/sigp.c      |   2 +-
 vl.c                     |   2 +-
 15 files changed, 711 insertions(+), 695 deletions(-)
 create mode 100644 qapi/machine.json
MAINTAINERS +1 -0
index f18fddbbbb..9b488c5151 100644
@@ -1269,6 +1269,7 @@ F: hw/core/machine.c
 F: hw/core/null-machine.c
 F: hw/cpu/cluster.c
 F: numa.c
+F: qapi/machine.json
 F: qom/cpu.c
 F: include/hw/boards.h
 F: include/hw/cpu/cluster.h
cpus.c +1 -0
index dde3b7b981..f5e677b2c4 100644
@@ -28,6 +28,7 @@
 #include "cpu.h"
 #include "monitor/monitor.h"
 #include "qapi/error.h"
+#include "qapi/qapi-commands-machine.h"
 #include "qapi/qapi-commands-misc.h"
 #include "qapi/qapi-events-run-state.h"
 #include "qapi/qmp/qerror.h"
include/hw/boards.h +1 -0
index b7362af3f1..0c1cc510b5 100644
@@ -6,6 +6,7 @@
 #include "sysemu/blockdev.h"
 #include "sysemu/accel.h"
 #include "hw/qdev.h"
+#include "qapi/qapi-types-machine.h"
 #include "qemu/module.h"
 #include "qom/object.h"
 #include "qom/cpu.h"
include/sysemu/hostmem.h +1 -1
index a023b372a4..92fa0e458c 100644
@@ -14,7 +14,7 @@
 #define SYSEMU_HOSTMEM_H
 
 #include "sysemu/sysemu.h" /* for MAX_NODES */
-#include "qapi/qapi-types-misc.h"
+#include "qapi/qapi-types-machine.h"
 #include "qom/object.h"
 #include "exec/memory.h"
 #include "qemu/bitmap.h"
monitor/hmp-cmds.c +1 -0
index 5641036dc3..789f763938 100644
@@ -31,6 +31,7 @@
 #include "qapi/qapi-builtin-visit.h"
 #include "qapi/qapi-commands-block.h"
 #include "qapi/qapi-commands-char.h"
+#include "qapi/qapi-commands-machine.h"
 #include "qapi/qapi-commands-migration.h"
 #include "qapi/qapi-commands-misc.h"
 #include "qapi/qapi-commands-net.h"
monitor/qmp-cmds.c +1 -0
index 884eeaab80..58b54db033 100644
@@ -31,6 +31,7 @@
 #include "sysemu/block-backend.h"
 #include "qapi/error.h"
 #include "qapi/qapi-commands-block-core.h"
+#include "qapi/qapi-commands-machine.h"
 #include "qapi/qapi-commands-misc.h"
 #include "qapi/qapi-commands-ui.h"
 #include "qapi/qmp/qerror.h"
numa.c +2 -2
index 955ec0c830..6f85407c46 100644
@@ -31,8 +31,8 @@
 #include "qemu/error-report.h"
 #include "qapi/error.h"
 #include "qapi/opts-visitor.h"
-#include "qapi/qapi-commands-misc.h"
-#include "qapi/qapi-visit-misc.h"
+#include "qapi/qapi-commands-machine.h"
+#include "qapi/qapi-visit-machine.h"
 #include "hw/boards.h"
 #include "sysemu/hostmem.h"
 #include "hw/mem/pc-dimm.h"
qapi/Makefile.objs +1 -1
index 40b1dcffc4..01dced01aa 100644
@@ -6,7 +6,7 @@ util-obj-y += qmp-event.o
 util-obj-y += qapi-util.o
 
 QAPI_COMMON_MODULES = audio authz block-core block char common crypto
-QAPI_COMMON_MODULES += introspect job migration misc net
+QAPI_COMMON_MODULES += introspect job machine migration misc net
 QAPI_COMMON_MODULES += qdev qom rdma rocker run-state sockets tpm
 QAPI_COMMON_MODULES += trace transaction ui
 QAPI_TARGET_MODULES = target
qapi/machine.json new file +697 -0

697 lines not on this page · raw message

qapi/misc.json +0 -687

720 lines not on this page · raw message

qapi/qapi-schema.json +1 -0
index d6cf90a85a..31611191db 100644
@@ -99,6 +99,7 @@
 { 'include': 'introspect.json' }
 { 'include': 'qom.json' }
 { 'include': 'qdev.json' }
+{ 'include': 'machine.json' }
 { 'include': 'misc.json' }
 { 'include': 'target.json' }
 { 'include': 'audio.json' }
target/i386/cpu.c +1 -1
index fbed2eb804..cb50f05e7e 100644
@@ -36,7 +36,7 @@
 #include "qemu/option.h"
 #include "qemu/config-file.h"
 #include "qapi/error.h"
-#include "qapi/qapi-visit-misc.h"
+#include "qapi/qapi-visit-machine.h"
 #include "qapi/qapi-visit-run-state.h"
 #include "qapi/qmp/qdict.h"
 #include "qapi/qmp/qerror.h"
target/s390x/cpu.c +1 -1
index f2d93644d5..8540e7a2cb 100644
@@ -31,7 +31,7 @@
 #include "qemu/module.h"
 #include "trace.h"
 #include "qapi/visitor.h"
-#include "qapi/qapi-visit-misc.h"
+#include "qapi/qapi-types-machine.h"
 #include "qapi/qapi-visit-run-state.h"
 #include "sysemu/hw_accel.h"
 #include "hw/qdev-properties.h"
target/s390x/sigp.c +1 -1
index ce49a792fc..8348b7035e 100644
@@ -17,7 +17,7 @@
 #include "sysemu/sysemu.h"
 #include "sysemu/tcg.h"
 #include "trace.h"
-#include "qapi/qapi-types-misc.h"
+#include "qapi/qapi-types-machine.h"
 
 QemuMutex qemu_sigp_mutex;
 
vl.c +1 -1
index 99a56b5556..0eb9b2c8bd 100644
@@ -125,7 +125,7 @@ int main(int argc, char **argv)
 #include "qapi/qapi-visit-block-core.h"
 #include "qapi/qapi-visit-ui.h"
 #include "qapi/qapi-commands-block-core.h"
-#include "qapi/qapi-commands-misc.h"
+#include "qapi/qapi-commands-machine.h"
 #include "qapi/qapi-commands-run-state.h"
 #include "qapi/qapi-commands-ui.h"
 #include "qapi/qmp/qerror.h"
Signature · 1 line
2.21.0
Reviewed-by on v1 8/17
#28 lore raw

Re: [Qemu-devel] [PATCH 08/17] qapi: Split machine.json off misc.json

Quoted 20 lines · Markus Armbruster

Move commands cpu-add, query-cpus, query-cpus-fast, query-current-machine, query-hotpluggable-cpus, query-machines, query-memdev, and set-numa-node with their types from misc.json to new machine.json. Also move types X86CPURegister32 and X86CPUFeatureWordInfo. Add machine.json to MAINTAINERS section "Machine core".

Cc Eduardo Habkost <[email protected]>
Cc Marcel Apfelbaum <[email protected]>
---
 MAINTAINERS              |   1 +
 cpus.c                   |   1 +
 include/hw/boards.h      |   1 +
 include/sysemu/hostmem.h |   2 +-
 monitor/hmp-cmds.c       |   1 +
 monitor/qmp-cmds.c       |   1 +
 numa.c                   |   4 +-
 qapi/Makefile.objs       |   2 +-
 qapi/machine.json        | 697 +++++++++++++++++++++++++++++++++++++++
Quoted 8 lines
 qapi/misc.json           | 687 --------------------------------------
 qapi/qapi-schema.json    |   1 +
 target/i386/cpu.c        |   2 +-
 target/s390x/cpu.c       |   2 +-
 target/s390x/sigp.c      |   2 +-
 vl.c                     |   2 +-
 15 files changed, 711 insertions(+), 695 deletions(-)
 create mode 100644 qapi/machine.json

Regards,
Daniel

Signature · 3 lines
|: https://berrange.com      -o-    https://www.flickr.com/photos/dberrange :|
|: https://libvirt.org         -o-            https://fstop138.berrange.com :|
|: https://entangle-photo.org    -o-    https://www.instagram.com/dberrange :|
#29 lore raw

PATCH 9/17 hw/core: Move numa.c to hw/core/

In reply to Markus Armbruster
Cc Eduardo Habkost <[email protected]>
Cc Marcel Apfelbaum <[email protected]>
---
 MAINTAINERS              | 2 +-
 Makefile.target          | 2 +-
 hw/core/Makefile.objs    | 2 ++
 numa.c => hw/core/numa.c | 0
 4 files changed, 4 insertions(+), 2 deletions(-)
 rename numa.c => hw/core/numa.c (100%)
MAINTAINERS +1 -1
index 9b488c5151..96a72a999a 100644
@@ -1267,8 +1267,8 @@ M: Marcel Apfelbaum <[email protected]>
 S: Supported
 F: hw/core/machine.c
 F: hw/core/null-machine.c
+F: hw/core/numa.c
 F: hw/cpu/cluster.c
-F: numa.c
 F: qapi/machine.json
 F: qom/cpu.c
 F: include/hw/boards.h
Makefile.target +1 -1
index 72c267f7dc..167ae2174e 100644
@@ -148,7 +148,7 @@ endif #CONFIG_BSD_USER
 #########################################################
 # System emulator target
 ifdef CONFIG_SOFTMMU
-obj-y += arch_init.o cpus.o gdbstub.o balloon.o ioport.o numa.o
+obj-y += arch_init.o cpus.o gdbstub.o balloon.o ioport.o
 obj-y += qtest.o
 obj-y += hw/
 obj-y += monitor/
hw/core/Makefile.objs +2 -0
index a799c83815..e3a8307be6 100644
@@ -22,3 +22,5 @@ common-obj-$(CONFIG_SOFTMMU) += split-irq.o
 common-obj-$(CONFIG_PLATFORM_BUS) += platform-bus.o
 common-obj-$(CONFIG_SOFTMMU) += generic-loader.o
 common-obj-$(CONFIG_SOFTMMU) += null-machine.o
+
+obj-$(CONFIG_SOFTMMU) += numa.o
hw/core/numa.c renamed from numa.c +0 -0
similarity index 100%
rename from numa.c
rename to hw/core/numa.c
Signature · 1 line
2.21.0
Reviewed-by on v1 9/17
#30 lore raw

Re: [Qemu-devel] [PATCH 09/17] hw/core: Move numa.c to hw/core/

Quoted 10 lines · Markus Armbruster
Cc Eduardo Habkost <[email protected]>
Cc Marcel Apfelbaum <[email protected]>
---
 MAINTAINERS              | 2 +-
 Makefile.target          | 2 +-
 hw/core/Makefile.objs    | 2 ++
 numa.c => hw/core/numa.c | 0
 4 files changed, 4 insertions(+), 2 deletions(-)
 rename numa.c => hw/core/numa.c (100%)

Regards,
Daniel

Signature · 3 lines
|: https://berrange.com      -o-    https://www.flickr.com/photos/dberrange :|
|: https://libvirt.org         -o-            https://fstop138.berrange.com :|
|: https://entangle-photo.org    -o-    https://www.instagram.com/dberrange :|
#31 lore raw

PATCH 10/17 hw/core: Collect QMP command handlers in hw/core/

In reply to Markus Armbruster

The handlers for qapi/machine.json's QMP commands are spread over cpus.c, hw/core/numa.c, monitor/misc.c, monitor/qmp-cmds.c, and vl.c. Move them all to new hw/core/machine-qmp-cmds.c, where they are covered by MAINTAINERS section "Machine core", just like qapi/machine.json.

Cc Eduardo Habkost <[email protected]>
Cc Marcel Apfelbaum <[email protected]>
---
 MAINTAINERS                |   1 +
 cpus.c                     | 188 ---------------------
 hw/core/Makefile.objs      |   1 +
 hw/core/machine-qmp-cmds.c | 328 +++++++++++++++++++++++++++++++++++++
 hw/core/numa.c             |  62 -------
 include/sysemu/numa.h      |   2 +
 monitor/misc.c             |  13 --
 monitor/qmp-cmds.c         |  12 --
 vl.c                       |  45 -----
 9 files changed, 332 insertions(+), 320 deletions(-)
 create mode 100644 hw/core/machine-qmp-cmds.c
MAINTAINERS +1 -0
index 96a72a999a..0e6d0861ab 100644
@@ -1265,6 +1265,7 @@ Machine core
 M: Eduardo Habkost <[email protected]>
 M: Marcel Apfelbaum <[email protected]>
 S: Supported
+F: hw/core/machine-qmp-cmds.c
 F: hw/core/machine.c
 F: hw/core/null-machine.c
 F: hw/core/numa.c
cpus.c +0 -188

213 lines not on this page · raw message

hw/core/Makefile.objs +1 -0
index e3a8307be6..99e7abe982 100644
@@ -23,4 +23,5 @@ common-obj-$(CONFIG_PLATFORM_BUS) += platform-bus.o
 common-obj-$(CONFIG_SOFTMMU) += generic-loader.o
 common-obj-$(CONFIG_SOFTMMU) += null-machine.o
 
+obj-$(CONFIG_SOFTMMU) += machine-qmp-cmds.o
 obj-$(CONFIG_SOFTMMU) += numa.o
hw/core/machine-qmp-cmds.c new file +328 -0

328 lines not on this page · raw message

hw/core/numa.c +0 -62

90 lines not on this page · raw message

include/sysemu/numa.h +2 -0
index b6ac7de43e..01a263eba2 100644
@@ -22,6 +22,8 @@ struct NumaNodeMem {
 };
 
 extern NodeInfo numa_info[MAX_NODES];
+
+void set_numa_options(MachineState *ms, NumaOptions *object, Error **errp);
 void parse_numa_opts(MachineState *ms);
 void numa_complete_configuration(MachineState *ms);
 void query_numa_node_mem(NumaNodeMem node_mem[]);
monitor/misc.c +0 -13
index 2fb6896e84..45f3f55a4d 100644
@@ -2338,16 +2338,3 @@ void monitor_init_globals(void)
     sortcmdlist();
     qemu_mutex_init(&mon_fdsets_lock);
 }
-
-HotpluggableCPUList *qmp_query_hotpluggable_cpus(Error **errp)
-{
-    MachineState *ms = MACHINE(qdev_get_machine());
-    MachineClass *mc = MACHINE_GET_CLASS(ms);
-
-    if (!mc->has_hotpluggable_cpus) {
-        error_setg(errp, QERR_FEATURE_DISABLED, "query-hotpluggable-cpus");
-        return NULL;
-    }
-
-    return machine_query_hotpluggable_cpus(ms);
-}
monitor/qmp-cmds.c +0 -12
index 58b54db033..8c55315839 100644
@@ -114,18 +114,6 @@ void qmp_system_powerdown(Error **erp)
     qemu_system_powerdown_request();
 }
 
-void qmp_cpu_add(int64_t id, Error **errp)
-{
-    MachineClass *mc;
-
-    mc = MACHINE_GET_CLASS(current_machine);
-    if (mc->hot_add_cpu) {
-        mc->hot_add_cpu(id, errp);
-    } else {
-        error_setg(errp, "Not supported");
-    }
-}
-
 void qmp_x_exit_preconfig(Error **errp)
 {
     if (!runstate_check(RUN_STATE_PRECONFIG)) {
vl.c +0 -45

69 lines not on this page · raw message

Signature · 1 line
2.21.0
Reviewed-by on v1 10/17
#32 lore raw

Re: [Qemu-devel] [PATCH 10/17] hw/core: Collect QMP command handlers in hw/core/

Quoted 9 lines · Markus Armbruster

The handlers for qapi/machine.json's QMP commands are spread over cpus.c, hw/core/numa.c, monitor/misc.c, monitor/qmp-cmds.c, and vl.c. Move them all to new hw/core/machine-qmp-cmds.c, where they are covered by MAINTAINERS section "Machine core", just like qapi/machine.json.

Cc Eduardo Habkost <[email protected]>
Cc Marcel Apfelbaum <[email protected]>
Quoted 12 lines
---
 MAINTAINERS                |   1 +
 cpus.c                     | 188 ---------------------
 hw/core/Makefile.objs      |   1 +
 hw/core/machine-qmp-cmds.c | 328 +++++++++++++++++++++++++++++++++++++
 hw/core/numa.c             |  62 -------
 include/sysemu/numa.h      |   2 +
 monitor/misc.c             |  13 --
 monitor/qmp-cmds.c         |  12 --
 vl.c                       |  45 -----
 9 files changed, 332 insertions(+), 320 deletions(-)
 create mode 100644 hw/core/machine-qmp-cmds.c

Regards,
Daniel

Signature · 3 lines
|: https://berrange.com      -o-    https://www.flickr.com/photos/dberrange :|
|: https://libvirt.org         -o-            https://fstop138.berrange.com :|
|: https://entangle-photo.org    -o-    https://www.instagram.com/dberrange :|
#33 lore raw

PATCH 11/17 hw/core: Collect HMP command handlers in hw/core/

In reply to Markus Armbruster

Move the HMP handlers related to qapi/machine.json to hw/core/machine-hmp-cmds.c, where they are covered by MAINTAINERS section "Machine core", just like qapi/machine.json.

Cc Eduardo Habkost <[email protected]>
Cc Marcel Apfelbaum <[email protected]>
Cc "Dr. David Alan Gilbert" <[email protected]>
---
 hw/core/Makefile.objs      |   1 +
 hw/core/machine-hmp-cmds.c | 164 +++++++++++++++++++++++++++++++++++++
 include/monitor/hmp.h      |   1 +
 monitor/hmp-cmds.c         | 111 -------------------------
 monitor/misc.c             |  32 +-------
 5 files changed, 168 insertions(+), 141 deletions(-)
 create mode 100644 hw/core/machine-hmp-cmds.c
hw/core/Makefile.objs +1 -0
index 99e7abe982..585b734358 100644
@@ -25,3 +25,4 @@ common-obj-$(CONFIG_SOFTMMU) += null-machine.o
 
 obj-$(CONFIG_SOFTMMU) += machine-qmp-cmds.o
 obj-$(CONFIG_SOFTMMU) += numa.o
+common-obj-$(CONFIG_SOFTMMU) += machine-hmp-cmds.o
hw/core/machine-hmp-cmds.c new file +164 -0

164 lines not on this page · raw message

include/monitor/hmp.h +1 -0
index f46ccdaa35..9d558e9d78 100644
@@ -117,6 +117,7 @@ void hmp_cpu_add(Monitor *mon, const QDict *qdict);
 void hmp_object_add(Monitor *mon, const QDict *qdict);
 void hmp_object_del(Monitor *mon, const QDict *qdict);
 void hmp_info_memdev(Monitor *mon, const QDict *qdict);
+void hmp_info_numa(Monitor *mon, const QDict *qdict);
 void hmp_info_memory_devices(Monitor *mon, const QDict *qdict);
 void hmp_qom_list(Monitor *mon, const QDict *qdict);
 void hmp_qom_set(Monitor *mon, const QDict *qdict);
monitor/hmp-cmds.c +0 -111

141 lines not on this page · raw message

monitor/misc.c +2 -30
index 45f3f55a4d..00338c002a 100644
@@ -36,7 +36,6 @@
 #include "net/slirp.h"
 #include "chardev/char-mux.h"
 #include "ui/qemu-spice.h"
-#include "sysemu/numa.h"
 #include "qemu/config-file.h"
 #include "qemu/ctype.h"
 #include "ui/console.h"
@@ -48,6 +47,8 @@
 #include "sysemu/hw_accel.h"
 #include "authz/list.h"
 #include "qapi/util.h"
+#include "sysemu/blockdev.h"
+#include "sysemu/sysemu.h"
 #include "sysemu/tcg.h"
 #include "sysemu/tpm.h"
 #include "qapi/qmp/qdict.h"
@@ -1081,35 +1082,6 @@ static void hmp_info_mtree(Monitor *mon, const QDict *qdict)
     mtree_info(flatview, dispatch_tree, owner);
 }
 
-static void hmp_info_numa(Monitor *mon, const QDict *qdict)
-{
-    int i;
-    NumaNodeMem *node_mem;
-    CpuInfoList *cpu_list, *cpu;
-
-    cpu_list = qmp_query_cpus(&error_abort);
-    node_mem = g_new0(NumaNodeMem, nb_numa_nodes);
-
-    query_numa_node_mem(node_mem);
-    monitor_printf(mon, "%d nodes\n", nb_numa_nodes);
-    for (i = 0; i < nb_numa_nodes; i++) {
-        monitor_printf(mon, "node %d cpus:", i);
-        for (cpu = cpu_list; cpu; cpu = cpu->next) {
-            if (cpu->value->has_props && cpu->value->props->has_node_id &&
-                cpu->value->props->node_id == i) {
-                monitor_printf(mon, " %" PRIi64, cpu->value->CPU);
-            }
-        }
-        monitor_printf(mon, "\n");
-        monitor_printf(mon, "node %d size: %" PRId64 " MB\n", i,
-                       node_mem[i].node_mem >> 20);
-        monitor_printf(mon, "node %d plugged: %" PRId64 " MB\n", i,
-                       node_mem[i].node_plugged_mem >> 20);
-    }
-    qapi_free_CpuInfoList(cpu_list);
-    g_free(node_mem);
-}
-
 #ifdef CONFIG_PROFILER
 
 int64_t dev_time;
Signature · 1 line
2.21.0
Reviewed-by on v1 11/17
#34 lore raw

Re: [Qemu-devel] [PATCH 11/17] hw/core: Collect HMP command handlers in hw/core/

Quoted 8 lines · Markus Armbruster

Move the HMP handlers related to qapi/machine.json to hw/core/machine-hmp-cmds.c, where they are covered by MAINTAINERS section "Machine core", just like qapi/machine.json.

Cc Eduardo Habkost <[email protected]>
Cc Marcel Apfelbaum <[email protected]>
Cc "Dr. David Alan Gilbert" <[email protected]>
Quoted 8 lines
---
 hw/core/Makefile.objs      |   1 +
 hw/core/machine-hmp-cmds.c | 164 +++++++++++++++++++++++++++++++++++++
 include/monitor/hmp.h      |   1 +
 monitor/hmp-cmds.c         | 111 -------------------------
 monitor/misc.c             |  32 +-------
 5 files changed, 168 insertions(+), 141 deletions(-)
 create mode 100644 hw/core/machine-hmp-cmds.c

Regards,
Daniel

Signature · 3 lines
|: https://berrange.com      -o-    https://www.flickr.com/photos/dberrange :|
|: https://libvirt.org         -o-            https://fstop138.berrange.com :|
|: https://entangle-photo.org    -o-    https://www.instagram.com/dberrange :|
Reviewed-by on v1 11/17
#35 lore raw

Re: [Qemu-devel] [PATCH 11/17] hw/core: Collect HMP command handlers in hw/core/

In reply to Markus Armbruster
Quoted 8 lines · * Markus Armbruster ([email protected]) wrote:

Move the HMP handlers related to qapi/machine.json to hw/core/machine-hmp-cmds.c, where they are covered by MAINTAINERS section "Machine core", just like qapi/machine.json.

Cc Eduardo Habkost <[email protected]>
Cc Marcel Apfelbaum <[email protected]>
Cc "Dr. David Alan Gilbert" <[email protected]>
Quoted 410 lines
---
 hw/core/Makefile.objs      |   1 +
 hw/core/machine-hmp-cmds.c | 164 +++++++++++++++++++++++++++++++++++++
 include/monitor/hmp.h      |   1 +
 monitor/hmp-cmds.c         | 111 -------------------------
 monitor/misc.c             |  32 +-------
 5 files changed, 168 insertions(+), 141 deletions(-)
 create mode 100644 hw/core/machine-hmp-cmds.c
hw/core/Makefile.objs +1 -0
index 99e7abe982..585b734358 100644
@@ -25,3 +25,4 @@ common-obj-$(CONFIG_SOFTMMU) += null-machine.o
 
 obj-$(CONFIG_SOFTMMU) += machine-qmp-cmds.o
 obj-$(CONFIG_SOFTMMU) += numa.o
+common-obj-$(CONFIG_SOFTMMU) += machine-hmp-cmds.o
hw/core/machine-hmp-cmds.c new file +164 -0
new file mode 100644
index 0000000000..7fa6075f1e
@@ -0,0 +1,164 @@
+/*
+ * HMP commands related to machines and CPUs
+ *
+ * Copyright IBM, Corp. 2011
+ *
+ * Authors:
+ *  Anthony Liguori   <[email protected]>
+ *
+ * This work is licensed under the terms of the GNU GPL, version 2.  See
+ * the COPYING file in the top-level directory.
+ *
+ * Contributions after 2012-01-13 are licensed under the terms of the
+ * GNU GPL, version 2 or (at your option) any later version.
+ */
+
+#include "qemu/osdep.h"
+#include "monitor/hmp.h"
+#include "monitor/monitor.h"
+#include "qapi/error.h"
+#include "qapi/qapi-builtin-visit.h"
+#include "qapi/qapi-commands-machine.h"
+#include "qapi/qmp/qdict.h"
+#include "qapi/string-output-visitor.h"
+#include "qemu/error-report.h"
+#include "sysemu/numa.h"
+
+void hmp_info_cpus(Monitor *mon, const QDict *qdict)
+{
+    CpuInfoFastList *cpu_list, *cpu;
+
+    cpu_list = qmp_query_cpus_fast(NULL);
+
+    for (cpu = cpu_list; cpu; cpu = cpu->next) {
+        int active = ' ';
+
+        if (cpu->value->cpu_index == monitor_get_cpu_index()) {
+            active = '*';
+        }
+
+        monitor_printf(mon, "%c CPU #%" PRId64 ":", active,
+                       cpu->value->cpu_index);
+        monitor_printf(mon, " thread_id=%" PRId64 "\n", cpu->value->thread_id);
+    }
+
+    qapi_free_CpuInfoFastList(cpu_list);
+}
+
+void hmp_cpu_add(Monitor *mon, const QDict *qdict)
+{
+    int cpuid;
+    Error *err = NULL;
+
+    error_report("cpu_add is deprecated, please use device_add instead");
+
+    cpuid = qdict_get_int(qdict, "id");
+    qmp_cpu_add(cpuid, &err);
+    hmp_handle_error(mon, &err);
+}
+
+void hmp_hotpluggable_cpus(Monitor *mon, const QDict *qdict)
+{
+    Error *err = NULL;
+    HotpluggableCPUList *l = qmp_query_hotpluggable_cpus(&err);
+    HotpluggableCPUList *saved = l;
+    CpuInstanceProperties *c;
+
+    if (err != NULL) {
+        hmp_handle_error(mon, &err);
+        return;
+    }
+
+    monitor_printf(mon, "Hotpluggable CPUs:\n");
+    while (l) {
+        monitor_printf(mon, "  type: \"%s\"\n", l->value->type);
+        monitor_printf(mon, "  vcpus_count: \"%" PRIu64 "\"\n",
+                       l->value->vcpus_count);
+        if (l->value->has_qom_path) {
+            monitor_printf(mon, "  qom_path: \"%s\"\n", l->value->qom_path);
+        }
+
+        c = l->value->props;
+        monitor_printf(mon, "  CPUInstance Properties:\n");
+        if (c->has_node_id) {
+            monitor_printf(mon, "    node-id: \"%" PRIu64 "\"\n", c->node_id);
+        }
+        if (c->has_socket_id) {
+            monitor_printf(mon, "    socket-id: \"%" PRIu64 "\"\n", c->socket_id);
+        }
+        if (c->has_core_id) {
+            monitor_printf(mon, "    core-id: \"%" PRIu64 "\"\n", c->core_id);
+        }
+        if (c->has_thread_id) {
+            monitor_printf(mon, "    thread-id: \"%" PRIu64 "\"\n", c->thread_id);
+        }
+
+        l = l->next;
+    }
+
+    qapi_free_HotpluggableCPUList(saved);
+}
+
+void hmp_info_memdev(Monitor *mon, const QDict *qdict)
+{
+    Error *err = NULL;
+    MemdevList *memdev_list = qmp_query_memdev(&err);
+    MemdevList *m = memdev_list;
+    Visitor *v;
+    char *str;
+
+    while (m) {
+        v = string_output_visitor_new(false, &str);
+        visit_type_uint16List(v, NULL, &m->value->host_nodes, NULL);
+        monitor_printf(mon, "memory backend: %s\n", m->value->id);
+        monitor_printf(mon, "  size:  %" PRId64 "\n", m->value->size);
+        monitor_printf(mon, "  merge: %s\n",
+                       m->value->merge ? "true" : "false");
+        monitor_printf(mon, "  dump: %s\n",
+                       m->value->dump ? "true" : "false");
+        monitor_printf(mon, "  prealloc: %s\n",
+                       m->value->prealloc ? "true" : "false");
+        monitor_printf(mon, "  policy: %s\n",
+                       HostMemPolicy_str(m->value->policy));
+        visit_complete(v, &str);
+        monitor_printf(mon, "  host nodes: %s\n", str);
+
+        g_free(str);
+        visit_free(v);
+        m = m->next;
+    }
+
+    monitor_printf(mon, "\n");
+
+    qapi_free_MemdevList(memdev_list);
+    hmp_handle_error(mon, &err);
+}
+
+void hmp_info_numa(Monitor *mon, const QDict *qdict)
+{
+    int i;
+    NumaNodeMem *node_mem;
+    CpuInfoList *cpu_list, *cpu;
+
+    cpu_list = qmp_query_cpus(&error_abort);
+    node_mem = g_new0(NumaNodeMem, nb_numa_nodes);
+
+    query_numa_node_mem(node_mem);
+    monitor_printf(mon, "%d nodes\n", nb_numa_nodes);
+    for (i = 0; i < nb_numa_nodes; i++) {
+        monitor_printf(mon, "node %d cpus:", i);
+        for (cpu = cpu_list; cpu; cpu = cpu->next) {
+            if (cpu->value->has_props && cpu->value->props->has_node_id &&
+                cpu->value->props->node_id == i) {
+                monitor_printf(mon, " %" PRIi64, cpu->value->CPU);
+            }
+        }
+        monitor_printf(mon, "\n");
+        monitor_printf(mon, "node %d size: %" PRId64 " MB\n", i,
+                       node_mem[i].node_mem >> 20);
+        monitor_printf(mon, "node %d plugged: %" PRId64 " MB\n", i,
+                       node_mem[i].node_plugged_mem >> 20);
+    }
+    qapi_free_CpuInfoList(cpu_list);
+    g_free(node_mem);
+}
include/monitor/hmp.h +1 -0
index f46ccdaa35..9d558e9d78 100644
@@ -117,6 +117,7 @@ void hmp_cpu_add(Monitor *mon, const QDict *qdict);
 void hmp_object_add(Monitor *mon, const QDict *qdict);
 void hmp_object_del(Monitor *mon, const QDict *qdict);
 void hmp_info_memdev(Monitor *mon, const QDict *qdict);
+void hmp_info_numa(Monitor *mon, const QDict *qdict);
 void hmp_info_memory_devices(Monitor *mon, const QDict *qdict);
 void hmp_qom_list(Monitor *mon, const QDict *qdict);
 void hmp_qom_set(Monitor *mon, const QDict *qdict);
monitor/hmp-cmds.c +0 -111
index 789f763938..ea8ae2966e 100644
@@ -31,7 +31,6 @@
 #include "qapi/qapi-builtin-visit.h"
 #include "qapi/qapi-commands-block.h"
 #include "qapi/qapi-commands-char.h"
-#include "qapi/qapi-commands-machine.h"
 #include "qapi/qapi-commands-migration.h"
 #include "qapi/qapi-commands-misc.h"
 #include "qapi/qapi-commands-net.h"
@@ -457,27 +456,6 @@ void hmp_info_migrate_cache_size(Monitor *mon, const QDict *qdict)
                    qmp_query_migrate_cache_size(NULL) >> 10);
 }
 
-void hmp_info_cpus(Monitor *mon, const QDict *qdict)
-{
-    CpuInfoFastList *cpu_list, *cpu;
-
-    cpu_list = qmp_query_cpus_fast(NULL);
-
-    for (cpu = cpu_list; cpu; cpu = cpu->next) {
-        int active = ' ';
-
-        if (cpu->value->cpu_index == monitor_get_cpu_index()) {
-            active = '*';
-        }
-
-        monitor_printf(mon, "%c CPU #%" PRId64 ":", active,
-                       cpu->value->cpu_index);
-        monitor_printf(mon, " thread_id=%" PRId64 "\n", cpu->value->thread_id);
-    }
-
-    qapi_free_CpuInfoFastList(cpu_list);
-}
-
 static void print_block_info(Monitor *mon, BlockInfo *info,
                              BlockDeviceInfo *inserted, bool verbose)
 {
@@ -2472,18 +2450,6 @@ void hmp_nbd_server_stop(Monitor *mon, const QDict *qdict)
     hmp_handle_error(mon, &err);
 }
 
-void hmp_cpu_add(Monitor *mon, const QDict *qdict)
-{
-    int cpuid;
-    Error *err = NULL;
-
-    error_report("cpu_add is deprecated, please use device_add instead");
-
-    cpuid = qdict_get_int(qdict, "id");
-    qmp_cpu_add(cpuid, &err);
-    hmp_handle_error(mon, &err);
-}
-
 void hmp_chardev_add(Monitor *mon, const QDict *qdict)
 {
     const char *args = qdict_get_str(qdict, "args");
@@ -2615,41 +2581,6 @@ void hmp_object_del(Monitor *mon, const QDict *qdict)
     hmp_handle_error(mon, &err);
 }
 
-void hmp_info_memdev(Monitor *mon, const QDict *qdict)
-{
-    Error *err = NULL;
-    MemdevList *memdev_list = qmp_query_memdev(&err);
-    MemdevList *m = memdev_list;
-    Visitor *v;
-    char *str;
-
-    while (m) {
-        v = string_output_visitor_new(false, &str);
-        visit_type_uint16List(v, NULL, &m->value->host_nodes, NULL);
-        monitor_printf(mon, "memory backend: %s\n", m->value->id);
-        monitor_printf(mon, "  size:  %" PRId64 "\n", m->value->size);
-        monitor_printf(mon, "  merge: %s\n",
-                       m->value->merge ? "true" : "false");
-        monitor_printf(mon, "  dump: %s\n",
-                       m->value->dump ? "true" : "false");
-        monitor_printf(mon, "  prealloc: %s\n",
-                       m->value->prealloc ? "true" : "false");
-        monitor_printf(mon, "  policy: %s\n",
-                       HostMemPolicy_str(m->value->policy));
-        visit_complete(v, &str);
-        monitor_printf(mon, "  host nodes: %s\n", str);
-
-        g_free(str);
-        visit_free(v);
-        m = m->next;
-    }
-
-    monitor_printf(mon, "\n");
-
-    qapi_free_MemdevList(memdev_list);
-    hmp_handle_error(mon, &err);
-}
-
 void hmp_info_memory_devices(Monitor *mon, const QDict *qdict)
 {
     Error *err = NULL;
@@ -3039,48 +2970,6 @@ void hmp_info_ramblock(Monitor *mon, const QDict *qdict)
     ram_block_dump(mon);
 }
 
-void hmp_hotpluggable_cpus(Monitor *mon, const QDict *qdict)
-{
-    Error *err = NULL;
-    HotpluggableCPUList *l = qmp_query_hotpluggable_cpus(&err);
-    HotpluggableCPUList *saved = l;
-    CpuInstanceProperties *c;
-
-    if (err != NULL) {
-        hmp_handle_error(mon, &err);
-        return;
-    }
-
-    monitor_printf(mon, "Hotpluggable CPUs:\n");
-    while (l) {
-        monitor_printf(mon, "  type: \"%s\"\n", l->value->type);
-        monitor_printf(mon, "  vcpus_count: \"%" PRIu64 "\"\n",
-                       l->value->vcpus_count);
-        if (l->value->has_qom_path) {
-            monitor_printf(mon, "  qom_path: \"%s\"\n", l->value->qom_path);
-        }
-
-        c = l->value->props;
-        monitor_printf(mon, "  CPUInstance Properties:\n");
-        if (c->has_node_id) {
-            monitor_printf(mon, "    node-id: \"%" PRIu64 "\"\n", c->node_id);
-        }
-        if (c->has_socket_id) {
-            monitor_printf(mon, "    socket-id: \"%" PRIu64 "\"\n", c->socket_id);
-        }
-        if (c->has_core_id) {
-            monitor_printf(mon, "    core-id: \"%" PRIu64 "\"\n", c->core_id);
-        }
-        if (c->has_thread_id) {
-            monitor_printf(mon, "    thread-id: \"%" PRIu64 "\"\n", c->thread_id);
-        }
-
-        l = l->next;
-    }
-
-    qapi_free_HotpluggableCPUList(saved);
-}
-
 void hmp_info_vm_generation_id(Monitor *mon, const QDict *qdict)
 {
     Error *err = NULL;
monitor/misc.c +2 -30
index 45f3f55a4d..00338c002a 100644
@@ -36,7 +36,6 @@
 #include "net/slirp.h"
 #include "chardev/char-mux.h"
 #include "ui/qemu-spice.h"
-#include "sysemu/numa.h"
 #include "qemu/config-file.h"
 #include "qemu/ctype.h"
 #include "ui/console.h"
@@ -48,6 +47,8 @@
 #include "sysemu/hw_accel.h"
 #include "authz/list.h"
 #include "qapi/util.h"
+#include "sysemu/blockdev.h"
+#include "sysemu/sysemu.h"
 #include "sysemu/tcg.h"
 #include "sysemu/tpm.h"
 #include "qapi/qmp/qdict.h"
@@ -1081,35 +1082,6 @@ static void hmp_info_mtree(Monitor *mon, const QDict *qdict)
     mtree_info(flatview, dispatch_tree, owner);
 }
 
-static void hmp_info_numa(Monitor *mon, const QDict *qdict)
-{
-    int i;
-    NumaNodeMem *node_mem;
-    CpuInfoList *cpu_list, *cpu;
-
-    cpu_list = qmp_query_cpus(&error_abort);
-    node_mem = g_new0(NumaNodeMem, nb_numa_nodes);
-
-    query_numa_node_mem(node_mem);
-    monitor_printf(mon, "%d nodes\n", nb_numa_nodes);
-    for (i = 0; i < nb_numa_nodes; i++) {
-        monitor_printf(mon, "node %d cpus:", i);
-        for (cpu = cpu_list; cpu; cpu = cpu->next) {
-            if (cpu->value->has_props && cpu->value->props->has_node_id &&
-                cpu->value->props->node_id == i) {
-                monitor_printf(mon, " %" PRIi64, cpu->value->CPU);
-            }
-        }
-        monitor_printf(mon, "\n");
-        monitor_printf(mon, "node %d size: %" PRId64 " MB\n", i,
-                       node_mem[i].node_mem >> 20);
-        monitor_printf(mon, "node %d plugged: %" PRId64 " MB\n", i,
-                       node_mem[i].node_plugged_mem >> 20);
-    }
-    qapi_free_CpuInfoList(cpu_list);
-    g_free(node_mem);
-}
-
 #ifdef CONFIG_PROFILER
 
 int64_t dev_time;
Signature · 1 line
2.21.0

--
Dr. David Alan Gilbert / [email protected] / Manchester, UK

#36 lore raw

PATCH 12/17 qapi: Split machine-target.json off target.json and misc.json

In reply to Markus Armbruster

Move commands query-cpu-definitions, query-cpu-model-baseline, query-cpu-model-comparison, and query-cpu-model-expansion with their types from target.json to machine-target.json. Also move typee CpuModelInfo, CpuModelExpansionType, and CpuModelCompareResult from misc.json there. Add machine-target.json to MAINTAINERS section "Machine core".

Cc Eduardo Habkost <[email protected]>
Cc Marcel Apfelbaum <[email protected]>
---
 MAINTAINERS                     |   1 +
 qapi/Makefile.objs              |   2 +-
 qapi/machine-target.json        | 318 ++++++++++++++++++++++++++++++++
 qapi/misc.json                  |  74 --------
 qapi/qapi-schema.json           |   1 +
 qapi/target.json                | 242 ------------------------
 target/arm/helper.c             |   2 +-
 target/i386/cpu.c               |   2 +-
 target/mips/helper.c            |   2 +-
 target/ppc/translate_init.inc.c |   2 +-
 target/s390x/cpu_models.c       |   2 +-
 11 files changed, 326 insertions(+), 322 deletions(-)
 create mode 100644 qapi/machine-target.json
MAINTAINERS +1 -0
index 0e6d0861ab..89e8c01cf3 100644
@@ -1271,6 +1271,7 @@ F: hw/core/null-machine.c
 F: hw/core/numa.c
 F: hw/cpu/cluster.c
 F: qapi/machine.json
+F: qapi/machine-target.json
 F: qom/cpu.c
 F: include/hw/boards.h
 F: include/hw/cpu/cluster.h
qapi/Makefile.objs +1 -1
index 01dced01aa..4e87bef6e1 100644
@@ -9,7 +9,7 @@ QAPI_COMMON_MODULES = audio authz block-core block char common crypto
 QAPI_COMMON_MODULES += introspect job machine migration misc net
 QAPI_COMMON_MODULES += qdev qom rdma rocker run-state sockets tpm
 QAPI_COMMON_MODULES += trace transaction ui
-QAPI_TARGET_MODULES = target
+QAPI_TARGET_MODULES = machine-target target
 QAPI_MODULES = $(QAPI_COMMON_MODULES) $(QAPI_TARGET_MODULES)
 
 util-obj-y += qapi-builtin-types.o
qapi/machine-target.json new file +318 -0

318 lines not on this page · raw message

qapi/misc.json +0 -74

80 lines not on this page · raw message

qapi/qapi-schema.json +1 -0
index 31611191db..8dc82fde31 100644
@@ -100,6 +100,7 @@
 { 'include': 'qom.json' }
 { 'include': 'qdev.json' }
 { 'include': 'machine.json' }
+{ 'include': 'machine-target.json' }
 { 'include': 'misc.json' }
 { 'include': 'target.json' }
 { 'include': 'audio.json' }
qapi/target.json +0 -242

257 lines not on this page · raw message

target/arm/helper.c +1 -1
index df4276f5f6..7caea52561 100644
@@ -21,7 +21,7 @@
 #include "sysemu/kvm.h"
 #include "fpu/softfloat.h"
 #include "qemu/range.h"
-#include "qapi/qapi-commands-target.h"
+#include "qapi/qapi-commands-machine-target.h"
 #include "qapi/error.h"
 #include "qemu/guest-random.h"
 
target/i386/cpu.c +1 -1
index cb50f05e7e..4051066079 100644
@@ -43,7 +43,7 @@
 #include "qapi/visitor.h"
 #include "qom/qom-qobject.h"
 #include "sysemu/arch_init.h"
-#include "qapi/qapi-commands-target.h"
+#include "qapi/qapi-commands-machine-target.h"
 
 #include "standard-headers/asm-x86/kvm_para.h"
 
target/mips/helper.c +1 -1
index 6e6a44292f..a2b6459b05 100644
@@ -24,7 +24,7 @@
 #include "exec/cpu_ldst.h"
 #include "exec/log.h"
 #include "hw/mips/cpudevs.h"
-#include "qapi/qapi-commands-target.h"
+#include "qapi/qapi-commands-machine-target.h"
 
 enum {
     TLBRET_XI = -6,
target/ppc/translate_init.inc.c +1 -1
index 03cb6d0521..86fc8f2e31 100644
@@ -41,7 +41,7 @@
 #include "qemu/cutils.h"
 #include "disas/capstone.h"
 #include "fpu/softfloat.h"
-#include "qapi/qapi-commands-target.h"
+#include "qapi/qapi-commands-machine-target.h"
 
 /* #define PPC_DUMP_CPU */
 /* #define PPC_DEBUG_SPR */
target/s390x/cpu_models.c +1 -1
index 19ebde14db..2cb09c0780 100644
@@ -28,7 +28,7 @@
 #include "sysemu/arch_init.h"
 #include "hw/pci/pci.h"
 #endif
-#include "qapi/qapi-commands-target.h"
+#include "qapi/qapi-commands-machine-target.h"
 
 #define CPUDEF_INIT(_type, _gen, _ec_ga, _mha_pow, _hmfai, _name, _desc) \
     {                                                                    \
Signature · 1 line
2.21.0
#37 lore raw

Re: [Qemu-devel] [PATCH 12/17] qapi: Split machine-target.json off target.json and misc.json

Quoted 3 lines · Markus Armbruster

Move commands query-cpu-definitions, query-cpu-model-baseline, query-cpu-model-comparison, and query-cpu-model-expansion with their types from target.json to machine-target.json. Also move typee

s/typee/types/

Quoted 8 lines

CpuModelInfo, CpuModelExpansionType, and CpuModelCompareResult from misc.json there. Add machine-target.json to MAINTAINERS section "Machine core".

Cc Eduardo Habkost <[email protected]>
Cc Marcel Apfelbaum <[email protected]>

---

Signature · 3 lines
Eric Blake, Principal Software Engineer
Red Hat, Inc.           +1-919-301-3226
Virtualization:  qemu.org | libvirt.org
#38 lore raw

Re: [Qemu-devel] [PATCH 12/17] qapi: Split machine-target.json off target.json and misc.json

Quoted 6 lines · Eric Blake
Quoted 3 lines · Markus Armbruster

Move commands query-cpu-definitions, query-cpu-model-baseline, query-cpu-model-comparison, and query-cpu-model-expansion with their types from target.json to machine-target.json. Also move typee

s/typee/types/

Will fix. Thanks!

Quoted 8 lines
Quoted 8 lines

CpuModelInfo, CpuModelExpansionType, and CpuModelCompareResult from misc.json there. Add machine-target.json to MAINTAINERS section "Machine core".

Cc Eduardo Habkost <[email protected]>
Cc Marcel Apfelbaum <[email protected]>

---

Reviewed-by on v1 12/17
#39 lore raw

Re: [Qemu-devel] [PATCH 12/17] qapi: Split machine-target.json off target.json and misc.json

In reply to Markus Armbruster
Quoted 10 lines · Markus Armbruster

Move commands query-cpu-definitions, query-cpu-model-baseline, query-cpu-model-comparison, and query-cpu-model-expansion with their types from target.json to machine-target.json. Also move typee CpuModelInfo, CpuModelExpansionType, and CpuModelCompareResult from misc.json there. Add machine-target.json to MAINTAINERS section "Machine core".

Cc Eduardo Habkost <[email protected]>
Cc Marcel Apfelbaum <[email protected]>
Quoted 14 lines
---
 MAINTAINERS                     |   1 +
 qapi/Makefile.objs              |   2 +-
 qapi/machine-target.json        | 318 ++++++++++++++++++++++++++++++++
 qapi/misc.json                  |  74 --------
 qapi/qapi-schema.json           |   1 +
 qapi/target.json                | 242 ------------------------
 target/arm/helper.c             |   2 +-
 target/i386/cpu.c               |   2 +-
 target/mips/helper.c            |   2 +-
 target/ppc/translate_init.inc.c |   2 +-
 target/s390x/cpu_models.c       |   2 +-
 11 files changed, 326 insertions(+), 322 deletions(-)
 create mode 100644 qapi/machine-target.json

With the typo fixed,

Regards,
Daniel

Signature · 3 lines
|: https://berrange.com      -o-    https://www.flickr.com/photos/dberrange :|
|: https://libvirt.org         -o-            https://fstop138.berrange.com :|
|: https://entangle-photo.org    -o-    https://www.instagram.com/dberrange :|
#40 lore raw

PATCH 13/17 qapi: Rename target.json to misc-target.json

In reply to Markus Armbruster
---
 hw/ppc/spapr_rtc.c                     | 2 +-
 hw/s390x/s390-skeys.c                  | 2 +-
 hw/timer/mc146818rtc.c                 | 4 ++--
 qapi/Makefile.objs                     | 2 +-
 qapi/{target.json => misc-target.json} | 4 ----
 qapi/qapi-schema.json                  | 2 +-
 target/arm/monitor.c                   | 2 +-
 target/i386/sev_i386.h                 | 2 +-
 8 files changed, 8 insertions(+), 12 deletions(-)
 rename qapi/{target.json => misc-target.json} (99%)
hw/ppc/spapr_rtc.c +1 -1
index af1ef30a53..6cf0113b34 100644
@@ -32,7 +32,7 @@
 #include "sysemu/sysemu.h"
 #include "hw/ppc/spapr.h"
 #include "qapi/error.h"
-#include "qapi/qapi-events-target.h"
+#include "qapi/qapi-events-misc-target.h"
 #include "qemu/cutils.h"
 #include "qemu/module.h"
 
hw/s390x/s390-skeys.c +1 -1
index daac936698..e5bd92c0c7 100644
@@ -14,7 +14,7 @@
 #include "hw/boards.h"
 #include "hw/s390x/storage-keys.h"
 #include "qapi/error.h"
-#include "qapi/qapi-commands-target.h"
+#include "qapi/qapi-commands-misc-target.h"
 #include "qapi/qmp/qdict.h"
 #include "qemu/error-report.h"
 #include "sysemu/kvm.h"
hw/timer/mc146818rtc.c +2 -2
index 0d79e000d2..ce4550b6f2 100644
@@ -33,8 +33,8 @@
 #include "sysemu/replay.h"
 #include "hw/timer/mc146818rtc.h"
 #include "qapi/error.h"
-#include "qapi/qapi-commands-target.h"
-#include "qapi/qapi-events-target.h"
+#include "qapi/qapi-commands-misc-target.h"
+#include "qapi/qapi-events-misc-target.h"
 #include "qapi/visitor.h"
 #include "exec/address-spaces.h"
 
qapi/Makefile.objs +1 -1
index 4e87bef6e1..c0be6fcd3e 100644
@@ -9,7 +9,7 @@ QAPI_COMMON_MODULES = audio authz block-core block char common crypto
 QAPI_COMMON_MODULES += introspect job machine migration misc net
 QAPI_COMMON_MODULES += qdev qom rdma rocker run-state sockets tpm
 QAPI_COMMON_MODULES += trace transaction ui
-QAPI_TARGET_MODULES = machine-target target
+QAPI_TARGET_MODULES = machine-target misc-target
 QAPI_MODULES = $(QAPI_COMMON_MODULES) $(QAPI_TARGET_MODULES)
 
 util-obj-y += qapi-builtin-types.o
qapi/misc-target.json renamed from qapi/target.json +0 -4
similarity index 99%
rename from qapi/target.json
rename to qapi/misc-target.json
index e0a73581d8..a00fd821eb 100644
@@ -1,10 +1,6 @@
 # -*- Mode: Python -*-
 #
 
-##
-# = Target-specific commands & events
-##
-
 ##
 # @RTC_CHANGE:
 #
qapi/qapi-schema.json +1 -1
index 8dc82fde31..bcfac85074 100644
@@ -102,5 +102,5 @@
 { 'include': 'machine.json' }
 { 'include': 'machine-target.json' }
 { 'include': 'misc.json' }
-{ 'include': 'target.json' }
+{ 'include': 'misc-target.json' }
 { 'include': 'audio.json' }
target/arm/monitor.c +1 -1
index 41b32b94b2..6ec6dd04ac 100644
@@ -23,7 +23,7 @@
 #include "qemu/osdep.h"
 #include "hw/boards.h"
 #include "kvm_arm.h"
-#include "qapi/qapi-commands-target.h"
+#include "qapi/qapi-commands-misc-target.h"
 
 static GICCapability *gic_cap_new(int version)
 {
target/i386/sev_i386.h +1 -1
index c0f9373beb..55313441ae 100644
@@ -19,7 +19,7 @@
 #include "sysemu/kvm.h"
 #include "sysemu/sev.h"
 #include "qemu/error-report.h"
-#include "qapi/qapi-commands-target.h"
+#include "qapi/qapi-commands-misc-target.h"
 
 #define SEV_POLICY_NODBG        0x1
 #define SEV_POLICY_NOKS         0x2
Signature · 1 line
2.21.0
Reviewed-by on v1 13/17
#41 lore raw

Re: [Qemu-devel] [PATCH 13/17] qapi: Rename target.json to misc-target.json

Quoted 12 lines · Markus Armbruster
---
 hw/ppc/spapr_rtc.c                     | 2 +-
 hw/s390x/s390-skeys.c                  | 2 +-
 hw/timer/mc146818rtc.c                 | 4 ++--
 qapi/Makefile.objs                     | 2 +-
 qapi/{target.json => misc-target.json} | 4 ----
 qapi/qapi-schema.json                  | 2 +-
 target/arm/monitor.c                   | 2 +-
 target/i386/sev_i386.h                 | 2 +-
 8 files changed, 8 insertions(+), 12 deletions(-)
 rename qapi/{target.json => misc-target.json} (99%)

Regards,
Daniel

Signature · 3 lines
|: https://berrange.com      -o-    https://www.flickr.com/photos/dberrange :|
|: https://libvirt.org         -o-            https://fstop138.berrange.com :|
|: https://entangle-photo.org    -o-    https://www.instagram.com/dberrange :|
#42 lore raw

PATCH 14/17 qapi: Split dump.json off misc.json

In reply to Markus Armbruster

Move commands dump-guest-memory, query-dump, query-dump-guest-memory-capability with their types from misc.json to new dump.json. Add dump.json to MAINTAINERS section "Dump".

Cc Marc-André Lureau <[email protected]>
---
 MAINTAINERS           |   1 +
 dump.c                |   4 +-
 include/sysemu/dump.h |   2 +-
 monitor/hmp-cmds.c    |   1 +
 qapi/Makefile.objs    |   2 +-
 qapi/dump.json        | 200 ++++++++++++++++++++++++++++++++++++++++++
 qapi/misc.json        | 192 ----------------------------------------
 qapi/qapi-schema.json |   1 +
 8 files changed, 207 insertions(+), 196 deletions(-)
 create mode 100644 qapi/dump.json
MAINTAINERS +1 -0
index 89e8c01cf3..ea110e99ca 100644
@@ -1855,6 +1855,7 @@ F: hw/misc/vmcoreinfo.c
 F: include/hw/misc/vmcoreinfo.h
 F: include/sysemu/dump-arch.h
 F: include/sysemu/dump.h
+F: qapi/dump.json
 F: scripts/dump-guest-memory.py
 F: stubs/dump.c
 
dump.c +2 -2
index e99554628c..c7b2301652 100644
@@ -24,8 +24,8 @@
 #include "sysemu/memory_mapping.h"
 #include "sysemu/cpus.h"
 #include "qapi/error.h"
-#include "qapi/qapi-commands-misc.h"
-#include "qapi/qapi-events-misc.h"
+#include "qapi/qapi-commands-dump.h"
+#include "qapi/qapi-events-dump.h"
 #include "qapi/qmp/qerror.h"
 #include "qemu/error-report.h"
 #include "hw/misc/vmcoreinfo.h"
include/sysemu/dump.h +1 -1
index d824bc0941..250143cb5a 100644
@@ -14,7 +14,7 @@
 #ifndef DUMP_H
 #define DUMP_H
 
-#include "qapi/qapi-types-misc.h"
+#include "qapi/qapi-types-dump.h"
 
 #define MAKEDUMPFILE_SIGNATURE      "makedumpfile"
 #define MAX_SIZE_MDF_HEADER         (4096) /* max size of makedumpfile_header */
monitor/hmp-cmds.c +1 -0
index ea8ae2966e..18ffeb7017 100644
@@ -31,6 +31,7 @@
 #include "qapi/qapi-builtin-visit.h"
 #include "qapi/qapi-commands-block.h"
 #include "qapi/qapi-commands-char.h"
+#include "qapi/qapi-commands-dump.h"
 #include "qapi/qapi-commands-migration.h"
 #include "qapi/qapi-commands-misc.h"
 #include "qapi/qapi-commands-net.h"
qapi/Makefile.objs +1 -1
index c0be6fcd3e..c5a29e86e2 100644
@@ -6,7 +6,7 @@ util-obj-y += qmp-event.o
 util-obj-y += qapi-util.o
 
 QAPI_COMMON_MODULES = audio authz block-core block char common crypto
-QAPI_COMMON_MODULES += introspect job machine migration misc net
+QAPI_COMMON_MODULES += dump introspect job machine migration misc net
 QAPI_COMMON_MODULES += qdev qom rdma rocker run-state sockets tpm
 QAPI_COMMON_MODULES += trace transaction ui
 QAPI_TARGET_MODULES = machine-target misc-target
qapi/dump.json new file +200 -0

200 lines not on this page · raw message

qapi/misc.json +0 -192

198 lines not on this page · raw message

qapi/qapi-schema.json +1 -0
index bcfac85074..38af54d6b3 100644
@@ -86,6 +86,7 @@
 { 'include': 'crypto.json' }
 { 'include': 'block.json' }
 { 'include': 'char.json' }
+{ 'include': 'dump.json' }
 { 'include': 'job.json' }
 { 'include': 'net.json' }
 { 'include': 'rdma.json' }
Signature · 1 line
2.21.0
Reviewed-by on v1 14/17
#43 lore raw

Re: [Qemu-devel] [PATCH 14/17] qapi: Split dump.json off misc.json

Quoted 7 lines · Markus Armbruster

Move commands dump-guest-memory, query-dump, query-dump-guest-memory-capability with their types from misc.json to new dump.json. Add dump.json to MAINTAINERS section "Dump".

Cc Marc-André Lureau <[email protected]>
Quoted 501 lines
---
 MAINTAINERS           |   1 +
 dump.c                |   4 +-
 include/sysemu/dump.h |   2 +-
 monitor/hmp-cmds.c    |   1 +
 qapi/Makefile.objs    |   2 +-
 qapi/dump.json        | 200 ++++++++++++++++++++++++++++++++++++++++++
 qapi/misc.json        | 192 ----------------------------------------
 qapi/qapi-schema.json |   1 +
 8 files changed, 207 insertions(+), 196 deletions(-)
 create mode 100644 qapi/dump.json
MAINTAINERS +1 -0
index 89e8c01cf3..ea110e99ca 100644
@@ -1855,6 +1855,7 @@ F: hw/misc/vmcoreinfo.c
 F: include/hw/misc/vmcoreinfo.h
 F: include/sysemu/dump-arch.h
 F: include/sysemu/dump.h
+F: qapi/dump.json
 F: scripts/dump-guest-memory.py
 F: stubs/dump.c
 
dump.c +2 -2
index e99554628c..c7b2301652 100644
@@ -24,8 +24,8 @@
 #include "sysemu/memory_mapping.h"
 #include "sysemu/cpus.h"
 #include "qapi/error.h"
-#include "qapi/qapi-commands-misc.h"
-#include "qapi/qapi-events-misc.h"
+#include "qapi/qapi-commands-dump.h"
+#include "qapi/qapi-events-dump.h"
 #include "qapi/qmp/qerror.h"
 #include "qemu/error-report.h"
 #include "hw/misc/vmcoreinfo.h"
include/sysemu/dump.h +1 -1
index d824bc0941..250143cb5a 100644
@@ -14,7 +14,7 @@
 #ifndef DUMP_H
 #define DUMP_H
 
-#include "qapi/qapi-types-misc.h"
+#include "qapi/qapi-types-dump.h"
 
 #define MAKEDUMPFILE_SIGNATURE      "makedumpfile"
 #define MAX_SIZE_MDF_HEADER         (4096) /* max size of makedumpfile_header */
monitor/hmp-cmds.c +1 -0
index ea8ae2966e..18ffeb7017 100644
@@ -31,6 +31,7 @@
 #include "qapi/qapi-builtin-visit.h"
 #include "qapi/qapi-commands-block.h"
 #include "qapi/qapi-commands-char.h"
+#include "qapi/qapi-commands-dump.h"
 #include "qapi/qapi-commands-migration.h"
 #include "qapi/qapi-commands-misc.h"
 #include "qapi/qapi-commands-net.h"
qapi/Makefile.objs +1 -1
index c0be6fcd3e..c5a29e86e2 100644
@@ -6,7 +6,7 @@ util-obj-y += qmp-event.o
 util-obj-y += qapi-util.o
 
 QAPI_COMMON_MODULES = audio authz block-core block char common crypto
-QAPI_COMMON_MODULES += introspect job machine migration misc net
+QAPI_COMMON_MODULES += dump introspect job machine migration misc net
 QAPI_COMMON_MODULES += qdev qom rdma rocker run-state sockets tpm
 QAPI_COMMON_MODULES += trace transaction ui
 QAPI_TARGET_MODULES = machine-target misc-target
qapi/dump.json new file +200 -0
new file mode 100644
index 0000000000..2b35409a7b
@@ -0,0 +1,200 @@
+# -*- Mode: Python -*-
+#
+# This work is licensed under the terms of the GNU GPL, version 2 or later.
+# See the COPYING file in the top-level directory.
+
+##
+# = Dump guest memory
+##
+
+##
+# @DumpGuestMemoryFormat:
+#
+# An enumeration of guest-memory-dump's format.
+#
+# @elf: elf format
+#
+# @kdump-zlib: kdump-compressed format with zlib-compressed
+#
+# @kdump-lzo: kdump-compressed format with lzo-compressed
+#
+# @kdump-snappy: kdump-compressed format with snappy-compressed
+#
+# @win-dmp: Windows full crashdump format,
+#           can be used instead of ELF converting (since 2.13)
+#
+# Since: 2.0
+##
+{ 'enum': 'DumpGuestMemoryFormat',
+  'data': [ 'elf', 'kdump-zlib', 'kdump-lzo', 'kdump-snappy', 'win-dmp' ] }
+
+##
+# @dump-guest-memory:
+#
+# Dump guest's memory to vmcore. It is a synchronous operation that can take
+# very long depending on the amount of guest memory.
+#
+# @paging: if true, do paging to get guest's memory mapping. This allows
+#          using gdb to process the core file.
+#
+#          IMPORTANT: this option can make QEMU allocate several gigabytes
+#                     of RAM. This can happen for a large guest, or a
+#                     malicious guest pretending to be large.
+#
+#          Also, paging=true has the following limitations:
+#
+#             1. The guest may be in a catastrophic state or can have corrupted
+#                memory, which cannot be trusted
+#             2. The guest can be in real-mode even if paging is enabled. For
+#                example, the guest uses ACPI to sleep, and ACPI sleep state
+#                goes in real-mode
+#             3. Currently only supported on i386 and x86_64.
+#
+# @protocol: the filename or file descriptor of the vmcore. The supported
+#            protocols are:
+#
+#            1. file: the protocol starts with "file:", and the following
+#               string is the file's path.
+#            2. fd: the protocol starts with "fd:", and the following string
+#               is the fd's name.
+#
+# @detach: if true, QMP will return immediately rather than
+#          waiting for the dump to finish. The user can track progress
+#          using "query-dump". (since 2.6).
+#
+# @begin: if specified, the starting physical address.
+#
+# @length: if specified, the memory size, in bytes. If you don't
+#          want to dump all guest's memory, please specify the start @begin
+#          and @length
+#
+# @format: if specified, the format of guest memory dump. But non-elf
+#          format is conflict with paging and filter, ie. @paging, @begin and
+#          @length is not allowed to be specified with non-elf @format at the
+#          same time (since 2.0)
+#
+# Note: All boolean arguments default to false
+#
+# Returns: nothing on success
+#
+# Since: 1.2
+#
+# Example:
+#
+# -> { "execute": "dump-guest-memory",
+#      "arguments": { "protocol": "fd:dump" } }
+# <- { "return": {} }
+#
+##
+{ 'command': 'dump-guest-memory',
+  'data': { 'paging': 'bool', 'protocol': 'str', '*detach': 'bool',
+            '*begin': 'int', '*length': 'int',
+            '*format': 'DumpGuestMemoryFormat'} }
+
+##
+# @DumpStatus:
+#
+# Describe the status of a long-running background guest memory dump.
+#
+# @none: no dump-guest-memory has started yet.
+#
+# @active: there is one dump running in background.
+#
+# @completed: the last dump has finished successfully.
+#
+# @failed: the last dump has failed.
+#
+# Since: 2.6
+##
+{ 'enum': 'DumpStatus',
+  'data': [ 'none', 'active', 'completed', 'failed' ] }
+
+##
+# @DumpQueryResult:
+#
+# The result format for 'query-dump'.
+#
+# @status: enum of @DumpStatus, which shows current dump status
+#
+# @completed: bytes written in latest dump (uncompressed)
+#
+# @total: total bytes to be written in latest dump (uncompressed)
+#
+# Since: 2.6
+##
+{ 'struct': 'DumpQueryResult',
+  'data': { 'status': 'DumpStatus',
+            'completed': 'int',
+            'total': 'int' } }
+
+##
+# @query-dump:
+#
+# Query latest dump status.
+#
+# Returns: A @DumpStatus object showing the dump status.
+#
+# Since: 2.6
+#
+# Example:
+#
+# -> { "execute": "query-dump" }
+# <- { "return": { "status": "active", "completed": 1024000,
+#                  "total": 2048000 } }
+#
+##
+{ 'command': 'query-dump', 'returns': 'DumpQueryResult' }
+
+##
+# @DUMP_COMPLETED:
+#
+# Emitted when background dump has completed
+#
+# @result: final dump status
+#
+# @error: human-readable error string that provides
+#         hint on why dump failed. Only presents on failure. The
+#         user should not try to interpret the error string.
+#
+# Since: 2.6
+#
+# Example:
+#
+# { "event": "DUMP_COMPLETED",
+#   "data": {"result": {"total": 1090650112, "status": "completed",
+#                       "completed": 1090650112} } }
+#
+##
+{ 'event': 'DUMP_COMPLETED' ,
+  'data': { 'result': 'DumpQueryResult', '*error': 'str' } }
+
+##
+# @DumpGuestMemoryCapability:
+#
+# A list of the available formats for dump-guest-memory
+#
+# Since: 2.0
+##
+{ 'struct': 'DumpGuestMemoryCapability',
+  'data': {
+      'formats': ['DumpGuestMemoryFormat'] } }
+
+##
+# @query-dump-guest-memory-capability:
+#
+# Returns the available formats for dump-guest-memory
+#
+# Returns:  A @DumpGuestMemoryCapability object listing available formats for
+#           dump-guest-memory
+#
+# Since: 2.0
+#
+# Example:
+#
+# -> { "execute": "query-dump-guest-memory-capability" }
+# <- { "return": { "formats":
+#                  ["elf", "kdump-zlib", "kdump-lzo", "kdump-snappy"] }
+#
+##
+{ 'command': 'query-dump-guest-memory-capability',
+  'returns': 'DumpGuestMemoryCapability' }
qapi/misc.json +0 -192
index d7db863c81..31427d45a6 100644
@@ -1117,198 +1117,6 @@
 ##
 { 'command': 'xen-set-global-dirty-log', 'data': { 'enable': 'bool' } }
 
-##
-# @DumpGuestMemoryFormat:
-#
-# An enumeration of guest-memory-dump's format.
-#
-# @elf: elf format
-#
-# @kdump-zlib: kdump-compressed format with zlib-compressed
-#
-# @kdump-lzo: kdump-compressed format with lzo-compressed
-#
-# @kdump-snappy: kdump-compressed format with snappy-compressed
-#
-# @win-dmp: Windows full crashdump format,
-#           can be used instead of ELF converting (since 2.13)
-#
-# Since: 2.0
-##
-{ 'enum': 'DumpGuestMemoryFormat',
-  'data': [ 'elf', 'kdump-zlib', 'kdump-lzo', 'kdump-snappy', 'win-dmp' ] }
-
-##
-# @dump-guest-memory:
-#
-# Dump guest's memory to vmcore. It is a synchronous operation that can take
-# very long depending on the amount of guest memory.
-#
-# @paging: if true, do paging to get guest's memory mapping. This allows
-#          using gdb to process the core file.
-#
-#          IMPORTANT: this option can make QEMU allocate several gigabytes
-#                     of RAM. This can happen for a large guest, or a
-#                     malicious guest pretending to be large.
-#
-#          Also, paging=true has the following limitations:
-#
-#             1. The guest may be in a catastrophic state or can have corrupted
-#                memory, which cannot be trusted
-#             2. The guest can be in real-mode even if paging is enabled. For
-#                example, the guest uses ACPI to sleep, and ACPI sleep state
-#                goes in real-mode
-#             3. Currently only supported on i386 and x86_64.
-#
-# @protocol: the filename or file descriptor of the vmcore. The supported
-#            protocols are:
-#
-#            1. file: the protocol starts with "file:", and the following
-#               string is the file's path.
-#            2. fd: the protocol starts with "fd:", and the following string
-#               is the fd's name.
-#
-# @detach: if true, QMP will return immediately rather than
-#          waiting for the dump to finish. The user can track progress
-#          using "query-dump". (since 2.6).
-#
-# @begin: if specified, the starting physical address.
-#
-# @length: if specified, the memory size, in bytes. If you don't
-#          want to dump all guest's memory, please specify the start @begin
-#          and @length
-#
-# @format: if specified, the format of guest memory dump. But non-elf
-#          format is conflict with paging and filter, ie. @paging, @begin and
-#          @length is not allowed to be specified with non-elf @format at the
-#          same time (since 2.0)
-#
-# Note: All boolean arguments default to false
-#
-# Returns: nothing on success
-#
-# Since: 1.2
-#
-# Example:
-#
-# -> { "execute": "dump-guest-memory",
-#      "arguments": { "protocol": "fd:dump" } }
-# <- { "return": {} }
-#
-##
-{ 'command': 'dump-guest-memory',
-  'data': { 'paging': 'bool', 'protocol': 'str', '*detach': 'bool',
-            '*begin': 'int', '*length': 'int',
-            '*format': 'DumpGuestMemoryFormat'} }
-
-##
-# @DumpStatus:
-#
-# Describe the status of a long-running background guest memory dump.
-#
-# @none: no dump-guest-memory has started yet.
-#
-# @active: there is one dump running in background.
-#
-# @completed: the last dump has finished successfully.
-#
-# @failed: the last dump has failed.
-#
-# Since: 2.6
-##
-{ 'enum': 'DumpStatus',
-  'data': [ 'none', 'active', 'completed', 'failed' ] }
-
-##
-# @DumpQueryResult:
-#
-# The result format for 'query-dump'.
-#
-# @status: enum of @DumpStatus, which shows current dump status
-#
-# @completed: bytes written in latest dump (uncompressed)
-#
-# @total: total bytes to be written in latest dump (uncompressed)
-#
-# Since: 2.6
-##
-{ 'struct': 'DumpQueryResult',
-  'data': { 'status': 'DumpStatus',
-            'completed': 'int',
-            'total': 'int' } }
-
-##
-# @query-dump:
-#
-# Query latest dump status.
-#
-# Returns: A @DumpStatus object showing the dump status.
-#
-# Since: 2.6
-#
-# Example:
-#
-# -> { "execute": "query-dump" }
-# <- { "return": { "status": "active", "completed": 1024000,
-#                  "total": 2048000 } }
-#
-##
-{ 'command': 'query-dump', 'returns': 'DumpQueryResult' }
-
-##
-# @DUMP_COMPLETED:
-#
-# Emitted when background dump has completed
-#
-# @result: final dump status
-#
-# @error: human-readable error string that provides
-#         hint on why dump failed. Only presents on failure. The
-#         user should not try to interpret the error string.
-#
-# Since: 2.6
-#
-# Example:
-#
-# { "event": "DUMP_COMPLETED",
-#   "data": {"result": {"total": 1090650112, "status": "completed",
-#                       "completed": 1090650112} } }
-#
-##
-{ 'event': 'DUMP_COMPLETED' ,
-  'data': { 'result': 'DumpQueryResult', '*error': 'str' } }
-
-##
-# @DumpGuestMemoryCapability:
-#
-# A list of the available formats for dump-guest-memory
-#
-# Since: 2.0
-##
-{ 'struct': 'DumpGuestMemoryCapability',
-  'data': {
-      'formats': ['DumpGuestMemoryFormat'] } }
-
-##
-# @query-dump-guest-memory-capability:
-#
-# Returns the available formats for dump-guest-memory
-#
-# Returns:  A @DumpGuestMemoryCapability object listing available formats for
-#           dump-guest-memory
-#
-# Since: 2.0
-#
-# Example:
-#
-# -> { "execute": "query-dump-guest-memory-capability" }
-# <- { "return": { "formats":
-#                  ["elf", "kdump-zlib", "kdump-lzo", "kdump-snappy"] }
-#
-##
-{ 'command': 'query-dump-guest-memory-capability',
-  'returns': 'DumpGuestMemoryCapability' }
-
 ##
 # @getfd:
 #
qapi/qapi-schema.json +1 -1
index bcfac85074..38af54d6b3 100644
@@ -86,6 +86,7 @@
 { 'include': 'crypto.json' }
 { 'include': 'block.json' }
 { 'include': 'char.json' }
+{ 'include': 'dump.json' }
 { 'include': 'job.json' }
 { 'include': 'net.json' }
 { 'include': 'rdma.json' }
--

2.21.0

Reviewed-by on v1 14/17
#44 lore raw

Re: [Qemu-devel] [PATCH 14/17] qapi: Split dump.json off misc.json

In reply to Markus Armbruster
Quoted 6 lines · Markus Armbruster

Move commands dump-guest-memory, query-dump, query-dump-guest-memory-capability with their types from misc.json to new dump.json. Add dump.json to MAINTAINERS section "Dump".

Cc Marc-André Lureau <[email protected]>
Quoted 11 lines
---
 MAINTAINERS           |   1 +
 dump.c                |   4 +-
 include/sysemu/dump.h |   2 +-
 monitor/hmp-cmds.c    |   1 +
 qapi/Makefile.objs    |   2 +-
 qapi/dump.json        | 200 ++++++++++++++++++++++++++++++++++++++++++
 qapi/misc.json        | 192 ----------------------------------------
 qapi/qapi-schema.json |   1 +
 8 files changed, 207 insertions(+), 196 deletions(-)
 create mode 100644 qapi/dump.json

Regards,
Daniel

Signature · 3 lines
|: https://berrange.com      -o-    https://www.flickr.com/photos/dberrange :|
|: https://libvirt.org         -o-            https://fstop138.berrange.com :|
|: https://entangle-photo.org    -o-    https://www.instagram.com/dberrange :|
#45 lore raw

PATCH 15/17 dump: Move the code to dump/

In reply to Markus Armbruster
Cc Marc-André Lureau <[email protected]>
---
 MAINTAINERS                   | 2 +-
 Makefile.target               | 3 +--
 dump/Makefile.objs            | 2 ++
 dump.c => dump/dump.c         | 0
 win_dump.c => dump/win_dump.c | 0
 win_dump.h => dump/win_dump.h | 0
 6 files changed, 4 insertions(+), 3 deletions(-)
 create mode 100644 dump/Makefile.objs
 rename dump.c => dump/dump.c (100%)
 rename win_dump.c => dump/win_dump.c (100%)
 rename win_dump.h => dump/win_dump.h (100%)
MAINTAINERS +1 -1
index ea110e99ca..a3fdda015f 100644
@@ -1850,7 +1850,7 @@ F: include/sysemu/device_tree.h
 Dump
 S: Supported
 M: Marc-André Lureau <[email protected]>
-F: dump.c
+F: dump/dump.c
 F: hw/misc/vmcoreinfo.c
 F: include/hw/misc/vmcoreinfo.h
 F: include/sysemu/dump-arch.h
Makefile.target +1 -2
index 167ae2174e..a6919e0caf 100644
@@ -150,13 +150,12 @@ endif #CONFIG_BSD_USER
 ifdef CONFIG_SOFTMMU
 obj-y += arch_init.o cpus.o gdbstub.o balloon.o ioport.o
 obj-y += qtest.o
+obj-y += dump/
 obj-y += hw/
 obj-y += monitor/
 obj-y += qapi/
 obj-y += memory.o
 obj-y += memory_mapping.o
-obj-y += dump.o
-obj-$(TARGET_X86_64) += win_dump.o
 obj-y += migration/ram.o
 LIBS := $(libs_softmmu) $(LIBS)
 
dump/Makefile.objs new file +2 -0
new file mode 100644
index 0000000000..ea6b074967
@@ -0,0 +1,2 @@
+obj-y += dump.o
+obj-$(TARGET_X86_64) += win_dump.o
dump/dump.c renamed from dump.c +0 -0
similarity index 100%
rename from dump.c
rename to dump/dump.c
dump/win_dump.c renamed from win_dump.c +0 -0
similarity index 100%
rename from win_dump.c
rename to dump/win_dump.c
dump/win_dump.h renamed from win_dump.h +0 -0
similarity index 100%
rename from win_dump.h
rename to dump/win_dump.h
Signature · 1 line
2.21.0
Reviewed-by on v1 15/17
#46 lore raw

Re: [Qemu-devel] [PATCH 15/17] dump: Move the code to dump/

Quoted 3 lines · Markus Armbruster
Cc Marc-André Lureau <[email protected]>
Quoted 68 lines
---
 MAINTAINERS                   | 2 +-
 Makefile.target               | 3 +--
 dump/Makefile.objs            | 2 ++
 dump.c => dump/dump.c         | 0
 win_dump.c => dump/win_dump.c | 0
 win_dump.h => dump/win_dump.h | 0
 6 files changed, 4 insertions(+), 3 deletions(-)
 create mode 100644 dump/Makefile.objs
 rename dump.c => dump/dump.c (100%)
 rename win_dump.c => dump/win_dump.c (100%)
 rename win_dump.h => dump/win_dump.h (100%)
MAINTAINERS +1 -1
index ea110e99ca..a3fdda015f 100644
@@ -1850,7 +1850,7 @@ F: include/sysemu/device_tree.h
 Dump
 S: Supported
 M: Marc-André Lureau <[email protected]>
-F: dump.c
+F: dump/dump.c
 F: hw/misc/vmcoreinfo.c
 F: include/hw/misc/vmcoreinfo.h
 F: include/sysemu/dump-arch.h
Makefile.target +1 -2
index 167ae2174e..a6919e0caf 100644
@@ -150,13 +150,12 @@ endif #CONFIG_BSD_USER
 ifdef CONFIG_SOFTMMU
 obj-y += arch_init.o cpus.o gdbstub.o balloon.o ioport.o
 obj-y += qtest.o
+obj-y += dump/
 obj-y += hw/
 obj-y += monitor/
 obj-y += qapi/
 obj-y += memory.o
 obj-y += memory_mapping.o
-obj-y += dump.o
-obj-$(TARGET_X86_64) += win_dump.o
 obj-y += migration/ram.o
 LIBS := $(libs_softmmu) $(LIBS)
 
dump/Makefile.objs new file +2 -0
new file mode 100644
index 0000000000..ea6b074967
@@ -0,0 +1,2 @@
+obj-y += dump.o
+obj-$(TARGET_X86_64) += win_dump.o
dump/dump.c renamed from dump.c +0 -0
similarity index 100%
rename from dump.c
rename to dump/dump.c
dump/win_dump.c renamed from win_dump.c +0 -0
similarity index 100%
rename from win_dump.c
rename to dump/win_dump.c
dump/win_dump.h renamed from win_dump.h +0 -1
similarity index 100%
rename from win_dump.h
rename to dump/win_dump.h
--

2.21.0

Reviewed-by on v1 15/17
#47 lore raw

Re: [Qemu-devel] [PATCH 15/17] dump: Move the code to dump/

In reply to Markus Armbruster
Quoted 14 lines · Markus Armbruster
Cc Marc-André Lureau <[email protected]>
---
 MAINTAINERS                   | 2 +-
 Makefile.target               | 3 +--
 dump/Makefile.objs            | 2 ++
 dump.c => dump/dump.c         | 0
 win_dump.c => dump/win_dump.c | 0
 win_dump.h => dump/win_dump.h | 0
 6 files changed, 4 insertions(+), 3 deletions(-)
 create mode 100644 dump/Makefile.objs
 rename dump.c => dump/dump.c (100%)
 rename win_dump.c => dump/win_dump.c (100%)
 rename win_dump.h => dump/win_dump.h (100%)

Regards,
Daniel

Signature · 3 lines
|: https://berrange.com      -o-    https://www.flickr.com/photos/dberrange :|
|: https://libvirt.org         -o-            https://fstop138.berrange.com :|
|: https://entangle-photo.org    -o-    https://www.instagram.com/dberrange :|
#48 lore raw

PATCH 16/17 MAINTAINERS: Add Windows dump to section "Dump"

In reply to Markus Armbruster

Commit 2da91b54fe9 "dump: add Windows dump format to dump-guest-memory" neglected to update MAINTAINERS. Do it now.

Cc Marc-André Lureau <[email protected]>
---
 MAINTAINERS | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)
MAINTAINERS +2 -1
index a3fdda015f..327ad80ae4 100644
@@ -1850,9 +1850,10 @@ F: include/sysemu/device_tree.h
 Dump
 S: Supported
 M: Marc-André Lureau <[email protected]>
-F: dump/dump.c
+F: dump/
 F: hw/misc/vmcoreinfo.c
 F: include/hw/misc/vmcoreinfo.h
+F: include/qemu/win_dump_defs
 F: include/sysemu/dump-arch.h
 F: include/sysemu/dump.h
 F: qapi/dump.json
Signature · 1 line
2.21.0
Reviewed-by on v1 16/17
#49 lore raw

Re: [Qemu-devel] [PATCH 16/17] MAINTAINERS: Add Windows dump to section "Dump"

Quoted 6 lines · Markus Armbruster

Commit 2da91b54fe9 "dump: add Windows dump format to dump-guest-memory" neglected to update MAINTAINERS. Do it now.

Cc Marc-André Lureau <[email protected]>

argh, I guess I will CC relevant people ;)

Quoted 23 lines
---
 MAINTAINERS | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)
MAINTAINERS +2 -2
index a3fdda015f..327ad80ae4 100644
@@ -1850,9 +1850,10 @@ F: include/sysemu/device_tree.h
 Dump
 S: Supported
 M: Marc-André Lureau <[email protected]>
-F: dump/dump.c
+F: dump/
 F: hw/misc/vmcoreinfo.c
 F: include/hw/misc/vmcoreinfo.h
+F: include/qemu/win_dump_defs
 F: include/sysemu/dump-arch.h
 F: include/sysemu/dump.h
 F: qapi/dump.json
--

2.21.0

Reviewed-by on v1 16/17
#50 lore raw

Re: [Qemu-devel] [PATCH 16/17] MAINTAINERS: Add Windows dump to section "Dump"

In reply to Markus Armbruster
Quoted 14 lines · Markus Armbruster

Commit 2da91b54fe9 "dump: add Windows dump format to dump-guest-memory" neglected to update MAINTAINERS. Do it now.

Cc Marc-André Lureau <[email protected]>
---
 MAINTAINERS | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)
MAINTAINERS +0 -0
index a3fdda015f..327ad80ae4 100644

MAINTAINERS F: include/sysemu/device_tree.h · line 1853

Quoted 5 lines
MAINTAINERS +1 -1
@@ -1850,9 +1850,10 @@ F: include/sysemu/device_tree.h
 Dump
 S: Supported
 M: Marc-André Lureau <[email protected]>
-F: dump/dump.c
+F: dump/

Isn't this better squashed in the previous patch in fact.

MAINTAINERS F: include/sysemu/device_tree.h · line 1859

Quoted 6 lines
MAINTAINERS +1 -0
 F: hw/misc/vmcoreinfo.c
 F: include/hw/misc/vmcoreinfo.h
+F: include/qemu/win_dump_defs
 F: include/sysemu/dump-arch.h
 F: include/sysemu/dump.h
 F: qapi/dump.json

Either way, the result is good so

Regards,
Daniel

Signature · 3 lines
|: https://berrange.com      -o-    https://www.flickr.com/photos/dberrange :|
|: https://libvirt.org         -o-            https://fstop138.berrange.com :|
|: https://entangle-photo.org    -o-    https://www.instagram.com/dberrange :|
#51 lore raw

Re: [Qemu-devel] [PATCH 16/17] MAINTAINERS: Add Windows dump to section "Dump"

Quoted 10 lines · Daniel P. Berrangé
Quoted 9 lines · Markus Armbruster

Commit 2da91b54fe9 "dump: add Windows dump format to dump-guest-memory" neglected to update MAINTAINERS. Do it now.

Cc Marc-André Lureau <[email protected]>
---
 MAINTAINERS | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)
Quoted 12 lines

MAINTAINERS F: include/sysemu/device_tree.h · line 1853

Quoted 10 lines
MAINTAINERS +1 -1
index a3fdda015f..327ad80ae4 100644
@@ -1850,9 +1850,10 @@ F: include/sysemu/device_tree.h
 Dump
 S: Supported
 M: Marc-André Lureau <[email protected]>
-F: dump/dump.c
+F: dump/

Isn't this better squashed in the previous patch in fact.

If I do that, the commit does two things: move code and improve MAINTAINERS coverage. Okay in this case. We can just as well finish the improvement job then, i.e. squash the entire commit into the previous one.

Quoted 10 lines

MAINTAINERS F: include/sysemu/device_tree.h · line 1859

Quoted 6 lines
MAINTAINERS +1 -0
 F: hw/misc/vmcoreinfo.c
 F: include/hw/misc/vmcoreinfo.h
+F: include/qemu/win_dump_defs
 F: include/sysemu/dump-arch.h
 F: include/sysemu/dump.h
 F: qapi/dump.json

Either way, the result is good so

Thanks!

#52 lore raw

PATCH 17/17 dump: Move HMP command handlers to dump/

In reply to Markus Armbruster

Move the HMP handlers related to qapi/dump.json to dimp/dump-hmp-cmds.c, where they are covered by MAINTAINERS section "Dump", just like qapi/dump.json.

Cc Marc-André Lureau <[email protected]>
Cc "Dr. David Alan Gilbert" <[email protected]>
---
 Makefile.objs        |  1 +
 dump/Makefile.objs   |  1 +
 dump/dump-hmp-cmds.c | 88 ++++++++++++++++++++++++++++++++++++++++++++
 monitor/hmp-cmds.c   | 76 --------------------------------------
 4 files changed, 90 insertions(+), 76 deletions(-)
 create mode 100644 dump/dump-hmp-cmds.c
Makefile.objs +1 -0
index 7494d6143b..c93d731047 100644
@@ -45,6 +45,7 @@ io-obj-y = io/
 ifeq ($(CONFIG_SOFTMMU),y)
 common-obj-y = blockdev.o blockdev-nbd.o block/
 common-obj-y += bootdevice.o iothread.o
+common-obj-y += dump/
 common-obj-y += job-qmp.o
 common-obj-y += monitor/
 common-obj-y += net/
dump/Makefile.objs +1 -0
index ea6b074967..d2a5db3b81 100644
@@ -1,2 +1,3 @@
 obj-y += dump.o
+common-obj-y += dump-hmp-cmds.o
 obj-$(TARGET_X86_64) += win_dump.o
dump/dump-hmp-cmds.c new file +88 -0

88 lines not on this page · raw message

monitor/hmp-cmds.c +0 -76

94 lines not on this page · raw message

Signature · 1 line
2.21.0
#53 lore raw

Re: [Qemu-devel] [PATCH 17/17] dump: Move HMP command handlers to dump/

Quoted 2 lines · Markus Armbruster

Move the HMP handlers related to qapi/dump.json to dimp/dump-hmp-cmds.c, where they are covered by MAINTAINERS section

s/dimp/dump/

Quoted 6 lines

"Dump", just like qapi/dump.json.

Cc Marc-André Lureau <[email protected]>
Cc "Dr. David Alan Gilbert" <[email protected]>

---

Signature · 3 lines
Eric Blake, Principal Software Engineer
Red Hat, Inc.           +1-919-301-3226
Virtualization:  qemu.org | libvirt.org
#54 lore raw

Re: [Qemu-devel] [PATCH 17/17] dump: Move HMP command handlers to dump/

Quoted 5 lines · Eric Blake
Quoted 2 lines · Markus Armbruster

Move the HMP handlers related to qapi/dump.json to dimp/dump-hmp-cmds.c, where they are covered by MAINTAINERS section

s/dimp/dump/

Will fix. Thanks!

Quoted 6 lines
Quoted 6 lines

"Dump", just like qapi/dump.json.

Cc Marc-André Lureau <[email protected]>
Cc "Dr. David Alan Gilbert" <[email protected]>

---

Reviewed-by on v1 17/17
#55 lore raw

Re: [Qemu-devel] [PATCH 17/17] dump: Move HMP command handlers to dump/

In reply to Markus Armbruster
Quoted 7 lines · Markus Armbruster

Move the HMP handlers related to qapi/dump.json to dimp/dump-hmp-cmds.c, where they are covered by MAINTAINERS section "Dump", just like qapi/dump.json.

Cc Marc-André Lureau <[email protected]>
Cc "Dr. David Alan Gilbert" <[email protected]>
Quoted 7 lines
---
 Makefile.objs        |  1 +
 dump/Makefile.objs   |  1 +
 dump/dump-hmp-cmds.c | 88 ++++++++++++++++++++++++++++++++++++++++++++
 monitor/hmp-cmds.c   | 76 --------------------------------------
 4 files changed, 90 insertions(+), 76 deletions(-)
 create mode 100644 dump/dump-hmp-cmds.c

Regards,
Daniel

Signature · 3 lines
|: https://berrange.com      -o-    https://www.flickr.com/photos/dberrange :|
|: https://libvirt.org         -o-            https://fstop138.berrange.com :|
|: https://entangle-photo.org    -o-    https://www.instagram.com/dberrange :|
Reviewed-by on v1 17/17
#56 lore raw

Re: [Qemu-devel] [PATCH 17/17] dump: Move HMP command handlers to dump/

In reply to Markus Armbruster
Quoted 7 lines · * Markus Armbruster ([email protected]) wrote:

Move the HMP handlers related to qapi/dump.json to dimp/dump-hmp-cmds.c, where they are covered by MAINTAINERS section "Dump", just like qapi/dump.json.

Cc Marc-André Lureau <[email protected]>
Cc "Dr. David Alan Gilbert" <[email protected]>
Quoted 226 lines
---
 Makefile.objs        |  1 +
 dump/Makefile.objs   |  1 +
 dump/dump-hmp-cmds.c | 88 ++++++++++++++++++++++++++++++++++++++++++++
 monitor/hmp-cmds.c   | 76 --------------------------------------
 4 files changed, 90 insertions(+), 76 deletions(-)
 create mode 100644 dump/dump-hmp-cmds.c
Makefile.objs +1 -0
index 7494d6143b..c93d731047 100644
@@ -45,6 +45,7 @@ io-obj-y = io/
 ifeq ($(CONFIG_SOFTMMU),y)
 common-obj-y = blockdev.o blockdev-nbd.o block/
 common-obj-y += bootdevice.o iothread.o
+common-obj-y += dump/
 common-obj-y += job-qmp.o
 common-obj-y += monitor/
 common-obj-y += net/
dump/Makefile.objs +1 -0
index ea6b074967..d2a5db3b81 100644
@@ -1,2 +1,3 @@
 obj-y += dump.o
+common-obj-y += dump-hmp-cmds.o
 obj-$(TARGET_X86_64) += win_dump.o
dump/dump-hmp-cmds.c new file +88 -0
new file mode 100644
index 0000000000..3dbf44372c
@@ -0,0 +1,88 @@
+/*
+ * Human Monitor Interface commands
+ *
+ * This work is licensed under the terms of the GNU GPL, version 2 or later.
+ * See the COPYING file in the top-level directory.
+ */
+
+#include "qemu/osdep.h"
+#include "monitor/hmp.h"
+#include "monitor/monitor.h"
+#include "qapi/error.h"
+#include "qapi/qapi-commands-dump.h"
+#include "qapi/qmp/qdict.h"
+
+void hmp_dump_guest_memory(Monitor *mon, const QDict *qdict)
+{
+    Error *err = NULL;
+    bool win_dmp = qdict_get_try_bool(qdict, "windmp", false);
+    bool paging = qdict_get_try_bool(qdict, "paging", false);
+    bool zlib = qdict_get_try_bool(qdict, "zlib", false);
+    bool lzo = qdict_get_try_bool(qdict, "lzo", false);
+    bool snappy = qdict_get_try_bool(qdict, "snappy", false);
+    const char *file = qdict_get_str(qdict, "filename");
+    bool has_begin = qdict_haskey(qdict, "begin");
+    bool has_length = qdict_haskey(qdict, "length");
+    bool has_detach = qdict_haskey(qdict, "detach");
+    int64_t begin = 0;
+    int64_t length = 0;
+    bool detach = false;
+    enum DumpGuestMemoryFormat dump_format = DUMP_GUEST_MEMORY_FORMAT_ELF;
+    char *prot;
+
+    if (zlib + lzo + snappy + win_dmp > 1) {
+        error_setg(&err, "only one of '-z|-l|-s|-w' can be set");
+        hmp_handle_error(mon, &err);
+        return;
+    }
+
+    if (win_dmp) {
+        dump_format = DUMP_GUEST_MEMORY_FORMAT_WIN_DMP;
+    }
+
+    if (zlib) {
+        dump_format = DUMP_GUEST_MEMORY_FORMAT_KDUMP_ZLIB;
+    }
+
+    if (lzo) {
+        dump_format = DUMP_GUEST_MEMORY_FORMAT_KDUMP_LZO;
+    }
+
+    if (snappy) {
+        dump_format = DUMP_GUEST_MEMORY_FORMAT_KDUMP_SNAPPY;
+    }
+
+    if (has_begin) {
+        begin = qdict_get_int(qdict, "begin");
+    }
+    if (has_length) {
+        length = qdict_get_int(qdict, "length");
+    }
+    if (has_detach) {
+        detach = qdict_get_bool(qdict, "detach");
+    }
+
+    prot = g_strconcat("file:", file, NULL);
+
+    qmp_dump_guest_memory(paging, prot, true, detach, has_begin, begin,
+                          has_length, length, true, dump_format, &err);
+    hmp_handle_error(mon, &err);
+    g_free(prot);
+}
+
+void hmp_info_dump(Monitor *mon, const QDict *qdict)
+{
+    DumpQueryResult *result = qmp_query_dump(NULL);
+
+    assert(result && result->status < DUMP_STATUS__MAX);
+    monitor_printf(mon, "Status: %s\n", DumpStatus_str(result->status));
+
+    if (result->status == DUMP_STATUS_ACTIVE) {
+        float percent = 0;
+        assert(result->total != 0);
+        percent = 100.0 * result->completed / result->total;
+        monitor_printf(mon, "Finished: %.2f %%\n", percent);
+    }
+
+    qapi_free_DumpQueryResult(result);
+}
monitor/hmp-cmds.c +0 -76
index 18ffeb7017..dc12ae6129 100644
@@ -31,7 +31,6 @@
 #include "qapi/qapi-builtin-visit.h"
 #include "qapi/qapi-commands-block.h"
 #include "qapi/qapi-commands-char.h"
-#include "qapi/qapi-commands-dump.h"
 #include "qapi/qapi-commands-migration.h"
 #include "qapi/qapi-commands-misc.h"
 #include "qapi/qapi-commands-net.h"
@@ -2160,64 +2159,6 @@ void hmp_device_del(Monitor *mon, const QDict *qdict)
     hmp_handle_error(mon, &err);
 }
 
-void hmp_dump_guest_memory(Monitor *mon, const QDict *qdict)
-{
-    Error *err = NULL;
-    bool win_dmp = qdict_get_try_bool(qdict, "windmp", false);
-    bool paging = qdict_get_try_bool(qdict, "paging", false);
-    bool zlib = qdict_get_try_bool(qdict, "zlib", false);
-    bool lzo = qdict_get_try_bool(qdict, "lzo", false);
-    bool snappy = qdict_get_try_bool(qdict, "snappy", false);
-    const char *file = qdict_get_str(qdict, "filename");
-    bool has_begin = qdict_haskey(qdict, "begin");
-    bool has_length = qdict_haskey(qdict, "length");
-    bool has_detach = qdict_haskey(qdict, "detach");
-    int64_t begin = 0;
-    int64_t length = 0;
-    bool detach = false;
-    enum DumpGuestMemoryFormat dump_format = DUMP_GUEST_MEMORY_FORMAT_ELF;
-    char *prot;
-
-    if (zlib + lzo + snappy + win_dmp > 1) {
-        error_setg(&err, "only one of '-z|-l|-s|-w' can be set");
-        hmp_handle_error(mon, &err);
-        return;
-    }
-
-    if (win_dmp) {
-        dump_format = DUMP_GUEST_MEMORY_FORMAT_WIN_DMP;
-    }
-
-    if (zlib) {
-        dump_format = DUMP_GUEST_MEMORY_FORMAT_KDUMP_ZLIB;
-    }
-
-    if (lzo) {
-        dump_format = DUMP_GUEST_MEMORY_FORMAT_KDUMP_LZO;
-    }
-
-    if (snappy) {
-        dump_format = DUMP_GUEST_MEMORY_FORMAT_KDUMP_SNAPPY;
-    }
-
-    if (has_begin) {
-        begin = qdict_get_int(qdict, "begin");
-    }
-    if (has_length) {
-        length = qdict_get_int(qdict, "length");
-    }
-    if (has_detach) {
-        detach = qdict_get_bool(qdict, "detach");
-    }
-
-    prot = g_strconcat("file:", file, NULL);
-
-    qmp_dump_guest_memory(paging, prot, true, detach, has_begin, begin,
-                          has_length, length, true, dump_format, &err);
-    hmp_handle_error(mon, &err);
-    g_free(prot);
-}
-
 void hmp_netdev_add(Monitor *mon, const QDict *qdict)
 {
     Error *err = NULL;
@@ -2949,23 +2890,6 @@ void hmp_rocker_of_dpa_groups(Monitor *mon, const QDict *qdict)
     qapi_free_RockerOfDpaGroupList(list);
 }
 
-void hmp_info_dump(Monitor *mon, const QDict *qdict)
-{
-    DumpQueryResult *result = qmp_query_dump(NULL);
-
-    assert(result && result->status < DUMP_STATUS__MAX);
-    monitor_printf(mon, "Status: %s\n", DumpStatus_str(result->status));
-
-    if (result->status == DUMP_STATUS_ACTIVE) {
-        float percent = 0;
-        assert(result->total != 0);
-        percent = 100.0 * result->completed / result->total;
-        monitor_printf(mon, "Finished: %.2f %%\n", percent);
-    }
-
-    qapi_free_DumpQueryResult(result);
-}
-
 void hmp_info_ramblock(Monitor *mon, const QDict *qdict)
 {
     ram_block_dump(mon);
Signature · 1 line
2.21.0

--
Dr. David Alan Gilbert / [email protected] / Manchester, UK