pve-qemu/debian/patches/pve/0015-PVE-qapi-modify-query-...

52 lines
1.6 KiB
Diff
Raw Normal View History

From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
2017-04-05 11:49:19 +03:00
From: Wolfgang Bumiller <w.bumiller@proxmox.com>
Date: Wed, 9 Dec 2015 14:31:18 +0100
Subject: [PATCH] PVE: qapi: modify query machines
2017-04-05 11:49:19 +03:00
provide '*is-current' in MachineInfo struct
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2017-04-05 11:49:19 +03:00
---
qapi/misc.json | 4 +++-
vl.c | 5 +++++
2017-04-05 11:49:19 +03:00
2 files changed, 8 insertions(+), 1 deletion(-)
diff --git a/qapi/misc.json b/qapi/misc.json
index c98bb4b559..4a0e26720e 100644
--- a/qapi/misc.json
+++ b/qapi/misc.json
@@ -2033,6 +2033,8 @@
2017-04-05 11:49:19 +03:00
#
2017-04-05 12:38:26 +03:00
# @is-default: whether the machine is default
2017-04-05 11:49:19 +03:00
#
2017-04-05 12:38:26 +03:00
+# @is-current: whether this machine is currently used
2017-04-05 11:49:19 +03:00
+#
# @cpu-max: maximum number of CPUs supported by the machine type
# (since 1.5.0)
#
@@ -2042,7 +2044,7 @@
2017-04-05 11:49:19 +03:00
##
{ 'struct': 'MachineInfo',
'data': { 'name': 'str', '*alias': 'str',
- '*is-default': 'bool', 'cpu-max': 'int',
+ '*is-default': 'bool', '*is-current': 'bool', 'cpu-max': 'int',
'hotpluggable-cpus': 'bool'} }
##
diff --git a/vl.c b/vl.c
index c3dee09c9b..98efed1a79 100644
2017-04-05 11:49:19 +03:00
--- a/vl.c
+++ b/vl.c
@@ -1531,6 +1531,11 @@ MachineInfoList *qmp_query_machines(Error **errp)
2017-04-05 11:49:19 +03:00
info->cpu_max = !mc->max_cpus ? 1 : mc->max_cpus;
2017-04-05 12:38:26 +03:00
info->hotpluggable_cpus = mc->has_hotpluggable_cpus;
2017-04-05 11:49:19 +03:00
+ if (strcmp(mc->name, MACHINE_GET_CLASS(current_machine)->name) == 0) {
+ info->has_is_current = true;
+ info->is_current = true;
+ }
+
entry = g_malloc0(sizeof(*entry));
entry->value = info;
entry->next = mach_list;