All of lore.kernel.org
 help / color / mirror / Atom feed
From: Eduardo Habkost <ehabkost@redhat.com>
To: Paolo Bonzini <pbonzini@redhat.com>,
	Igor Mammedov <imammedo@redhat.com>,
	Peter Maydell <peter.maydell@linaro.org>,
	Richard Henderson <rth@twiddle.net>,
	Marcel Apfelbaum <marcel.apfelbaum@gmail.com>,
	qemu-devel@nongnu.org
Cc: "Daniel P. Berrangé" <berrange@redhat.com>
Subject: [Qemu-devel] [PULL v2 09/13] qapi: report the default CPU type for each machine
Date: Tue,  3 Sep 2019 18:01:57 -0300	[thread overview]
Message-ID: <20190903210201.14627-10-ehabkost@redhat.com> (raw)
In-Reply-To: <20190903210201.14627-1-ehabkost@redhat.com>

From: Daniel P. Berrangé <berrange@redhat.com>

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 <eblake@redhat.com>
Signed-off-by: Daniel P. Berrangé <berrange@redhat.com>
Message-Id: <20190822100412.23746-1-berrange@redhat.com>
Signed-off-by: Eduardo Habkost <ehabkost@redhat.com>
---
 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



  parent reply	other threads:[~2019-09-03 21:40 UTC|newest]

Thread overview: 15+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-09-03 21:01 [Qemu-devel] [PULL v2 00/13] Machine + x86 queue, 2019-09-03 Eduardo Habkost
2019-09-03 21:01 ` [Qemu-devel] [PULL v2 01/13] includes: remove stale [smp|max]_cpus externs Eduardo Habkost
2019-09-03 21:01 ` [Qemu-devel] [PULL v2 02/13] hw/arm: simplify arm_load_dtb Eduardo Habkost
2019-09-03 21:01 ` [Qemu-devel] [PULL v2 03/13] numa: move numa global variable nb_numa_nodes into MachineState Eduardo Habkost
2019-09-03 21:01 ` [Qemu-devel] [PULL v2 04/13] numa: move numa global variable have_numa_distance " Eduardo Habkost
2019-09-03 21:01 ` [Qemu-devel] [PULL v2 05/13] numa: move numa global variable numa_info " Eduardo Habkost
2019-09-03 21:01 ` [Qemu-devel] [PULL v2 06/13] pc: Fix error message on die-id validation Eduardo Habkost
2019-09-03 21:01 ` [Qemu-devel] [PULL v2 07/13] pc: Improve error message when die-id is omitted Eduardo Habkost
2019-09-03 21:01 ` [Qemu-devel] [PULL v2 08/13] pc: Don't make die-id mandatory unless necessary Eduardo Habkost
2019-09-03 21:01 ` Eduardo Habkost [this message]
2019-09-03 21:01 ` [Qemu-devel] [PULL v2 10/13] hostmem-file: fix pmem file size check Eduardo Habkost
2019-09-03 21:01 ` [Qemu-devel] [PULL v2 11/13] i386/vmmouse: Properly reset state Eduardo Habkost
2019-09-03 21:02 ` [Qemu-devel] [PULL v2 12/13] x86: do not advertise die-id in query-hotpluggbale-cpus if '-smp dies' is not set Eduardo Habkost
2019-09-03 21:02 ` [Qemu-devel] [PULL v2 13/13] migration: Do not re-read the clock on pre_save in case of paused guest Eduardo Habkost
2019-09-04 14:38 ` [Qemu-devel] [PULL v2 00/13] Machine + x86 queue, 2019-09-03 Peter Maydell

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20190903210201.14627-10-ehabkost@redhat.com \
    --to=ehabkost@redhat.com \
    --cc=berrange@redhat.com \
    --cc=imammedo@redhat.com \
    --cc=marcel.apfelbaum@gmail.com \
    --cc=pbonzini@redhat.com \
    --cc=peter.maydell@linaro.org \
    --cc=qemu-devel@nongnu.org \
    --cc=rth@twiddle.net \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.