From c556600598afc6e90ae52a2e9ce910b8842244c5 Mon Sep 17 00:00:00 2001 From: Michal Privoznik Date: Tue, 26 May 2020 10:25:35 +0200 Subject: qmp: Expose MachineClass::default_ram_id If a management application (like Libvirt) want's to preserve migration ability and switch to '-machine memory-backend' it needs to set exactly the same RAM id as QEMU would. Since the id is machine type dependant, expose it under 'query-machines' result. Some machine types don't have the attribute set (riscv family for example), therefore the QMP attribute must be optional. Signed-off-by: Michal Privoznik Message-Id: <9384422f63fe594a54d801f9cb4539b1d2ce9b67.1590481402.git.mprivozn@redhat.com> Reviewed-by: Igor Mammedov [ehabkost: updated doc to "since 5.2"] Signed-off-by: Eduardo Habkost --- hw/core/machine-qmp-cmds.c | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'hw/core') diff --git a/hw/core/machine-qmp-cmds.c b/hw/core/machine-qmp-cmds.c index 963088b..2155122 100644 --- a/hw/core/machine-qmp-cmds.c +++ b/hw/core/machine-qmp-cmds.c @@ -238,6 +238,10 @@ MachineInfoList *qmp_query_machines(Error **errp) info->default_cpu_type = g_strdup(mc->default_cpu_type); info->has_default_cpu_type = true; } + if (mc->default_ram_id) { + info->default_ram_id = g_strdup(mc->default_ram_id); + info->has_default_ram_id = true; + } entry = g_malloc0(sizeof(*entry)); entry->value = info; -- cgit v1.1