* [Qemu-devel] [PATCH] qapi: report the default CPU type for each machine
@ 2019-05-21 15:38 Daniel P. Berrangé
2019-05-21 15:44 ` Eric Blake
0 siblings, 1 reply; 3+ messages in thread
From: Daniel P. Berrangé @ 2019-05-21 15:38 UTC (permalink / raw)
To: qemu-devel
Cc: Paolo Bonzini, Jiri Denemark, Markus Armbruster,
Daniel P. Berrangé
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.
Signed-off-by: Daniel P. Berrangé <berrange@redhat.com>
---
qapi/misc.json | 6 +++++-
vl.c | 4 ++++
2 files changed, 9 insertions(+), 1 deletion(-)
diff --git a/qapi/misc.json b/qapi/misc.json
index 8b3ca4fdd3..0bb7995bd4 100644
--- a/qapi/misc.json
+++ b/qapi/misc.json
@@ -2018,12 +2018,16 @@
#
# @hotpluggable-cpus: cpu hotplug via -device is supported (since 2.7.0)
#
+# @default-cpu-type: default CPU model typename if none is requested via
+# the -cpu argument. (since 4.2.0)
+#
# Since: 1.2.0
##
{ 'struct': 'MachineInfo',
'data': { 'name': 'str', '*alias': 'str',
'*is-default': 'bool', 'cpu-max': 'int',
- 'hotpluggable-cpus': 'bool'} }
+ 'hotpluggable-cpus': 'bool',
+ '*default-cpu-type': 'str'} }
##
# @query-machines:
diff --git a/vl.c b/vl.c
index 201144b162..b2de329bd2 100644
--- a/vl.c
+++ b/vl.c
@@ -1519,6 +1519,10 @@ MachineInfoList *qmp_query_machines(Error **errp)
info->name = g_strdup(mc->name);
info->cpu_max = !mc->max_cpus ? 1 : mc->max_cpus;
info->hotpluggable_cpus = mc->has_hotpluggable_cpus;
+ 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
^ permalink raw reply related [flat|nested] 3+ messages in thread
* Re: [Qemu-devel] [PATCH] qapi: report the default CPU type for each machine
2019-05-21 15:38 [Qemu-devel] [PATCH] qapi: report the default CPU type for each machine Daniel P. Berrangé
@ 2019-05-21 15:44 ` Eric Blake
2019-05-21 15:49 ` Daniel P. Berrangé
0 siblings, 1 reply; 3+ messages in thread
From: Eric Blake @ 2019-05-21 15:44 UTC (permalink / raw)
To: Daniel P. Berrangé, qemu-devel
Cc: Paolo Bonzini, Jiri Denemark, Markus Armbruster
[-- Attachment #1: Type: text/plain, Size: 1308 bytes --]
On 5/21/19 10:38 AM, Daniel P. Berrangé wrote:
> 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.
>
> Signed-off-by: Daniel P. Berrangé <berrange@redhat.com>
> ---
> qapi/misc.json | 6 +++++-
> vl.c | 4 ++++
> 2 files changed, 9 insertions(+), 1 deletion(-)
>
> diff --git a/qapi/misc.json b/qapi/misc.json
> index 8b3ca4fdd3..0bb7995bd4 100644
> --- a/qapi/misc.json
> +++ b/qapi/misc.json
> @@ -2018,12 +2018,16 @@
> #
> # @hotpluggable-cpus: cpu hotplug via -device is supported (since 2.7.0)
> #
> +# @default-cpu-type: default CPU model typename if none is requested via
> +# the -cpu argument. (since 4.2.0)
4.1 is sufficient (unless you think this is so controversial as to miss
the current release cycle).
Otherwise,
Reviewed-by: Eric Blake <eblake@redhat.com>
--
Eric Blake, Principal Software Engineer
Red Hat, Inc. +1-919-301-3226
Virtualization: qemu.org | libvirt.org
[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 488 bytes --]
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [Qemu-devel] [PATCH] qapi: report the default CPU type for each machine
2019-05-21 15:44 ` Eric Blake
@ 2019-05-21 15:49 ` Daniel P. Berrangé
0 siblings, 0 replies; 3+ messages in thread
From: Daniel P. Berrangé @ 2019-05-21 15:49 UTC (permalink / raw)
To: Eric Blake; +Cc: Paolo Bonzini, Jiri Denemark, qemu-devel, Markus Armbruster
On Tue, May 21, 2019 at 10:44:14AM -0500, Eric Blake wrote:
> On 5/21/19 10:38 AM, Daniel P. Berrangé wrote:
> > 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.
> >
> > Signed-off-by: Daniel P. Berrangé <berrange@redhat.com>
> > ---
> > qapi/misc.json | 6 +++++-
> > vl.c | 4 ++++
> > 2 files changed, 9 insertions(+), 1 deletion(-)
> >
> > diff --git a/qapi/misc.json b/qapi/misc.json
> > index 8b3ca4fdd3..0bb7995bd4 100644
> > --- a/qapi/misc.json
> > +++ b/qapi/misc.json
> > @@ -2018,12 +2018,16 @@
> > #
> > # @hotpluggable-cpus: cpu hotplug via -device is supported (since 2.7.0)
> > #
> > +# @default-cpu-type: default CPU model typename if none is requested via
> > +# the -cpu argument. (since 4.2.0)
>
> 4.1 is sufficient (unless you think this is so controversial as to miss
> the current release cycle).
Yes, I'm getting confused about which release we're doing right now :-)
> Otherwise,
> Reviewed-by: Eric Blake <eblake@redhat.com>
Regards,
Daniel
--
|: https://berrange.com -o- https://www.flickr.com/photos/dberrange :|
|: https://libvirt.org -o- https://fstop138.berrange.com :|
|: https://entangle-photo.org -o- https://www.instagram.com/dberrange :|
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2019-05-21 15:50 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2019-05-21 15:38 [Qemu-devel] [PATCH] qapi: report the default CPU type for each machine Daniel P. Berrangé
2019-05-21 15:44 ` Eric Blake
2019-05-21 15:49 ` Daniel P. Berrangé
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).