diff options
author | Peter Maydell <peter.maydell@linaro.org> | 2019-07-03 00:16:43 +0100 |
---|---|---|
committer | Peter Maydell <peter.maydell@linaro.org> | 2019-07-03 00:16:43 +0100 |
commit | 374f63f6810a2f99254cdf32af67035d951301c8 (patch) | |
tree | 80a4e3af467182a9002ff01eda12a733af1850d1 /qdev-monitor.c | |
parent | 506179e42112be77bfd071f050b15762d3b2cd43 (diff) | |
parent | 2608b3df8f9cd91baee9d04e246a0255dbb612db (diff) |
Merge remote-tracking branch 'remotes/armbru/tags/pull-monitor-2019-07-02-v2' into staging
Monitor patches for 2019-07-02
# gpg: Signature made Tue 02 Jul 2019 12:37:57 BST
# gpg: using RSA key 354BC8B3D7EB2A6B68674E5F3870B400EB918653
# gpg: issuer "armbru@redhat.com"
# gpg: Good signature from "Markus Armbruster <armbru@redhat.com>" [full]
# gpg: aka "Markus Armbruster <armbru@pond.sub.org>" [full]
# Primary key fingerprint: 354B C8B3 D7EB 2A6B 6867 4E5F 3870 B400 EB91 8653
* remotes/armbru/tags/pull-monitor-2019-07-02-v2:
dump: Move HMP command handlers to dump/
MAINTAINERS: Add Windows dump to section "Dump"
dump: Move the code to dump/
qapi: Split dump.json off misc.json
qapi: Rename target.json to misc-target.json
qapi: Split machine-target.json off target.json and misc.json
hw/core: Collect HMP command handlers in hw/core/
hw/core: Collect QMP command handlers in hw/core/
hw/core: Move numa.c to hw/core/
qapi: Split machine.json off misc.json
MAINTAINERS: Merge sections CPU, NUMA into Machine core
qom: Move HMP command handlers to qom/
qom: Move QMP command handlers to qom/
qapi: Split qom.json and qdev.json off misc.json
hmp: Move hmp.h to include/monitor/
Makefile: Don't add monitor/ twice to common-obj-y
MAINTAINERS: Make section "QOM" cover qdev as well
MAINTAINERS: new maintainers for QOM
Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
Diffstat (limited to 'qdev-monitor.c')
-rw-r--r-- | qdev-monitor.c | 59 |
1 files changed, 1 insertions, 58 deletions
diff --git a/qdev-monitor.c b/qdev-monitor.c index 373b9ad445..58222c2211 100644 --- a/qdev-monitor.c +++ b/qdev-monitor.c @@ -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" @@ -739,63 +739,6 @@ void hmp_info_qdm(Monitor *mon, const QDict *qdict) qdev_print_devinfos(true); } -typedef struct QOMCompositionState { - Monitor *mon; - int indent; -} QOMCompositionState; - -static void print_qom_composition(Monitor *mon, Object *obj, int indent); - -static int print_qom_composition_child(Object *obj, void *opaque) -{ - QOMCompositionState *s = opaque; - - print_qom_composition(s->mon, obj, s->indent); - - return 0; -} - -static void print_qom_composition(Monitor *mon, Object *obj, int indent) -{ - QOMCompositionState s = { - .mon = mon, - .indent = indent + 2, - }; - char *name; - - if (obj == object_get_root()) { - name = g_strdup(""); - } else { - name = object_get_canonical_path_component(obj); - } - monitor_printf(mon, "%*s/%s (%s)\n", indent, "", name, - object_get_typename(obj)); - g_free(name); - object_child_foreach(obj, print_qom_composition_child, &s); -} - -void hmp_info_qom_tree(Monitor *mon, const QDict *dict) -{ - const char *path = qdict_get_try_str(dict, "path"); - Object *obj; - bool ambiguous = false; - - if (path) { - obj = object_resolve_path(path, &ambiguous); - if (!obj) { - monitor_printf(mon, "Path '%s' could not be resolved.\n", path); - return; - } - if (ambiguous) { - monitor_printf(mon, "Warning: Path '%s' is ambiguous.\n", path); - return; - } - } else { - obj = qdev_get_machine(); - } - print_qom_composition(mon, obj, 0); -} - void qmp_device_add(QDict *qdict, QObject **ret_data, Error **errp) { Error *local_err = NULL; |