Move QOM, qdev, machine core and dump code
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.cSignature · 1 line
2.21.0
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.
Message-Id: <[email protected]>
--- MAINTAINERS | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-)
MAINTAINERS +3 -2
@@ -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
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]>Suggested-by Markus Armbruster <[email protected]>Signed-off-by Paolo Bonzini <[email protected]>Message-Id: <[email protected]>
Signed-off-by Markus Armbruster <[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)
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]>Suggested-by Markus Armbruster <[email protected]>Signed-off-by Paolo Bonzini <[email protected]>Message-Id: <[email protected]>
Signed-off-by Markus Armbruster <[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
Re: [Qemu-devel] [PATCH 01/17] MAINTAINERS: new maintainers for QOM
In reply to Andreas FärberQuoted 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]>Suggested-by Markus Armbruster <[email protected]>Signed-off-by Paolo Bonzini <[email protected]>Message-Id: <[email protected]>
Signed-off-by Markus Armbruster <[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.
Re: [Qemu-devel] [PATCH 01/17] MAINTAINERS: new maintainers for QOM
In reply to Markus ArmbrusterQuoted 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]>Suggested-by Markus Armbruster <[email protected]>Signed-off-by Paolo Bonzini <[email protected]>
Quoted 5 lines
Message-Id: <[email protected]>
Signed-off-by Markus Armbruster <[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 :|
PATCH 2/17 Makefile: Don't add monitor/ twice to common-obj-y
In reply to Markus ArmbrusterBoth 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
@@ -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
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 commit7e3c0deab1b"monitor: Split outmonitor/qmp.c" added monitor/ to common-obj-y ifeq ($(CONFIG_SOFTMMU),y). Revert the second addition.Signed-off-by Markus Armbruster <[email protected]>--- 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 :|
PATCH 3/17 hmp: Move hmp.h to include/monitor/
In reply to Markus Armbruster--- 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
monitor/hmp-cmds.c +1 -1
@@ -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
@@ -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
@@ -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
@@ -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
@@ -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
@@ -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
@@ -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
@@ -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
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]>Signed-off-by Markus Armbruster <[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 :|
Re: [Qemu-devel] [PATCH 03/17] hmp: Move hmp.h to include/monitor/
In reply to Markus ArmbrusterQuoted 2 lines · * Markus Armbruster ([email protected]) wrote:
Cc "Dr. David Alan Gilbert" <[email protected]>Signed-off-by Markus Armbruster <[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
-0monitor/hmp-cmds.c +1
-1@@ -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@@ -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@@ -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@@ -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@@ -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@@ -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@@ -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@@ -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
PATCH 4/17 qapi: Split qom.json and qdev.json off misc.json
In reply to Markus ArmbrusterMove 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.
--- 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
@@ -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
@@ -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
@@ -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
@@ -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
@@ -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
@@ -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
@@ -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
@@ -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
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 eventDEVICE_DELETEDfrom misc.json to new qdev.json. qdev.json remains uncovered byMAINTAINERS, 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
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 eventDEVICE_DELETEDfrom misc.json to new qdev.json. qdev.json remains uncovered byMAINTAINERS, 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
@@ -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]>
Daniel P. Berrangé
Reviewed-byRe: [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 eventDEVICE_DELETEDfrom misc.json to new qdev.json. qdev.json remains uncovered byMAINTAINERS, 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@@ -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
-0X: 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 :|
Re: [Qemu-devel] [PATCH 04/17] qapi: Split qom.json and qdev.json off misc.json
In reply to Markus ArmbrusterQuoted 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
MAINTAINERSsection QOM.Move commands device-list-properties,
device_add, device-del, and eventDEVICE_DELETEDfrom misc.json to new qdev.json. qdev.json remains uncovered byMAINTAINERS, like the rest of qdev.Cc Paolo Bonzini <[email protected]>Cc "Daniel P. Berrange" <[email protected]>Cc Eduardo Habkost <[email protected]>Signed-off-by Markus Armbruster <[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@@ -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 :|
PATCH 5/17 qom: Move QMP command handlers to qom/
In reply to Markus ArmbrusterThe 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().
--- 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
@@ -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
@@ -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
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 newqom/qom-qmp-cmds.c, where they are covered byMAINTAINERSsection QOM, just likeqapi/qom.json.Move along
qmp_device_list_properties()even though it's specified inqapi/qdev.json, because it's so similar toqmp_qom_list_properties().Cc Paolo Bonzini <[email protected]>Cc "Daniel P. Berrange" <[email protected]>Cc Eduardo Habkost <[email protected]>Signed-off-by Markus Armbruster <[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 :|
PATCH 6/17 qom: Move HMP command handlers to qom/
In reply to Markus ArmbrusterThere 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.
--- 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
@@ -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
@@ -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
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.cto newqom/qom-hmp-cmds.c, where they are covered byMAINTAINERSsection QOM.Cc Paolo Bonzini <[email protected]>Cc "Daniel P. Berrange" <[email protected]>Cc Eduardo Habkost <[email protected]>Cc "Dr. David Alan Gilbert" <[email protected]>Signed-off-by Markus Armbruster <[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 :|
Re: [Qemu-devel] [PATCH 06/17] qom: Move HMP command handlers to qom/
In reply to Markus ArmbrusterQuoted 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.cto newqom/qom-hmp-cmds.c, where they are covered byMAINTAINERSsection QOM.Cc Paolo Bonzini <[email protected]>Cc "Daniel P. Berrange" <[email protected]>Cc Eduardo Habkost <[email protected]>Cc "Dr. David Alan Gilbert" <[email protected]>Signed-off-by Markus Armbruster <[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.cinclude/monitor/hmp.h +2
-0@@ -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@@ -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@@ -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.oqom/qom-hmp-cmds.c new file +62
-0@@ -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
Re: [Qemu-devel] [PATCH 06/17] qom: Move HMP command handlers to qom/
In reply to Markus ArmbrusterQuoted 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.cto newqom/qom-hmp-cmds.c, where they are covered byMAINTAINERSsection 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]>Signed-off-by Markus Armbruster <[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.cinclude/monitor/hmp.h +2
-0@@ -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@@ -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@@ -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.oqom/qom-hmp-cmds.c new file +52
-0@@ -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
@@ -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
@@ -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
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
@@ -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
Re: [Qemu-devel] [PATCH 07/17] MAINTAINERS: Merge sections CPU, NUMA into Machine core
Quoted 7 lines · Markus Armbruster
Suggested-by Paolo Bonzini <[email protected]>Cc Eduardo Habkost <[email protected]>Cc Marcel Apfelbaum <[email protected]>Signed-off-by Markus Armbruster <[email protected]>--- MAINTAINERS | 16 ++++------------ 1 file changed, 4 insertions(+), 12 deletions(-)
MAINTAINERS S: Supported · line 1272
Quoted 11 lines
MAINTAINERS +2
-0@@ -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
-0F: 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 :|
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
Suggested-by Paolo Bonzini <[email protected]>Cc Eduardo Habkost <[email protected]>Cc Marcel Apfelbaum <[email protected]>Signed-off-by Markus Armbruster <[email protected]>--- MAINTAINERS | 16 ++++------------ 1 file changed, 4 insertions(+), 12 deletions(-)Reviewed-by Daniel P. Berrangé <[email protected]>Quoted 1 line
Quoted 14 lines
MAINTAINERS S: Supported · line 1272
Quoted 10 lines
MAINTAINERS +2
-0@@ -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.cNot a blocker for this patch, but as a later patch, I'd encourage you to move
qom/cpu.csomewhere 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
-0F: include/hw/boards.h F: include/hw/cpu/cluster.h +F: include/qom/cpu.hLikewise
Quoted 4 lines
MAINTAINERS +1
-0+F: include/sysemu/numa.h T: git https://github.com/ehabkost/qemu.git machine-next Xtensa Machines
[...]
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
Suggested-by Paolo Bonzini <[email protected]>Cc Eduardo Habkost <[email protected]>Cc Marcel Apfelbaum <[email protected]>Signed-off-by Markus Armbruster <[email protected]>--- MAINTAINERS | 16 ++++------------ 1 file changed, 4 insertions(+), 12 deletions(-)Reviewed-by Daniel P. Berrangé <[email protected]>Quoted 1 line
Quoted 14 lines
MAINTAINERS S: Supported · line 1272
Quoted 10 lines
MAINTAINERS +2
-0@@ -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.cNot a blocker for this patch, but as a later patch, I'd encourage you to move
qom/cpu.csomewhere 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
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
Suggested-by Paolo Bonzini <[email protected]>Cc Eduardo Habkost <[email protected]>Cc Marcel Apfelbaum <[email protected]>Signed-off-by Markus Armbruster <[email protected]>--- MAINTAINERS | 16 ++++------------ 1 file changed, 4 insertions(+), 12 deletions(-)Reviewed-by Daniel P. Berrangé <[email protected]>MAINTAINERS S: Supported · line 1272
Quoted 11 lines
MAINTAINERS +2
-0@@ -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.cNot a blocker for this patch, but as a later patch, I'd encourage you to move
qom/cpu.csomewhere 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/.
PATCH 8/17 qapi: Split machine.json off misc.json
In reply to Markus ArmbrusterMove 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".
--- 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
@@ -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
@@ -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
@@ -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
@@ -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
@@ -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
@@ -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
@@ -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
@@ -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
@@ -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
@@ -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
@@ -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
@@ -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
@@ -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
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
MAINTAINERSsection "Machine core".Cc Eduardo Habkost <[email protected]>Cc Marcel Apfelbaum <[email protected]>Signed-off-by Markus Armbruster <[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 :|
PATCH 9/17 hw/core: Move numa.c to hw/core/
In reply to Markus Armbruster--- 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
@@ -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
@@ -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
@@ -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
Signature · 1 line
2.21.0
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]>Signed-off-by Markus Armbruster <[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 :|
PATCH 10/17 hw/core: Collect QMP command handlers in hw/core/
In reply to Markus ArmbrusterThe 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.
--- 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
@@ -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
@@ -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
@@ -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
@@ -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
@@ -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
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, andvl.c. Move them all to newhw/core/machine-qmp-cmds.c, where they are covered byMAINTAINERSsection "Machine core", just likeqapi/machine.json.Cc Eduardo Habkost <[email protected]>Cc Marcel Apfelbaum <[email protected]>Signed-off-by Markus Armbruster <[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 :|
PATCH 11/17 hw/core: Collect HMP command handlers in hw/core/
In reply to Markus ArmbrusterMove 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.
--- 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
@@ -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
@@ -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
@@ -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
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.jsontohw/core/machine-hmp-cmds.c, where they are covered byMAINTAINERSsection "Machine core", just likeqapi/machine.json.Cc Eduardo Habkost <[email protected]>Cc Marcel Apfelbaum <[email protected]>Cc "Dr. David Alan Gilbert" <[email protected]>Signed-off-by Markus Armbruster <[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 :|
Re: [Qemu-devel] [PATCH 11/17] hw/core: Collect HMP command handlers in hw/core/
In reply to Markus ArmbrusterQuoted 8 lines · * Markus Armbruster ([email protected]) wrote:
Move the HMP handlers related to
qapi/machine.jsontohw/core/machine-hmp-cmds.c, where they are covered byMAINTAINERSsection "Machine core", just likeqapi/machine.json.Cc Eduardo Habkost <[email protected]>Cc Marcel Apfelbaum <[email protected]>Cc "Dr. David Alan Gilbert" <[email protected]>Signed-off-by Markus Armbruster <[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.chw/core/Makefile.objs +1
-0@@ -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.ohw/core/machine-hmp-cmds.c new file +164
-0@@ -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@@ -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@@ -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@@ -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
PATCH 12/17 qapi: Split machine-target.json off target.json and misc.json
In reply to Markus ArmbrusterMove 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".
--- 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
@@ -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
@@ -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
@@ -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
@@ -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
@@ -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
@@ -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
@@ -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
@@ -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
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
MAINTAINERSsection "Machine core".Cc Eduardo Habkost <[email protected]>Cc Marcel Apfelbaum <[email protected]>Signed-off-by Markus Armbruster <[email protected]>---
Signature · 3 lines
Eric Blake, Principal Software Engineer Red Hat, Inc. +1-919-301-3226 Virtualization: qemu.org | libvirt.org
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
MAINTAINERSsection "Machine core".Cc Eduardo Habkost <[email protected]>Cc Marcel Apfelbaum <[email protected]>Signed-off-by Markus Armbruster <[email protected]>---
Re: [Qemu-devel] [PATCH 12/17] qapi: Split machine-target.json off target.json and misc.json
In reply to Markus ArmbrusterQuoted 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
MAINTAINERSsection "Machine core".Cc Eduardo Habkost <[email protected]>Cc Marcel Apfelbaum <[email protected]>Signed-off-by Markus Armbruster <[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 :|
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
@@ -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
@@ -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
@@ -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
@@ -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
@@ -1,10 +1,6 @@ # -*- Mode: Python -*- # -## -# = Target-specific commands & events -## - ## # @RTC_CHANGE: #
qapi/qapi-schema.json +1 -1
@@ -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
@@ -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
@@ -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
Re: [Qemu-devel] [PATCH 13/17] qapi: Rename target.json to misc-target.json
Quoted 12 lines · Markus Armbruster
Signed-off-by Markus Armbruster <[email protected]>--- 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 :|
PATCH 14/17 qapi: Split dump.json off misc.json
In reply to Markus ArmbrusterMove 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".
--- 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
@@ -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
@@ -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
@@ -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
@@ -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
@@ -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
@@ -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
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
MAINTAINERSsection "Dump".Cc Marc-André Lureau <[email protected]>Signed-off-by Markus Armbruster <[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.jsonMAINTAINERS +1
-0@@ -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.cdump.c +2
-2@@ -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@@ -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@@ -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@@ -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-targetqapi/dump.json new file +200
-0@@ -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@@ -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@@ -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
Re: [Qemu-devel] [PATCH 14/17] qapi: Split dump.json off misc.json
In reply to Markus ArmbrusterQuoted 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
MAINTAINERSsection "Dump".Cc Marc-André Lureau <[email protected]>Signed-off-by Markus Armbruster <[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 :|
PATCH 15/17 dump: Move the code to dump/
In reply to Markus Armbruster--- 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
@@ -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
@@ -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
@@ -0,0 +1,2 @@ +obj-y += dump.o +obj-$(TARGET_X86_64) += win_dump.o
dump/dump.c renamed from dump.c +0 -0
dump/win_dump.c renamed from win_dump.c +0 -0
dump/win_dump.h renamed from win_dump.h +0 -0
Signature · 1 line
2.21.0
Re: [Qemu-devel] [PATCH 15/17] dump: Move the code to dump/
Quoted 3 lines · Markus Armbruster
Cc Marc-André Lureau <[email protected]>Signed-off-by Markus Armbruster <[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@@ -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.hMakefile.target +1
-2@@ -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@@ -0,0 +1,2 @@ +obj-y += dump.o +obj-$(TARGET_X86_64) += win_dump.odump/dump.c renamed from dump.c +0
-0dump/win_dump.c renamed from win_dump.c +0
-0dump/win_dump.h renamed from win_dump.h +0
-1--2.21.0
Re: [Qemu-devel] [PATCH 15/17] dump: Move the code to dump/
In reply to Markus ArmbrusterQuoted 14 lines · Markus Armbruster
Cc Marc-André Lureau <[email protected]>Signed-off-by Markus Armbruster <[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 :|
PATCH 16/17 MAINTAINERS: Add Windows dump to section "Dump"
In reply to Markus ArmbrusterCommit 2da91b54fe9 "dump: add Windows dump format to dump-guest-memory" neglected to update MAINTAINERS. Do it now.
--- MAINTAINERS | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-)
MAINTAINERS +2 -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/ 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
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 updateMAINTAINERS. Do it now.Cc Marc-André Lureau <[email protected]>Signed-off-by Markus Armbruster <[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@@ -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
Re: [Qemu-devel] [PATCH 16/17] MAINTAINERS: Add Windows dump to section "Dump"
In reply to Markus ArmbrusterQuoted 14 lines · Markus Armbruster
Commit
2da91b54fe9"dump: add Windows dump format to dump-guest-memory" neglected to updateMAINTAINERS. Do it now.Cc Marc-André Lureau <[email protected]>Signed-off-by Markus Armbruster <[email protected]>--- MAINTAINERS | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-)MAINTAINERS +0
-0
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
-0F: 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 :|
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 updateMAINTAINERS. Do it now.Cc Marc-André Lureau <[email protected]>Signed-off-by Markus Armbruster <[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@@ -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
-0F: 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.jsonEither way, the result is good so
Reviewed-by Daniel P. Berrangé <[email protected]>
Thanks!
PATCH 17/17 dump: Move HMP command handlers to dump/
In reply to Markus ArmbrusterMove 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.
--- 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
@@ -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
@@ -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
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.jsontodimp/dump-hmp-cmds.c, where they are covered byMAINTAINERSsection
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]>Signed-off-by Markus Armbruster <[email protected]>---
Signature · 3 lines
Eric Blake, Principal Software Engineer Red Hat, Inc. +1-919-301-3226 Virtualization: qemu.org | libvirt.org
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.jsontodimp/dump-hmp-cmds.c, where they are covered byMAINTAINERSsections/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]>Signed-off-by Markus Armbruster <[email protected]>---
Re: [Qemu-devel] [PATCH 17/17] dump: Move HMP command handlers to dump/
In reply to Markus ArmbrusterQuoted 7 lines · Markus Armbruster
Move the HMP handlers related to
qapi/dump.jsontodimp/dump-hmp-cmds.c, where they are covered byMAINTAINERSsection "Dump", just likeqapi/dump.json.Cc Marc-André Lureau <[email protected]>Cc "Dr. David Alan Gilbert" <[email protected]>Signed-off-by Markus Armbruster <[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 :|
Re: [Qemu-devel] [PATCH 17/17] dump: Move HMP command handlers to dump/
In reply to Markus ArmbrusterQuoted 7 lines · * Markus Armbruster ([email protected]) wrote:
Move the HMP handlers related to
qapi/dump.jsontodimp/dump-hmp-cmds.c, where they are covered byMAINTAINERSsection "Dump", just likeqapi/dump.json.Cc Marc-André Lureau <[email protected]>Cc "Dr. David Alan Gilbert" <[email protected]>Signed-off-by Markus Armbruster <[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.cMakefile.objs +1
-0@@ -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@@ -1,2 +1,3 @@ obj-y += dump.o +common-obj-y += dump-hmp-cmds.o obj-$(TARGET_X86_64) += win_dump.odump/dump-hmp-cmds.c new file +88
-0@@ -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@@ -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