[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-devel] [PULL v6 10/12] qapi: report the default CPU type for each
From: |
Eduardo Habkost |
Subject: |
[Qemu-devel] [PULL v6 10/12] qapi: report the default CPU type for each machine |
Date: |
Wed, 28 Aug 2019 15:40:24 -0300 |
From: Daniel P. Berrangé <address@hidden>
When user doesn't request any explicit CPU model with libvirt or QEMU,
a machine type specific CPU model is picked. Currently there is no way
to determine what this QEMU built-in default is, so libvirt cannot
report this back to the user in the XML config.
This extends the "query-machines" QMP command so that it reports the
default CPU model typename for each machine.
Reviewed-by: Eric Blake <address@hidden>
Signed-off-by: Daniel P. Berrangé <address@hidden>
Message-Id: <address@hidden>
Signed-off-by: Eduardo Habkost <address@hidden>
---
qapi/machine.json | 5 ++++-
hw/core/machine-qmp-cmds.c | 4 ++++
2 files changed, 8 insertions(+), 1 deletion(-)
diff --git a/qapi/machine.json b/qapi/machine.json
index de5c742d72..ca26779f1a 100644
--- a/qapi/machine.json
+++ b/qapi/machine.json
@@ -348,13 +348,16 @@
# in future versions of QEMU according to the QEMU deprecation
# policy (since 4.1.0)
#
+# @default-cpu-type: default CPU model typename if none is requested via
+# the -cpu argument. (since 4.2)
+#
# Since: 1.2.0
##
{ 'struct': 'MachineInfo',
'data': { 'name': 'str', '*alias': 'str',
'*is-default': 'bool', 'cpu-max': 'int',
'hotpluggable-cpus': 'bool', 'numa-mem-supported': 'bool',
- 'deprecated': 'bool' } }
+ 'deprecated': 'bool', '*default-cpu-type': 'str' } }
##
# @query-machines:
diff --git a/hw/core/machine-qmp-cmds.c b/hw/core/machine-qmp-cmds.c
index 15cf7c62e3..eed5aeb2f7 100644
--- a/hw/core/machine-qmp-cmds.c
+++ b/hw/core/machine-qmp-cmds.c
@@ -230,6 +230,10 @@ MachineInfoList *qmp_query_machines(Error **errp)
info->hotpluggable_cpus = mc->has_hotpluggable_cpus;
info->numa_mem_supported = mc->numa_mem_supported;
info->deprecated = !!mc->deprecation_reason;
+ if (mc->default_cpu_type) {
+ info->default_cpu_type = g_strdup(mc->default_cpu_type);
+ info->has_default_cpu_type = true;
+ }
entry = g_malloc0(sizeof(*entry));
entry->value = info;
--
2.21.0
- [Qemu-devel] [PULL v6 00/12] Machine + x86 queue, 2019-08-28, Eduardo Habkost, 2019/08/28
- [Qemu-devel] [PULL v6 01/12] includes: remove stale [smp|max]_cpus externs, Eduardo Habkost, 2019/08/28
- [Qemu-devel] [PULL v6 02/12] hw/arm: simplify arm_load_dtb, Eduardo Habkost, 2019/08/28
- [Qemu-devel] [PULL v6 03/12] numa: move numa global variable nb_numa_nodes into MachineState, Eduardo Habkost, 2019/08/28
- [Qemu-devel] [PULL v6 04/12] numa: move numa global variable have_numa_distance into MachineState, Eduardo Habkost, 2019/08/28
- [Qemu-devel] [PULL v6 05/12] numa: move numa global variable numa_info into MachineState, Eduardo Habkost, 2019/08/28
- [Qemu-devel] [PULL v6 06/12] numa: Introduce MachineClass::auto_enable_numa for implicit NUMA node, Eduardo Habkost, 2019/08/28
- [Qemu-devel] [PULL v6 07/12] pc: Fix error message on die-id validation, Eduardo Habkost, 2019/08/28
- [Qemu-devel] [PULL v6 08/12] pc: Improve error message when die-id is omitted, Eduardo Habkost, 2019/08/28
- [Qemu-devel] [PULL v6 09/12] pc: Don't make die-id mandatory unless necessary, Eduardo Habkost, 2019/08/28
- [Qemu-devel] [PULL v6 10/12] qapi: report the default CPU type for each machine,
Eduardo Habkost <=
- [Qemu-devel] [PULL v6 11/12] hostmem-file: fix pmem file size check, Eduardo Habkost, 2019/08/28
- [Qemu-devel] [PULL v6 12/12] i386/vmmouse: Properly reset state, Eduardo Habkost, 2019/08/28