From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:51496) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bUYMR-0008LF-Uc for qemu-devel@nongnu.org; Tue, 02 Aug 2016 07:59:55 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1bUYMN-0001D2-TV for qemu-devel@nongnu.org; Tue, 02 Aug 2016 07:59:51 -0400 Received: from mx0a-001b2d01.pphosted.com ([148.163.156.1]:54175) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bUYMN-0001Cv-L1 for qemu-devel@nongnu.org; Tue, 02 Aug 2016 07:59:47 -0400 Received: from pps.filterd (m0098393.ppops.net [127.0.0.1]) by mx0a-001b2d01.pphosted.com (8.16.0.11/8.16.0.11) with SMTP id u72BsNje012562 for ; Tue, 2 Aug 2016 07:59:47 -0400 Received: from e06smtp15.uk.ibm.com (e06smtp15.uk.ibm.com [195.75.94.111]) by mx0a-001b2d01.pphosted.com with ESMTP id 24gn4a1pqg-1 (version=TLSv1.2 cipher=AES256-SHA bits=256 verify=NOT) for ; Tue, 02 Aug 2016 07:59:46 -0400 Received: from localhost by e06smtp15.uk.ibm.com with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted for from ; Tue, 2 Aug 2016 12:59:44 +0100 Received: from b06cxnps4075.portsmouth.uk.ibm.com (d06relay12.portsmouth.uk.ibm.com [9.149.109.197]) by d06dlp03.portsmouth.uk.ibm.com (Postfix) with ESMTP id 4267C1B0806E for ; Tue, 2 Aug 2016 13:01:02 +0100 (BST) Received: from d06av10.portsmouth.uk.ibm.com (d06av10.portsmouth.uk.ibm.com [9.149.37.251]) by b06cxnps4075.portsmouth.uk.ibm.com (8.14.9/8.14.9/NCO v10.0) with ESMTP id u72BxWkg56098920 for ; Tue, 2 Aug 2016 11:59:32 GMT Received: from d06av10.portsmouth.uk.ibm.com (localhost [127.0.0.1]) by d06av10.portsmouth.uk.ibm.com (8.14.4/8.14.4/NCO v10.0 AVout) with ESMTP id u72AxX6p024818 for ; Tue, 2 Aug 2016 04:59:34 -0600 From: David Hildenbrand Date: Tue, 2 Aug 2016 13:59:12 +0200 In-Reply-To: <1470139155-53900-1-git-send-email-dahi@linux.vnet.ibm.com> References: <1470139155-53900-1-git-send-email-dahi@linux.vnet.ibm.com> Message-Id: <1470139155-53900-27-git-send-email-dahi@linux.vnet.ibm.com> Subject: [Qemu-devel] [Patch v1 26/29] qmp: add QMP interface "query-cpu-model-baseline" List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: qemu-devel@nongnu.org Cc: ehabkost@redhat.com, jdenemar@redhat.com, imammedo@redhat.com, cornelia.huck@de.ibm.com, borntraeger@de.ibm.com, fiuczy@linux.vnet.ibm.com, mimu@linux.vnet.ibm.com Let's provide a standardized interface to baseline two CPU models, to create a third, compatible one. The returned CPU model is a static CPU model, so it will never change between QEMU machines. Acked-by: Cornelia Huck Signed-off-by: David Hildenbrand --- include/sysemu/arch_init.h | 3 +++ qapi-schema.json | 38 +++++++++++++++++++++++++++++++++++ qmp-commands.hx | 6 ++++++ qmp.c | 7 +++++++ stubs/Makefile.objs | 1 + stubs/arch-query-cpu-model-baseline.c | 12 +++++++++++ 6 files changed, 67 insertions(+) create mode 100644 stubs/arch-query-cpu-model-baseline.c diff --git a/include/sysemu/arch_init.h b/include/sysemu/arch_init.h index 96d47c0..1c9dad1 100644 --- a/include/sysemu/arch_init.h +++ b/include/sysemu/arch_init.h @@ -41,5 +41,8 @@ CpuModelExpansionInfo *arch_query_cpu_model_expansion(CpuModelExpansionType type CpuModelCompareInfo *arch_query_cpu_model_comparison(CpuModelInfo *modela, CpuModelInfo *modelb, Error **errp); +CpuModelBaselineInfo *arch_query_cpu_model_baseline(CpuModelInfo *modela, + CpuModelInfo *modelb, + Error **errp); #endif diff --git a/qapi-schema.json b/qapi-schema.json index 1f8f8ec..4e21a86 100644 --- a/qapi-schema.json +++ b/qapi-schema.json @@ -3214,6 +3214,44 @@ 'data': { 'modela': 'CpuModelInfo', 'modelb': 'CpuModelInfo' }, 'returns': 'CpuModelCompareInfo' } +## +# @CpuModelBaselineInfo +# +# The result of a CPU model baseline. +# +# @model: the baselined CpuModelInfo. +# +# Since: 2.8.0 +## +{ 'struct': 'CpuModelBaselineInfo', + 'data': { 'model': 'CpuModelInfo' } } + +## +# @query-cpu-model-baseline: +# +# Baseline two CPU models, creating a compatible third model. The created +# model will always be a static, migration-safe CPU model (see "static" +# CPU model expansion for details). The QEMU machine QEMU has been started +# with affects the result if CPU definitions are used that are not static. +# +# Note: This interface should not be used when global properties of CPU classes +# are changed (e.g. via "-cpu ..."). +# +# s390x supports baselining of all CPU models. Other architectures are not +# supported yet. +# +# Returns: a CpuModelBaselineInfo. Returns an error if baselining CPU models is +# not supported, if a model cannot be used, if a model contains +# an unknown cpu definition name, unknown properties or properties +# with wrong types. +# +# Since: 2.8.0 +## +{ 'command': 'query-cpu-model-baseline', + 'data': { 'modela': 'CpuModelInfo', + 'modelb': 'CpuModelInfo' }, + 'returns': 'CpuModelBaselineInfo' } + # @AddfdInfo: # # Information about a file descriptor that was added to an fd set. diff --git a/qmp-commands.hx b/qmp-commands.hx index 0af2098..8abccb9 100644 --- a/qmp-commands.hx +++ b/qmp-commands.hx @@ -3954,6 +3954,12 @@ EQMP }, { + .name = "query-cpu-model-baseline", + .args_type = "modela:q,modelb:q", + .mhandler.cmd_new = qmp_marshal_query_cpu_model_baseline, + }, + + { .name = "query-target", .args_type = "", .mhandler.cmd_new = qmp_marshal_query_target, diff --git a/qmp.c b/qmp.c index f551019..dea8f81 100644 --- a/qmp.c +++ b/qmp.c @@ -621,6 +621,13 @@ CpuModelCompareInfo *qmp_query_cpu_model_comparison(CpuModelInfo *modela, return arch_query_cpu_model_comparison(modela, modelb, errp); } +CpuModelBaselineInfo *qmp_query_cpu_model_baseline(CpuModelInfo *modela, + CpuModelInfo *modelb, + Error **errp) +{ + return arch_query_cpu_model_baseline(modela, modelb, errp); +} + void qmp_add_client(const char *protocol, const char *fdname, bool has_skipauth, bool skipauth, bool has_tls, bool tls, Error **errp) diff --git a/stubs/Makefile.objs b/stubs/Makefile.objs index da768f0..c5850e8 100644 --- a/stubs/Makefile.objs +++ b/stubs/Makefile.objs @@ -1,6 +1,7 @@ stub-obj-y += arch-query-cpu-def.o stub-obj-y += arch-query-cpu-model-expansion.o stub-obj-y += arch-query-cpu-model-comparison.o +stub-obj-y += arch-query-cpu-model-baseline.o stub-obj-y += bdrv-next-monitor-owned.o stub-obj-y += blk-commit-all.o stub-obj-y += blockdev-close-all-bdrv-states.o diff --git a/stubs/arch-query-cpu-model-baseline.c b/stubs/arch-query-cpu-model-baseline.c new file mode 100644 index 0000000..094ec13 --- /dev/null +++ b/stubs/arch-query-cpu-model-baseline.c @@ -0,0 +1,12 @@ +#include "qemu/osdep.h" +#include "qemu-common.h" +#include "sysemu/arch_init.h" +#include "qapi/qmp/qerror.h" + +CpuModelBaselineInfo *arch_query_cpu_model_baseline(CpuModelInfo *modela, + CpuModelInfo *modelb, + Error **errp) +{ + error_setg(errp, QERR_UNSUPPORTED); + return NULL; +} -- 2.6.6