]> git.proxmox.com Git - pve-qemu-kvm.git/blame - debian/patches/pve/0008-qapi-modify-query-machines.patch
bump version to 2.7.1-501
[pve-qemu-kvm.git] / debian / patches / pve / 0008-qapi-modify-query-machines.patch
CommitLineData
9c3bec39 1From dc5b92fbb2d405fd86228409b1f25c0bb2d6d973 Mon Sep 17 00:00:00 2001
ca0fe5f5
WB
2From: Wolfgang Bumiller <w.bumiller@proxmox.com>
3Date: Wed, 9 Dec 2015 14:31:18 +0100
9c3bec39 4Subject: [PATCH 08/47] qapi: modify query machines
ca0fe5f5
WB
5
6provide '*is-current' in MachineInfo struct
7---
8 qapi-schema.json | 4 +++-
9 vl.c | 5 +++++
10 2 files changed, 8 insertions(+), 1 deletion(-)
11
12diff --git a/qapi-schema.json b/qapi-schema.json
68a30562 13index 4bf7222..63507f5 100644
ca0fe5f5
WB
14--- a/qapi-schema.json
15+++ b/qapi-schema.json
68a30562 16@@ -3027,6 +3027,8 @@
ca0fe5f5
WB
17 #
18 # @default: #optional whether the machine is default
19 #
20+# @current: #optional 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 #
68a30562 25@@ -3036,7 +3038,7 @@
ca0fe5f5
WB
26 ##
27 { 'struct': 'MachineInfo',
28 'data': { 'name': 'str', '*alias': 'str',
68a30562
WB
29- '*is-default': 'bool', 'cpu-max': 'int',
30+ '*is-default': 'bool', '*is-current': 'bool', 'cpu-max': 'int',
31 'hotpluggable-cpus': 'bool'} }
ca0fe5f5
WB
32
33 ##
ca0fe5f5 34diff --git a/vl.c b/vl.c
9c3bec39 35index 6a218ce..b226e0b 100644
ca0fe5f5
WB
36--- a/vl.c
37+++ b/vl.c
9c3bec39 38@@ -1509,6 +1509,11 @@ MachineInfoList *qmp_query_machines(Error **errp)
ca0fe5f5 39 info->cpu_max = !mc->max_cpus ? 1 : mc->max_cpus;
68a30562 40 info->hotpluggable_cpus = !!mc->query_hotpluggable_cpus;
ca0fe5f5
WB
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--
512.1.4
52