qemu-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[PATCH 2/2] qmp: Expose MachineClass::default_ram_id


From: Michal Privoznik
Subject: [PATCH 2/2] qmp: Expose MachineClass::default_ram_id
Date: Mon, 25 May 2020 19:03:28 +0200

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.

Signed-off-by: Michal Privoznik <address@hidden>
---
 hw/core/machine-qmp-cmds.c | 1 +
 qapi/machine.json          | 5 ++++-
 2 files changed, 5 insertions(+), 1 deletion(-)

diff --git a/hw/core/machine-qmp-cmds.c b/hw/core/machine-qmp-cmds.c
index 2c5da8413d..8333e674ce 100644
--- a/hw/core/machine-qmp-cmds.c
+++ b/hw/core/machine-qmp-cmds.c
@@ -234,6 +234,7 @@ MachineInfoList *qmp_query_machines(Error **errp)
         info->hotpluggable_cpus = mc->has_hotpluggable_cpus;
         info->numa_mem_supported = mc->numa_mem_supported;
         info->deprecated = !!mc->deprecation_reason;
+        info->default_ram_id = g_strdup(mc->default_ram_id);
         if (mc->default_cpu_type) {
             info->default_cpu_type = g_strdup(mc->default_cpu_type);
             info->has_default_cpu_type = true;
diff --git a/qapi/machine.json b/qapi/machine.json
index 39caa1d914..e5647c4031 100644
--- a/qapi/machine.json
+++ b/qapi/machine.json
@@ -352,6 +352,8 @@
 #              in future versions of QEMU according to the QEMU deprecation
 #              policy (since 4.1.0)
 #
+# @default-ram-id: the default name of initial RAM memory region (since 5.1)
+#
 # @default-cpu-type: default CPU model typename if none is requested via
 #                    the -cpu argument. (since 4.2)
 #
@@ -361,7 +363,8 @@
   'data': { 'name': 'str', '*alias': 'str',
             '*is-default': 'bool', 'cpu-max': 'int',
             'hotpluggable-cpus': 'bool',  'numa-mem-supported': 'bool',
-            'deprecated': 'bool', '*default-cpu-type': 'str' } }
+            'deprecated': 'bool', 'default-ram-id': 'str',
+            '*default-cpu-type': 'str' } }
 
 ##
 # @query-machines:
-- 
2.26.2




reply via email to

[Prev in Thread] Current Thread [Next in Thread]