]> git.proxmox.com Git - pve-qemu.git/blob - debian/patches/pve/0016-PVE-qapi-modify-query-machines.patch
4abfa8bd4d8fe803d57bcaf354c148eda6aad5d2
[pve-qemu.git] / debian / patches / pve / 0016-PVE-qapi-modify-query-machines.patch
1 From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
2 From: Wolfgang Bumiller <w.bumiller@proxmox.com>
3 Date: Wed, 9 Dec 2015 14:31:18 +0100
4 Subject: [PATCH] PVE: qapi: modify query machines
5
6 provide '*is-current' in MachineInfo struct
7 ---
8 qapi/misc.json | 4 +++-
9 vl.c | 5 +++++
10 2 files changed, 8 insertions(+), 1 deletion(-)
11
12 diff --git a/qapi/misc.json b/qapi/misc.json
13 index a7d890c076..4e8ebf9adc 100644
14 --- a/qapi/misc.json
15 +++ b/qapi/misc.json
16 @@ -2000,6 +2000,8 @@
17 #
18 # @is-default: whether the machine is default
19 #
20 +# @is-current: whether this machine is currently used
21 +#
22 # @cpu-max: maximum number of CPUs supported by the machine type
23 # (since 1.5.0)
24 #
25 @@ -2009,7 +2011,7 @@
26 ##
27 { 'struct': 'MachineInfo',
28 'data': { 'name': 'str', '*alias': 'str',
29 - '*is-default': 'bool', 'cpu-max': 'int',
30 + '*is-default': 'bool', '*is-current': 'bool', 'cpu-max': 'int',
31 'hotpluggable-cpus': 'bool'} }
32
33 ##
34 diff --git a/vl.c b/vl.c
35 index 12d27fa028..9c3a41bfe2 100644
36 --- a/vl.c
37 +++ b/vl.c
38 @@ -1455,6 +1455,11 @@ MachineInfoList *qmp_query_machines(Error **errp)
39 info->cpu_max = !mc->max_cpus ? 1 : mc->max_cpus;
40 info->hotpluggable_cpus = mc->has_hotpluggable_cpus;
41
42 + if (strcmp(mc->name, MACHINE_GET_CLASS(current_machine)->name) == 0) {
43 + info->has_is_current = true;
44 + info->is_current = true;
45 + }
46 +
47 entry = g_malloc0(sizeof(*entry));
48 entry->value = info;
49 entry->next = mach_list;
50 --
51 2.11.0
52