be901f6656
Signed-off-by: Stefan Reiter <s.reiter@proxmox.com>
52 lines
1.7 KiB
Diff
52 lines
1.7 KiB
Diff
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
|
|
From: Wolfgang Bumiller <w.bumiller@proxmox.com>
|
|
Date: Wed, 9 Dec 2015 14:31:18 +0100
|
|
Subject: [PATCH] PVE: qapi: modify query machines
|
|
|
|
provide '*is-current' in MachineInfo struct
|
|
|
|
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
|
|
---
|
|
hw/core/machine-qmp-cmds.c | 5 +++++
|
|
qapi/machine.json | 4 +++-
|
|
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 @@
|
|
#
|
|
# @is-default: whether the machine is default
|
|
#
|
|
+# @is-current: whether this machine is currently used
|
|
+#
|
|
# @cpu-max: maximum number of CPUs supported by the machine type
|
|
# (since 1.5.0)
|
|
#
|
|
@@ -329,7 +331,7 @@
|
|
##
|
|
{ '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' } }
|
|
|