]>
Commit | Line | Data |
---|---|---|
23102ed6 | 1 | From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 |
95259824 WB |
2 | From: Wolfgang Bumiller <w.bumiller@proxmox.com> |
3 | Date: Wed, 9 Dec 2015 14:31:18 +0100 | |
53e83913 | 4 | Subject: [PATCH] PVE: qapi: modify query machines |
95259824 WB |
5 | |
6 | provide '*is-current' in MachineInfo struct | |
b855dce7 TL |
7 | |
8 | Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com> | |
95259824 | 9 | --- |
be901f66 SR |
10 | hw/core/machine-qmp-cmds.c | 5 +++++ |
11 | qapi/machine.json | 4 +++- | |
95259824 WB |
12 | 2 files changed, 8 insertions(+), 1 deletion(-) |
13 | ||
be901f66 SR |
14 | diff --git a/hw/core/machine-qmp-cmds.c b/hw/core/machine-qmp-cmds.c |
15 | index 5bd95b8ab0..fd68f9baf8 100644 | |
16 | --- a/hw/core/machine-qmp-cmds.c | |
17 | +++ b/hw/core/machine-qmp-cmds.c | |
18 | @@ -229,6 +229,11 @@ MachineInfoList *qmp_query_machines(Error **errp) | |
19 | info->numa_mem_supported = mc->numa_mem_supported; | |
20 | info->deprecated = !!mc->deprecation_reason; | |
21 | ||
22 | + if (strcmp(mc->name, MACHINE_GET_CLASS(current_machine)->name) == 0) { | |
23 | + info->has_is_current = true; | |
24 | + info->is_current = true; | |
25 | + } | |
26 | + | |
27 | entry = g_malloc0(sizeof(*entry)); | |
28 | entry->value = info; | |
29 | entry->next = mach_list; | |
30 | diff --git a/qapi/machine.json b/qapi/machine.json | |
31 | index 6db8a7e2ec..7b82c5f7f5 100644 | |
32 | --- a/qapi/machine.json | |
33 | +++ b/qapi/machine.json | |
34 | @@ -313,6 +313,8 @@ | |
95259824 | 35 | # |
a544966d | 36 | # @is-default: whether the machine is default |
95259824 | 37 | # |
a544966d | 38 | +# @is-current: whether this machine is currently used |
95259824 WB |
39 | +# |
40 | # @cpu-max: maximum number of CPUs supported by the machine type | |
41 | # (since 1.5.0) | |
42 | # | |
be901f66 | 43 | @@ -329,7 +331,7 @@ |
95259824 WB |
44 | ## |
45 | { 'struct': 'MachineInfo', | |
46 | 'data': { 'name': 'str', '*alias': 'str', | |
47 | - '*is-default': 'bool', 'cpu-max': 'int', | |
48 | + '*is-default': 'bool', '*is-current': 'bool', 'cpu-max': 'int', | |
be901f66 SR |
49 | 'hotpluggable-cpus': 'bool', 'numa-mem-supported': 'bool', |
50 | 'deprecated': 'bool' } } | |
95259824 | 51 |