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

52 lines
1.7 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
---
hw/core/machine-qmp-cmds.c | 5 +++++
qapi/machine.json | 4 +++-
2017-04-05 11:49:19 +03:00
2 files changed, 8 insertions(+), 1 deletion(-)
diff --git a/hw/core/machine-qmp-cmds.c b/hw/core/machine-qmp-cmds.c
index 5bd95b8ab0..fd68f9baf8 100644
--- a/hw/core/machine-qmp-cmds.c
+++ b/hw/core/machine-qmp-cmds.c
@@ -229,6 +229,11 @@ MachineInfoList *qmp_query_machines(Error **errp)
info->numa_mem_supported = mc->numa_mem_supported;
info->deprecated = !!mc->deprecation_reason;
+ 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;
diff --git a/qapi/machine.json b/qapi/machine.json
index 6db8a7e2ec..7b82c5f7f5 100644
--- a/qapi/machine.json
+++ b/qapi/machine.json
@@ -313,6 +313,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)
#
@@ -329,7 +331,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', 'numa-mem-supported': 'bool',
'deprecated': 'bool' } }
2017-04-05 11:49:19 +03:00