Commit 04109957 authored by Daniel P. Berrangé's avatar Daniel P. Berrangé Committed by Eduardo Habkost
Browse files

qapi: report the default CPU type for each machine



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: default avatarEric Blake <eblake@redhat.com>
Signed-off-by: default avatarDaniel P. Berrangé <berrange@redhat.com>
Message-Id: <20190822100412.23746-1-berrange@redhat.com>
Signed-off-by: default avatarEduardo Habkost <ehabkost@redhat.com>
parent fea374e7
Loading
Loading
Loading
Loading
+4 −0
Original line number Diff line number Diff line
@@ -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;
+4 −1
Original line number Diff line number Diff line
@@ -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: