mirror of
https://github.com/izzy2lost/xemu.git
synced 2026-07-06 00:20:22 -07:00
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>
This commit is contained in:
+21
-15
@@ -1274,11 +1274,18 @@ Machine core
|
||||
M: Eduardo Habkost <ehabkost@redhat.com>
|
||||
M: Marcel Apfelbaum <marcel.apfelbaum@gmail.com>
|
||||
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
|
||||
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
|
||||
F: include/qom/cpu.h
|
||||
F: include/sysemu/numa.h
|
||||
T: git https://github.com/ehabkost/qemu.git machine-next
|
||||
|
||||
Xtensa Machines
|
||||
@@ -1843,11 +1850,6 @@ M: Markus Armbruster <armbru@redhat.com>
|
||||
S: Supported
|
||||
F: scripts/coverity-model.c
|
||||
|
||||
CPU
|
||||
S: Supported
|
||||
F: qom/cpu.c
|
||||
F: include/qom/cpu.h
|
||||
|
||||
Device Tree
|
||||
M: Alistair Francis <alistair.francis@wdc.com>
|
||||
R: David Gibson <david@gibson.dropbear.id.au>
|
||||
@@ -1858,11 +1860,13 @@ F: include/sysemu/device_tree.h
|
||||
Dump
|
||||
S: Supported
|
||||
M: Marc-André Lureau <marcandre.lureau@redhat.com>
|
||||
F: 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
|
||||
F: scripts/dump-guest-memory.py
|
||||
F: stubs/dump.c
|
||||
|
||||
@@ -1956,13 +1960,6 @@ W: http://info.iet.unipi.it/~luigi/netmap/
|
||||
S: Maintained
|
||||
F: net/netmap.c
|
||||
|
||||
NUMA
|
||||
M: Eduardo Habkost <ehabkost@redhat.com>
|
||||
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 <ehabkost@redhat.com>
|
||||
M: Igor Mammedov <imammedo@redhat.com>
|
||||
@@ -2040,15 +2037,24 @@ F: docs/interop/qemu-ga-ref.texi
|
||||
T: git https://github.com/mdroth/qemu.git qga
|
||||
|
||||
QOM
|
||||
M: Andreas Färber <afaerber@suse.de>
|
||||
M: Paolo Bonzini <pbonzini@redhat.com>
|
||||
R: Daniel P. Berrange <berrange@redhat.com>
|
||||
R: Eduardo Habkost <ehabkost@redhat.com>
|
||||
S: Supported
|
||||
T: git https://github.com/afaerber/qemu-cpu.git qom-next
|
||||
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: qapi/qom.json
|
||||
F: qapi/qdev.json
|
||||
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 <armbru@redhat.com>
|
||||
|
||||
+1
-1
@@ -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/
|
||||
@@ -85,7 +86,6 @@ common-obj-$(CONFIG_FDT) += device_tree.o
|
||||
# qapi
|
||||
|
||||
common-obj-y += qapi/
|
||||
common-obj-y += monitor/
|
||||
endif
|
||||
|
||||
#######################################################################
|
||||
|
||||
+2
-3
@@ -148,15 +148,14 @@ 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 += 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)
|
||||
|
||||
|
||||
@@ -25,7 +25,6 @@
|
||||
#include "qemu/osdep.h"
|
||||
#include "qemu-common.h"
|
||||
#include "qemu/config-file.h"
|
||||
#include "cpu.h"
|
||||
#include "monitor/monitor.h"
|
||||
#include "qapi/error.h"
|
||||
#include "qapi/qapi-commands-misc.h"
|
||||
@@ -33,7 +32,6 @@
|
||||
#include "qapi/qmp/qerror.h"
|
||||
#include "qemu/error-report.h"
|
||||
#include "qemu/qemu-print.h"
|
||||
#include "sysemu/sysemu.h"
|
||||
#include "sysemu/tcg.h"
|
||||
#include "sysemu/block-backend.h"
|
||||
#include "exec/gdbstub.h"
|
||||
@@ -56,7 +54,6 @@
|
||||
#include "tcg.h"
|
||||
#include "hw/nmi.h"
|
||||
#include "sysemu/replay.h"
|
||||
#include "hw/boards.h"
|
||||
|
||||
#ifdef CONFIG_LINUX
|
||||
|
||||
@@ -2200,190 +2197,6 @@ void list_cpus(const char *optarg)
|
||||
#endif
|
||||
}
|
||||
|
||||
CpuInfoList *qmp_query_cpus(Error **errp)
|
||||
{
|
||||
MachineState *ms = MACHINE(qdev_get_machine());
|
||||
MachineClass *mc = MACHINE_GET_CLASS(ms);
|
||||
CpuInfoList *head = NULL, *cur_item = NULL;
|
||||
CPUState *cpu;
|
||||
|
||||
CPU_FOREACH(cpu) {
|
||||
CpuInfoList *info;
|
||||
#if defined(TARGET_I386)
|
||||
X86CPU *x86_cpu = X86_CPU(cpu);
|
||||
CPUX86State *env = &x86_cpu->env;
|
||||
#elif defined(TARGET_PPC)
|
||||
PowerPCCPU *ppc_cpu = POWERPC_CPU(cpu);
|
||||
CPUPPCState *env = &ppc_cpu->env;
|
||||
#elif defined(TARGET_SPARC)
|
||||
SPARCCPU *sparc_cpu = SPARC_CPU(cpu);
|
||||
CPUSPARCState *env = &sparc_cpu->env;
|
||||
#elif defined(TARGET_RISCV)
|
||||
RISCVCPU *riscv_cpu = RISCV_CPU(cpu);
|
||||
CPURISCVState *env = &riscv_cpu->env;
|
||||
#elif defined(TARGET_MIPS)
|
||||
MIPSCPU *mips_cpu = MIPS_CPU(cpu);
|
||||
CPUMIPSState *env = &mips_cpu->env;
|
||||
#elif defined(TARGET_TRICORE)
|
||||
TriCoreCPU *tricore_cpu = TRICORE_CPU(cpu);
|
||||
CPUTriCoreState *env = &tricore_cpu->env;
|
||||
#elif defined(TARGET_S390X)
|
||||
S390CPU *s390_cpu = S390_CPU(cpu);
|
||||
CPUS390XState *env = &s390_cpu->env;
|
||||
#endif
|
||||
|
||||
cpu_synchronize_state(cpu);
|
||||
|
||||
info = g_malloc0(sizeof(*info));
|
||||
info->value = g_malloc0(sizeof(*info->value));
|
||||
info->value->CPU = cpu->cpu_index;
|
||||
info->value->current = (cpu == first_cpu);
|
||||
info->value->halted = cpu->halted;
|
||||
info->value->qom_path = object_get_canonical_path(OBJECT(cpu));
|
||||
info->value->thread_id = cpu->thread_id;
|
||||
#if defined(TARGET_I386)
|
||||
info->value->arch = CPU_INFO_ARCH_X86;
|
||||
info->value->u.x86.pc = env->eip + env->segs[R_CS].base;
|
||||
#elif defined(TARGET_PPC)
|
||||
info->value->arch = CPU_INFO_ARCH_PPC;
|
||||
info->value->u.ppc.nip = env->nip;
|
||||
#elif defined(TARGET_SPARC)
|
||||
info->value->arch = CPU_INFO_ARCH_SPARC;
|
||||
info->value->u.q_sparc.pc = env->pc;
|
||||
info->value->u.q_sparc.npc = env->npc;
|
||||
#elif defined(TARGET_MIPS)
|
||||
info->value->arch = CPU_INFO_ARCH_MIPS;
|
||||
info->value->u.q_mips.PC = env->active_tc.PC;
|
||||
#elif defined(TARGET_TRICORE)
|
||||
info->value->arch = CPU_INFO_ARCH_TRICORE;
|
||||
info->value->u.tricore.PC = env->PC;
|
||||
#elif defined(TARGET_S390X)
|
||||
info->value->arch = CPU_INFO_ARCH_S390;
|
||||
info->value->u.s390.cpu_state = env->cpu_state;
|
||||
#elif defined(TARGET_RISCV)
|
||||
info->value->arch = CPU_INFO_ARCH_RISCV;
|
||||
info->value->u.riscv.pc = env->pc;
|
||||
#else
|
||||
info->value->arch = CPU_INFO_ARCH_OTHER;
|
||||
#endif
|
||||
info->value->has_props = !!mc->cpu_index_to_instance_props;
|
||||
if (info->value->has_props) {
|
||||
CpuInstanceProperties *props;
|
||||
props = g_malloc0(sizeof(*props));
|
||||
*props = mc->cpu_index_to_instance_props(ms, cpu->cpu_index);
|
||||
info->value->props = props;
|
||||
}
|
||||
|
||||
/* XXX: waiting for the qapi to support GSList */
|
||||
if (!cur_item) {
|
||||
head = cur_item = info;
|
||||
} else {
|
||||
cur_item->next = info;
|
||||
cur_item = info;
|
||||
}
|
||||
}
|
||||
|
||||
return head;
|
||||
}
|
||||
|
||||
static CpuInfoArch sysemu_target_to_cpuinfo_arch(SysEmuTarget target)
|
||||
{
|
||||
/*
|
||||
* The @SysEmuTarget -> @CpuInfoArch mapping below is based on the
|
||||
* TARGET_ARCH -> TARGET_BASE_ARCH mapping in the "configure" script.
|
||||
*/
|
||||
switch (target) {
|
||||
case SYS_EMU_TARGET_I386:
|
||||
case SYS_EMU_TARGET_X86_64:
|
||||
return CPU_INFO_ARCH_X86;
|
||||
|
||||
case SYS_EMU_TARGET_PPC:
|
||||
case SYS_EMU_TARGET_PPC64:
|
||||
return CPU_INFO_ARCH_PPC;
|
||||
|
||||
case SYS_EMU_TARGET_SPARC:
|
||||
case SYS_EMU_TARGET_SPARC64:
|
||||
return CPU_INFO_ARCH_SPARC;
|
||||
|
||||
case SYS_EMU_TARGET_MIPS:
|
||||
case SYS_EMU_TARGET_MIPSEL:
|
||||
case SYS_EMU_TARGET_MIPS64:
|
||||
case SYS_EMU_TARGET_MIPS64EL:
|
||||
return CPU_INFO_ARCH_MIPS;
|
||||
|
||||
case SYS_EMU_TARGET_TRICORE:
|
||||
return CPU_INFO_ARCH_TRICORE;
|
||||
|
||||
case SYS_EMU_TARGET_S390X:
|
||||
return CPU_INFO_ARCH_S390;
|
||||
|
||||
case SYS_EMU_TARGET_RISCV32:
|
||||
case SYS_EMU_TARGET_RISCV64:
|
||||
return CPU_INFO_ARCH_RISCV;
|
||||
|
||||
default:
|
||||
return CPU_INFO_ARCH_OTHER;
|
||||
}
|
||||
}
|
||||
|
||||
static void cpustate_to_cpuinfo_s390(CpuInfoS390 *info, const CPUState *cpu)
|
||||
{
|
||||
#ifdef TARGET_S390X
|
||||
S390CPU *s390_cpu = S390_CPU(cpu);
|
||||
CPUS390XState *env = &s390_cpu->env;
|
||||
|
||||
info->cpu_state = env->cpu_state;
|
||||
#else
|
||||
abort();
|
||||
#endif
|
||||
}
|
||||
|
||||
/*
|
||||
* fast means: we NEVER interrupt vCPU threads to retrieve
|
||||
* information from KVM.
|
||||
*/
|
||||
CpuInfoFastList *qmp_query_cpus_fast(Error **errp)
|
||||
{
|
||||
MachineState *ms = MACHINE(qdev_get_machine());
|
||||
MachineClass *mc = MACHINE_GET_CLASS(ms);
|
||||
CpuInfoFastList *head = NULL, *cur_item = NULL;
|
||||
SysEmuTarget target = qapi_enum_parse(&SysEmuTarget_lookup, TARGET_NAME,
|
||||
-1, &error_abort);
|
||||
CPUState *cpu;
|
||||
|
||||
CPU_FOREACH(cpu) {
|
||||
CpuInfoFastList *info = g_malloc0(sizeof(*info));
|
||||
info->value = g_malloc0(sizeof(*info->value));
|
||||
|
||||
info->value->cpu_index = cpu->cpu_index;
|
||||
info->value->qom_path = object_get_canonical_path(OBJECT(cpu));
|
||||
info->value->thread_id = cpu->thread_id;
|
||||
|
||||
info->value->has_props = !!mc->cpu_index_to_instance_props;
|
||||
if (info->value->has_props) {
|
||||
CpuInstanceProperties *props;
|
||||
props = g_malloc0(sizeof(*props));
|
||||
*props = mc->cpu_index_to_instance_props(ms, cpu->cpu_index);
|
||||
info->value->props = props;
|
||||
}
|
||||
|
||||
info->value->arch = sysemu_target_to_cpuinfo_arch(target);
|
||||
info->value->target = target;
|
||||
if (target == SYS_EMU_TARGET_S390X) {
|
||||
cpustate_to_cpuinfo_s390(&info->value->u.s390x, cpu);
|
||||
}
|
||||
|
||||
if (!cur_item) {
|
||||
head = cur_item = info;
|
||||
} else {
|
||||
cur_item->next = info;
|
||||
cur_item = info;
|
||||
}
|
||||
}
|
||||
|
||||
return head;
|
||||
}
|
||||
|
||||
void qmp_memsave(int64_t addr, int64_t size, const char *filename,
|
||||
bool has_cpu, int64_t cpu_index, Error **errp)
|
||||
{
|
||||
|
||||
@@ -0,0 +1,3 @@
|
||||
obj-y += dump.o
|
||||
common-obj-y += dump-hmp-cmds.o
|
||||
obj-$(TARGET_X86_64) += win_dump.o
|
||||
@@ -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);
|
||||
}
|
||||
@@ -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"
|
||||
@@ -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"
|
||||
|
||||
@@ -22,3 +22,7 @@ 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) += machine-qmp-cmds.o
|
||||
obj-$(CONFIG_SOFTMMU) += numa.o
|
||||
common-obj-$(CONFIG_SOFTMMU) += machine-hmp-cmds.o
|
||||
|
||||
@@ -0,0 +1,164 @@
|
||||
/*
|
||||
* HMP commands related to machines and CPUs
|
||||
*
|
||||
* Copyright IBM, Corp. 2011
|
||||
*
|
||||
* Authors:
|
||||
* Anthony Liguori <aliguori@us.ibm.com>
|
||||
*
|
||||
* 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);
|
||||
}
|
||||
@@ -0,0 +1,328 @@
|
||||
/*
|
||||
* QMP commands related to machines and CPUs
|
||||
*
|
||||
* Copyright (C) 2014 Red Hat Inc
|
||||
*
|
||||
* 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 "cpu.h"
|
||||
#include "hw/boards.h"
|
||||
#include "qapi/error.h"
|
||||
#include "qapi/qapi-commands-machine.h"
|
||||
#include "qapi/qmp/qerror.h"
|
||||
#include "sysemu/hostmem.h"
|
||||
#include "sysemu/hw_accel.h"
|
||||
#include "sysemu/numa.h"
|
||||
#include "sysemu/sysemu.h"
|
||||
|
||||
CpuInfoList *qmp_query_cpus(Error **errp)
|
||||
{
|
||||
MachineState *ms = MACHINE(qdev_get_machine());
|
||||
MachineClass *mc = MACHINE_GET_CLASS(ms);
|
||||
CpuInfoList *head = NULL, *cur_item = NULL;
|
||||
CPUState *cpu;
|
||||
|
||||
CPU_FOREACH(cpu) {
|
||||
CpuInfoList *info;
|
||||
#if defined(TARGET_I386)
|
||||
X86CPU *x86_cpu = X86_CPU(cpu);
|
||||
CPUX86State *env = &x86_cpu->env;
|
||||
#elif defined(TARGET_PPC)
|
||||
PowerPCCPU *ppc_cpu = POWERPC_CPU(cpu);
|
||||
CPUPPCState *env = &ppc_cpu->env;
|
||||
#elif defined(TARGET_SPARC)
|
||||
SPARCCPU *sparc_cpu = SPARC_CPU(cpu);
|
||||
CPUSPARCState *env = &sparc_cpu->env;
|
||||
#elif defined(TARGET_RISCV)
|
||||
RISCVCPU *riscv_cpu = RISCV_CPU(cpu);
|
||||
CPURISCVState *env = &riscv_cpu->env;
|
||||
#elif defined(TARGET_MIPS)
|
||||
MIPSCPU *mips_cpu = MIPS_CPU(cpu);
|
||||
CPUMIPSState *env = &mips_cpu->env;
|
||||
#elif defined(TARGET_TRICORE)
|
||||
TriCoreCPU *tricore_cpu = TRICORE_CPU(cpu);
|
||||
CPUTriCoreState *env = &tricore_cpu->env;
|
||||
#elif defined(TARGET_S390X)
|
||||
S390CPU *s390_cpu = S390_CPU(cpu);
|
||||
CPUS390XState *env = &s390_cpu->env;
|
||||
#endif
|
||||
|
||||
cpu_synchronize_state(cpu);
|
||||
|
||||
info = g_malloc0(sizeof(*info));
|
||||
info->value = g_malloc0(sizeof(*info->value));
|
||||
info->value->CPU = cpu->cpu_index;
|
||||
info->value->current = (cpu == first_cpu);
|
||||
info->value->halted = cpu->halted;
|
||||
info->value->qom_path = object_get_canonical_path(OBJECT(cpu));
|
||||
info->value->thread_id = cpu->thread_id;
|
||||
#if defined(TARGET_I386)
|
||||
info->value->arch = CPU_INFO_ARCH_X86;
|
||||
info->value->u.x86.pc = env->eip + env->segs[R_CS].base;
|
||||
#elif defined(TARGET_PPC)
|
||||
info->value->arch = CPU_INFO_ARCH_PPC;
|
||||
info->value->u.ppc.nip = env->nip;
|
||||
#elif defined(TARGET_SPARC)
|
||||
info->value->arch = CPU_INFO_ARCH_SPARC;
|
||||
info->value->u.q_sparc.pc = env->pc;
|
||||
info->value->u.q_sparc.npc = env->npc;
|
||||
#elif defined(TARGET_MIPS)
|
||||
info->value->arch = CPU_INFO_ARCH_MIPS;
|
||||
info->value->u.q_mips.PC = env->active_tc.PC;
|
||||
#elif defined(TARGET_TRICORE)
|
||||
info->value->arch = CPU_INFO_ARCH_TRICORE;
|
||||
info->value->u.tricore.PC = env->PC;
|
||||
#elif defined(TARGET_S390X)
|
||||
info->value->arch = CPU_INFO_ARCH_S390;
|
||||
info->value->u.s390.cpu_state = env->cpu_state;
|
||||
#elif defined(TARGET_RISCV)
|
||||
info->value->arch = CPU_INFO_ARCH_RISCV;
|
||||
info->value->u.riscv.pc = env->pc;
|
||||
#else
|
||||
info->value->arch = CPU_INFO_ARCH_OTHER;
|
||||
#endif
|
||||
info->value->has_props = !!mc->cpu_index_to_instance_props;
|
||||
if (info->value->has_props) {
|
||||
CpuInstanceProperties *props;
|
||||
props = g_malloc0(sizeof(*props));
|
||||
*props = mc->cpu_index_to_instance_props(ms, cpu->cpu_index);
|
||||
info->value->props = props;
|
||||
}
|
||||
|
||||
/* XXX: waiting for the qapi to support GSList */
|
||||
if (!cur_item) {
|
||||
head = cur_item = info;
|
||||
} else {
|
||||
cur_item->next = info;
|
||||
cur_item = info;
|
||||
}
|
||||
}
|
||||
|
||||
return head;
|
||||
}
|
||||
|
||||
static CpuInfoArch sysemu_target_to_cpuinfo_arch(SysEmuTarget target)
|
||||
{
|
||||
/*
|
||||
* The @SysEmuTarget -> @CpuInfoArch mapping below is based on the
|
||||
* TARGET_ARCH -> TARGET_BASE_ARCH mapping in the "configure" script.
|
||||
*/
|
||||
switch (target) {
|
||||
case SYS_EMU_TARGET_I386:
|
||||
case SYS_EMU_TARGET_X86_64:
|
||||
return CPU_INFO_ARCH_X86;
|
||||
|
||||
case SYS_EMU_TARGET_PPC:
|
||||
case SYS_EMU_TARGET_PPC64:
|
||||
return CPU_INFO_ARCH_PPC;
|
||||
|
||||
case SYS_EMU_TARGET_SPARC:
|
||||
case SYS_EMU_TARGET_SPARC64:
|
||||
return CPU_INFO_ARCH_SPARC;
|
||||
|
||||
case SYS_EMU_TARGET_MIPS:
|
||||
case SYS_EMU_TARGET_MIPSEL:
|
||||
case SYS_EMU_TARGET_MIPS64:
|
||||
case SYS_EMU_TARGET_MIPS64EL:
|
||||
return CPU_INFO_ARCH_MIPS;
|
||||
|
||||
case SYS_EMU_TARGET_TRICORE:
|
||||
return CPU_INFO_ARCH_TRICORE;
|
||||
|
||||
case SYS_EMU_TARGET_S390X:
|
||||
return CPU_INFO_ARCH_S390;
|
||||
|
||||
case SYS_EMU_TARGET_RISCV32:
|
||||
case SYS_EMU_TARGET_RISCV64:
|
||||
return CPU_INFO_ARCH_RISCV;
|
||||
|
||||
default:
|
||||
return CPU_INFO_ARCH_OTHER;
|
||||
}
|
||||
}
|
||||
|
||||
static void cpustate_to_cpuinfo_s390(CpuInfoS390 *info, const CPUState *cpu)
|
||||
{
|
||||
#ifdef TARGET_S390X
|
||||
S390CPU *s390_cpu = S390_CPU(cpu);
|
||||
CPUS390XState *env = &s390_cpu->env;
|
||||
|
||||
info->cpu_state = env->cpu_state;
|
||||
#else
|
||||
abort();
|
||||
#endif
|
||||
}
|
||||
|
||||
/*
|
||||
* fast means: we NEVER interrupt vCPU threads to retrieve
|
||||
* information from KVM.
|
||||
*/
|
||||
CpuInfoFastList *qmp_query_cpus_fast(Error **errp)
|
||||
{
|
||||
MachineState *ms = MACHINE(qdev_get_machine());
|
||||
MachineClass *mc = MACHINE_GET_CLASS(ms);
|
||||
CpuInfoFastList *head = NULL, *cur_item = NULL;
|
||||
SysEmuTarget target = qapi_enum_parse(&SysEmuTarget_lookup, TARGET_NAME,
|
||||
-1, &error_abort);
|
||||
CPUState *cpu;
|
||||
|
||||
CPU_FOREACH(cpu) {
|
||||
CpuInfoFastList *info = g_malloc0(sizeof(*info));
|
||||
info->value = g_malloc0(sizeof(*info->value));
|
||||
|
||||
info->value->cpu_index = cpu->cpu_index;
|
||||
info->value->qom_path = object_get_canonical_path(OBJECT(cpu));
|
||||
info->value->thread_id = cpu->thread_id;
|
||||
|
||||
info->value->has_props = !!mc->cpu_index_to_instance_props;
|
||||
if (info->value->has_props) {
|
||||
CpuInstanceProperties *props;
|
||||
props = g_malloc0(sizeof(*props));
|
||||
*props = mc->cpu_index_to_instance_props(ms, cpu->cpu_index);
|
||||
info->value->props = props;
|
||||
}
|
||||
|
||||
info->value->arch = sysemu_target_to_cpuinfo_arch(target);
|
||||
info->value->target = target;
|
||||
if (target == SYS_EMU_TARGET_S390X) {
|
||||
cpustate_to_cpuinfo_s390(&info->value->u.s390x, cpu);
|
||||
}
|
||||
|
||||
if (!cur_item) {
|
||||
head = cur_item = info;
|
||||
} else {
|
||||
cur_item->next = info;
|
||||
cur_item = info;
|
||||
}
|
||||
}
|
||||
|
||||
return head;
|
||||
}
|
||||
|
||||
MachineInfoList *qmp_query_machines(Error **errp)
|
||||
{
|
||||
GSList *el, *machines = object_class_get_list(TYPE_MACHINE, false);
|
||||
MachineInfoList *mach_list = NULL;
|
||||
|
||||
for (el = machines; el; el = el->next) {
|
||||
MachineClass *mc = el->data;
|
||||
MachineInfoList *entry;
|
||||
MachineInfo *info;
|
||||
|
||||
info = g_malloc0(sizeof(*info));
|
||||
if (mc->is_default) {
|
||||
info->has_is_default = true;
|
||||
info->is_default = true;
|
||||
}
|
||||
|
||||
if (mc->alias) {
|
||||
info->has_alias = true;
|
||||
info->alias = g_strdup(mc->alias);
|
||||
}
|
||||
|
||||
info->name = g_strdup(mc->name);
|
||||
info->cpu_max = !mc->max_cpus ? 1 : mc->max_cpus;
|
||||
info->hotpluggable_cpus = mc->has_hotpluggable_cpus;
|
||||
|
||||
entry = g_malloc0(sizeof(*entry));
|
||||
entry->value = info;
|
||||
entry->next = mach_list;
|
||||
mach_list = entry;
|
||||
}
|
||||
|
||||
g_slist_free(machines);
|
||||
return mach_list;
|
||||
}
|
||||
|
||||
CurrentMachineParams *qmp_query_current_machine(Error **errp)
|
||||
{
|
||||
CurrentMachineParams *params = g_malloc0(sizeof(*params));
|
||||
params->wakeup_suspend_support = qemu_wakeup_suspend_enabled();
|
||||
|
||||
return params;
|
||||
}
|
||||
|
||||
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);
|
||||
}
|
||||
|
||||
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_set_numa_node(NumaOptions *cmd, Error **errp)
|
||||
{
|
||||
if (!runstate_check(RUN_STATE_PRECONFIG)) {
|
||||
error_setg(errp, "The command is permitted only in '%s' state",
|
||||
RunState_str(RUN_STATE_PRECONFIG));
|
||||
return;
|
||||
}
|
||||
|
||||
set_numa_options(MACHINE(qdev_get_machine()), cmd, errp);
|
||||
}
|
||||
|
||||
static int query_memdev(Object *obj, void *opaque)
|
||||
{
|
||||
MemdevList **list = opaque;
|
||||
MemdevList *m = NULL;
|
||||
|
||||
if (object_dynamic_cast(obj, TYPE_MEMORY_BACKEND)) {
|
||||
m = g_malloc0(sizeof(*m));
|
||||
|
||||
m->value = g_malloc0(sizeof(*m->value));
|
||||
|
||||
m->value->id = object_get_canonical_path_component(obj);
|
||||
m->value->has_id = !!m->value->id;
|
||||
|
||||
m->value->size = object_property_get_uint(obj, "size",
|
||||
&error_abort);
|
||||
m->value->merge = object_property_get_bool(obj, "merge",
|
||||
&error_abort);
|
||||
m->value->dump = object_property_get_bool(obj, "dump",
|
||||
&error_abort);
|
||||
m->value->prealloc = object_property_get_bool(obj,
|
||||
"prealloc",
|
||||
&error_abort);
|
||||
m->value->policy = object_property_get_enum(obj,
|
||||
"policy",
|
||||
"HostMemPolicy",
|
||||
&error_abort);
|
||||
object_property_get_uint16List(obj, "host-nodes",
|
||||
&m->value->host_nodes,
|
||||
&error_abort);
|
||||
|
||||
m->next = *list;
|
||||
*list = m;
|
||||
}
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
MemdevList *qmp_query_memdev(Error **errp)
|
||||
{
|
||||
Object *obj = object_get_objects_root();
|
||||
MemdevList *list = NULL;
|
||||
|
||||
object_child_foreach(obj, query_memdev, &list);
|
||||
return list;
|
||||
}
|
||||
+1
-63
@@ -27,14 +27,10 @@
|
||||
#include "exec/cpu-common.h"
|
||||
#include "exec/ramlist.h"
|
||||
#include "qemu/bitmap.h"
|
||||
#include "qom/cpu.h"
|
||||
#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 "hw/boards.h"
|
||||
#include "sysemu/hostmem.h"
|
||||
#include "qapi/qapi-visit-machine.h"
|
||||
#include "hw/mem/pc-dimm.h"
|
||||
#include "hw/mem/memory-device.h"
|
||||
#include "qemu/option.h"
|
||||
@@ -174,7 +170,6 @@ static void parse_numa_distance(NumaDistOptions *dist, Error **errp)
|
||||
have_numa_distance = true;
|
||||
}
|
||||
|
||||
static
|
||||
void set_numa_options(MachineState *ms, NumaOptions *object, Error **errp)
|
||||
{
|
||||
Error *err = NULL;
|
||||
@@ -447,17 +442,6 @@ void parse_numa_opts(MachineState *ms)
|
||||
qemu_opts_foreach(qemu_find_opts("numa"), parse_numa, ms, &error_fatal);
|
||||
}
|
||||
|
||||
void qmp_set_numa_node(NumaOptions *cmd, Error **errp)
|
||||
{
|
||||
if (!runstate_check(RUN_STATE_PRECONFIG)) {
|
||||
error_setg(errp, "The command is permitted only in '%s' state",
|
||||
RunState_str(RUN_STATE_PRECONFIG));
|
||||
return;
|
||||
}
|
||||
|
||||
set_numa_options(MACHINE(qdev_get_machine()), cmd, errp);
|
||||
}
|
||||
|
||||
void numa_cpu_pre_plug(const CPUArchId *slot, DeviceState *dev, Error **errp)
|
||||
{
|
||||
int node_id = object_property_get_int(OBJECT(dev), "node-id", &error_abort);
|
||||
@@ -592,52 +576,6 @@ void query_numa_node_mem(NumaNodeMem node_mem[])
|
||||
}
|
||||
}
|
||||
|
||||
static int query_memdev(Object *obj, void *opaque)
|
||||
{
|
||||
MemdevList **list = opaque;
|
||||
MemdevList *m = NULL;
|
||||
|
||||
if (object_dynamic_cast(obj, TYPE_MEMORY_BACKEND)) {
|
||||
m = g_malloc0(sizeof(*m));
|
||||
|
||||
m->value = g_malloc0(sizeof(*m->value));
|
||||
|
||||
m->value->id = object_get_canonical_path_component(obj);
|
||||
m->value->has_id = !!m->value->id;
|
||||
|
||||
m->value->size = object_property_get_uint(obj, "size",
|
||||
&error_abort);
|
||||
m->value->merge = object_property_get_bool(obj, "merge",
|
||||
&error_abort);
|
||||
m->value->dump = object_property_get_bool(obj, "dump",
|
||||
&error_abort);
|
||||
m->value->prealloc = object_property_get_bool(obj,
|
||||
"prealloc",
|
||||
&error_abort);
|
||||
m->value->policy = object_property_get_enum(obj,
|
||||
"policy",
|
||||
"HostMemPolicy",
|
||||
&error_abort);
|
||||
object_property_get_uint16List(obj, "host-nodes",
|
||||
&m->value->host_nodes,
|
||||
&error_abort);
|
||||
|
||||
m->next = *list;
|
||||
*list = m;
|
||||
}
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
MemdevList *qmp_query_memdev(Error **errp)
|
||||
{
|
||||
Object *obj = object_get_objects_root();
|
||||
MemdevList *list = NULL;
|
||||
|
||||
object_child_foreach(obj, query_memdev, &list);
|
||||
return list;
|
||||
}
|
||||
|
||||
void ram_block_notifier_add(RAMBlockNotifier *n)
|
||||
{
|
||||
QLIST_INSERT_HEAD(&ram_list.ramblock_notifiers, n, next);
|
||||
+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"
|
||||
|
||||
+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"
|
||||
|
||||
|
||||
@@ -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"
|
||||
|
||||
@@ -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"
|
||||
|
||||
|
||||
@@ -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"
|
||||
|
||||
@@ -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);
|
||||
@@ -115,9 +117,11 @@ 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);
|
||||
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);
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user