]> git.proxmox.com Git - pve-qemu.git/blame - debian/patches/pve/0014-PVE-qapi-modify-query-machines.patch
update submodule and patches to 7.1.0
[pve-qemu.git] / debian / patches / pve / 0014-PVE-qapi-modify-query-machines.patch
CommitLineData
23102ed6 1From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
6402d961 2From: Dietmar Maurer <dietmar@proxmox.com>
83faa3fe
TL
3Date: Mon, 6 Apr 2020 12:16:44 +0200
4Subject: [PATCH] PVE: qapi: modify query machines
95259824
WB
5
6provide '*is-current' in MachineInfo struct
b855dce7
TL
7
8Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
6402d961 9Signed-off-by: Dietmar Maurer <dietmar@proxmox.com>
95259824 10---
6402d961 11 hw/core/machine-qmp-cmds.c | 6 ++++++
be901f66 12 qapi/machine.json | 4 +++-
6402d961 13 2 files changed, 9 insertions(+), 1 deletion(-)
95259824 14
be901f66 15diff --git a/hw/core/machine-qmp-cmds.c b/hw/core/machine-qmp-cmds.c
4567474e 16index 4f4ab30f8c..76fff60a6b 100644
be901f66
SR
17--- a/hw/core/machine-qmp-cmds.c
18+++ b/hw/core/machine-qmp-cmds.c
4567474e 19@@ -99,6 +99,12 @@ MachineInfoList *qmp_query_machines(Error **errp)
6402d961 20 info->hotpluggable_cpus = mc->has_hotpluggable_cpus;
be901f66
SR
21 info->numa_mem_supported = mc->numa_mem_supported;
22 info->deprecated = !!mc->deprecation_reason;
6402d961 23+
be901f66
SR
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+
6402d961
TL
29 if (mc->default_cpu_type) {
30 info->default_cpu_type = g_strdup(mc->default_cpu_type);
31 info->has_default_cpu_type = true;
be901f66 32diff --git a/qapi/machine.json b/qapi/machine.json
5b15e2ec 33index 8b4be9b718..555458f785 100644
be901f66
SR
34--- a/qapi/machine.json
35+++ b/qapi/machine.json
5b15e2ec 36@@ -138,6 +138,8 @@
95259824 37 #
a544966d 38 # @is-default: whether the machine is default
95259824 39 #
a544966d 40+# @is-current: whether this machine is currently used
95259824
WB
41+#
42 # @cpu-max: maximum number of CPUs supported by the machine type
8dca018b 43 # (since 1.5)
95259824 44 #
5b15e2ec 45@@ -159,7 +161,7 @@
95259824
WB
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',
be901f66 51 'hotpluggable-cpus': 'bool', 'numa-mem-supported': 'bool',
817b7667
SR
52 'deprecated': 'bool', '*default-cpu-type': 'str',
53 '*default-ram-id': 'str' } }