]> git.proxmox.com Git - pve-qemu.git/blob - debian/patches/pve/0015-PVE-qapi-modify-query-machines.patch
squash related patches
[pve-qemu.git] / debian / patches / pve / 0015-PVE-qapi-modify-query-machines.patch
1 From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
2 From: Dietmar Maurer <dietmar@proxmox.com>
3 Date: Mon, 6 Apr 2020 12:16:44 +0200
4 Subject: [PATCH] PVE: qapi: modify query machines
5
6 provide '*is-current' in MachineInfo struct
7
8 Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
9 Signed-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
15 diff --git a/hw/core/machine-qmp-cmds.c b/hw/core/machine-qmp-cmds.c
16 index b98ff15089..24595f618c 100644
17 --- a/hw/core/machine-qmp-cmds.c
18 +++ b/hw/core/machine-qmp-cmds.c
19 @@ -103,6 +103,12 @@ MachineInfoList *qmp_query_machines(Error **errp)
20 info->numa_mem_supported = mc->numa_mem_supported;
21 info->deprecated = !!mc->deprecation_reason;
22 info->acpi = !!object_class_property_find(OBJECT_CLASS(mc), "acpi");
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 }
32 diff --git a/qapi/machine.json b/qapi/machine.json
33 index 15f5f86683..c904280085 100644
34 --- a/qapi/machine.json
35 +++ b/qapi/machine.json
36 @@ -138,6 +138,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 @@ -161,7 +163,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', 'acpi': 'bool' } }