]> git.proxmox.com Git - pve-qemu.git/blame - debian/patches/pve/0015-PVE-qapi-modify-query-machines.patch
bump version to 4.0.1-5
[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---
53e83913
WB
10 qapi/misc.json | 4 +++-
11 vl.c | 5 +++++
95259824
WB
12 2 files changed, 8 insertions(+), 1 deletion(-)
13
53e83913 14diff --git a/qapi/misc.json b/qapi/misc.json
b855dce7 15index c98bb4b559..4a0e26720e 100644
53e83913
WB
16--- a/qapi/misc.json
17+++ b/qapi/misc.json
b855dce7 18@@ -2033,6 +2033,8 @@
95259824 19 #
a544966d 20 # @is-default: whether the machine is default
95259824 21 #
a544966d 22+# @is-current: whether this machine is currently used
95259824
WB
23+#
24 # @cpu-max: maximum number of CPUs supported by the machine type
25 # (since 1.5.0)
26 #
b855dce7 27@@ -2042,7 +2044,7 @@
95259824
WB
28 ##
29 { 'struct': 'MachineInfo',
30 'data': { 'name': 'str', '*alias': 'str',
31- '*is-default': 'bool', 'cpu-max': 'int',
32+ '*is-default': 'bool', '*is-current': 'bool', 'cpu-max': 'int',
33 'hotpluggable-cpus': 'bool'} }
34
35 ##
36diff --git a/vl.c b/vl.c
b8d43c59 37index c3dee09c9b..98efed1a79 100644
95259824
WB
38--- a/vl.c
39+++ b/vl.c
b855dce7 40@@ -1531,6 +1531,11 @@ MachineInfoList *qmp_query_machines(Error **errp)
95259824 41 info->cpu_max = !mc->max_cpus ? 1 : mc->max_cpus;
a544966d 42 info->hotpluggable_cpus = mc->has_hotpluggable_cpus;
95259824
WB
43
44+ if (strcmp(mc->name, MACHINE_GET_CLASS(current_machine)->name) == 0) {
45+ info->has_is_current = true;
46+ info->is_current = true;
47+ }
48+
49 entry = g_malloc0(sizeof(*entry));
50 entry->value = info;
51 entry->next = mach_list;