From 275307aaab86a57ec1ce9c9eb066dd48e7ab0971 Mon Sep 17 00:00:00 2001 From: Markus Armbruster Date: Wed, 19 Jun 2019 22:10:36 +0200 Subject: hmp: Move hmp.h to include/monitor/ MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: "Dr. David Alan Gilbert" Signed-off-by: Markus Armbruster Message-Id: <20190619201050.19040-4-armbru@redhat.com> Reviewed-by: Daniel P. Berrangé Reviewed-by: Dr. David Alan Gilbert --- monitor/misc.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'monitor/misc.c') diff --git a/monitor/misc.c b/monitor/misc.c index bf9faceb86..2fb6896e84 100644 --- a/monitor/misc.c +++ b/monitor/misc.c @@ -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" -- cgit v1.2.3 From 52924dea1761e329fb3a14a50f98a1cd161d68d5 Mon Sep 17 00:00:00 2001 From: Markus Armbruster Date: Wed, 19 Jun 2019 22:10:43 +0200 Subject: hw/core: Collect QMP command handlers in hw/core/ MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The handlers for qapi/machine.json's QMP commands are spread over cpus.c, hw/core/numa.c, monitor/misc.c, monitor/qmp-cmds.c, and vl.c. Move them all to new hw/core/machine-qmp-cmds.c, where they are covered by MAINTAINERS section "Machine core", just like qapi/machine.json. Cc: Eduardo Habkost Cc: Marcel Apfelbaum Signed-off-by: Markus Armbruster Message-Id: <20190619201050.19040-11-armbru@redhat.com> Reviewed-by: Daniel P. Berrangé --- monitor/misc.c | 13 ------------- 1 file changed, 13 deletions(-) (limited to 'monitor/misc.c') diff --git a/monitor/misc.c b/monitor/misc.c index 2fb6896e84..45f3f55a4d 100644 --- a/monitor/misc.c +++ b/monitor/misc.c @@ -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); -} -- cgit v1.2.3 From 55225c853ab8ba948ef70634cee6fbca0d8c67dc Mon Sep 17 00:00:00 2001 From: Markus Armbruster Date: Wed, 19 Jun 2019 22:10:44 +0200 Subject: hw/core: Collect HMP command handlers in hw/core/ MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Move the HMP handlers related to qapi/machine.json to hw/core/machine-hmp-cmds.c, where they are covered by MAINTAINERS section "Machine core", just like qapi/machine.json. Cc: Eduardo Habkost Cc: Marcel Apfelbaum Cc: "Dr. David Alan Gilbert" Signed-off-by: Markus Armbruster Message-Id: <20190619201050.19040-12-armbru@redhat.com> Reviewed-by: Daniel P. Berrangé Reviewed-by: Dr. David Alan Gilbert --- monitor/misc.c | 32 ++------------------------------ 1 file changed, 2 insertions(+), 30 deletions(-) (limited to 'monitor/misc.c') diff --git a/monitor/misc.c b/monitor/misc.c index 45f3f55a4d..00338c002a 100644 --- a/monitor/misc.c +++ b/monitor/misc.c @@ -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; -- cgit v1.2.3