]> git.proxmox.com Git - pve-qemu.git/blame_incremental - debian/patches/pve/0014-PVE-qapi-modify-query-machines.patch
update and rebase to QEMU v6.1.0
[pve-qemu.git] / debian / patches / pve / 0014-PVE-qapi-modify-query-machines.patch
... / ...
CommitLineData
1From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
2From: Dietmar Maurer <dietmar@proxmox.com>
3Date: Mon, 6 Apr 2020 12:16:44 +0200
4Subject: [PATCH] PVE: qapi: modify query machines
5
6provide '*is-current' in MachineInfo struct
7
8Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
9Signed-off-by: Dietmar Maurer <dietmar@proxmox.com>
10---
11 hw/core/machine-qmp-cmds.c | 6 ++++++
12 qapi/machine.json | 4 +++-
13 2 files changed, 9 insertions(+), 1 deletion(-)
14
15diff --git a/hw/core/machine-qmp-cmds.c b/hw/core/machine-qmp-cmds.c
16index 216fdfaf3a..8f8d5d5276 100644
17--- a/hw/core/machine-qmp-cmds.c
18+++ b/hw/core/machine-qmp-cmds.c
19@@ -98,6 +98,12 @@ MachineInfoList *qmp_query_machines(Error **errp)
20 info->hotpluggable_cpus = mc->has_hotpluggable_cpus;
21 info->numa_mem_supported = mc->numa_mem_supported;
22 info->deprecated = !!mc->deprecation_reason;
23+
24+ if (strcmp(mc->name, MACHINE_GET_CLASS(current_machine)->name) == 0) {
25+ info->has_is_current = true;
26+ info->is_current = true;
27+ }
28+
29 if (mc->default_cpu_type) {
30 info->default_cpu_type = g_strdup(mc->default_cpu_type);
31 info->has_default_cpu_type = true;
32diff --git a/qapi/machine.json b/qapi/machine.json
33index 34035c25d1..cf120ac343 100644
34--- a/qapi/machine.json
35+++ b/qapi/machine.json
36@@ -141,6 +141,8 @@
37 #
38 # @is-default: whether the machine is default
39 #
40+# @is-current: whether this machine is currently used
41+#
42 # @cpu-max: maximum number of CPUs supported by the machine type
43 # (since 1.5)
44 #
45@@ -162,7 +164,7 @@
46 ##
47 { 'struct': 'MachineInfo',
48 'data': { 'name': 'str', '*alias': 'str',
49- '*is-default': 'bool', 'cpu-max': 'int',
50+ '*is-default': 'bool', '*is-current': 'bool', 'cpu-max': 'int',
51 'hotpluggable-cpus': 'bool', 'numa-mem-supported': 'bool',
52 'deprecated': 'bool', '*default-cpu-type': 'str',
53 '*default-ram-id': 'str' } }