]> git.proxmox.com Git - pve-qemu.git/blame - debian/patches/pve/0015-PVE-qapi-modify-query-machines.patch
Update and rebase to QEMU 4.1
[pve-qemu.git] / debian / patches / pve / 0015-PVE-qapi-modify-query-machines.patch
CommitLineData
23102ed6 1From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
95259824
WB
2From: Wolfgang Bumiller <w.bumiller@proxmox.com>
3Date: Wed, 9 Dec 2015 14:31:18 +0100
53e83913 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>
95259824 9---
be901f66
SR
10 hw/core/machine-qmp-cmds.c | 5 +++++
11 qapi/machine.json | 4 +++-
95259824
WB
12 2 files changed, 8 insertions(+), 1 deletion(-)
13
be901f66
SR
14diff --git a/hw/core/machine-qmp-cmds.c b/hw/core/machine-qmp-cmds.c
15index 5bd95b8ab0..fd68f9baf8 100644
16--- a/hw/core/machine-qmp-cmds.c
17+++ b/hw/core/machine-qmp-cmds.c
18@@ -229,6 +229,11 @@ MachineInfoList *qmp_query_machines(Error **errp)
19 info->numa_mem_supported = mc->numa_mem_supported;
20 info->deprecated = !!mc->deprecation_reason;
21
22+ if (strcmp(mc->name, MACHINE_GET_CLASS(current_machine)->name) == 0) {
23+ info->has_is_current = true;
24+ info->is_current = true;
25+ }
26+
27 entry = g_malloc0(sizeof(*entry));
28 entry->value = info;
29 entry->next = mach_list;
30diff --git a/qapi/machine.json b/qapi/machine.json
31index 6db8a7e2ec..7b82c5f7f5 100644
32--- a/qapi/machine.json
33+++ b/qapi/machine.json
34@@ -313,6 +313,8 @@
95259824 35 #
a544966d 36 # @is-default: whether the machine is default
95259824 37 #
a544966d 38+# @is-current: whether this machine is currently used
95259824
WB
39+#
40 # @cpu-max: maximum number of CPUs supported by the machine type
41 # (since 1.5.0)
42 #
be901f66 43@@ -329,7 +331,7 @@
95259824
WB
44 ##
45 { 'struct': 'MachineInfo',
46 'data': { 'name': 'str', '*alias': 'str',
47- '*is-default': 'bool', 'cpu-max': 'int',
48+ '*is-default': 'bool', '*is-current': 'bool', 'cpu-max': 'int',
be901f66
SR
49 'hotpluggable-cpus': 'bool', 'numa-mem-supported': 'bool',
50 'deprecated': 'bool' } }
95259824 51