From nobody Tue Feb 10 06:58:32 2026 Delivered-To: importer@patchew.org Received-SPF: pass (zoho.com: domain of gnu.org designates 208.118.235.17 as permitted sender) client-ip=208.118.235.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Authentication-Results: mx.zohomail.com; spf=pass (zoho.com: domain of gnu.org designates 208.118.235.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=fail(p=none dis=none) header.from=redhat.com Return-Path: Received: from lists.gnu.org (208.118.235.17 [208.118.235.17]) by mx.zohomail.com with SMTPS id 1521635352422749.6679201703553; Wed, 21 Mar 2018 05:29:12 -0700 (PDT) Received: from localhost ([::1]:54376 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1eycrX-0006Hh-Uf for importer@patchew.org; Wed, 21 Mar 2018 08:29:04 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:49137) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1eycJt-0006xS-Qj for qemu-devel@nongnu.org; Wed, 21 Mar 2018 07:54:19 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1eycJr-0000J5-Ah for qemu-devel@nongnu.org; Wed, 21 Mar 2018 07:54:17 -0400 Received: from mx3-rdu2.redhat.com ([66.187.233.73]:51884 helo=mx1.redhat.com) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1eycJr-0000Ip-4t for qemu-devel@nongnu.org; Wed, 21 Mar 2018 07:54:15 -0400 Received: from smtp.corp.redhat.com (int-mx05.intmail.prod.int.rdu2.redhat.com [10.11.54.5]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id A1EB340267D7 for ; Wed, 21 Mar 2018 11:54:14 +0000 (UTC) Received: from localhost (ovpn-112-73.ams2.redhat.com [10.36.112.73]) by smtp.corp.redhat.com (Postfix) with ESMTP id 059A38445E; Wed, 21 Mar 2018 11:54:13 +0000 (UTC) From: =?UTF-8?q?Marc-Andr=C3=A9=20Lureau?= To: qemu-devel@nongnu.org Date: Wed, 21 Mar 2018 12:52:09 +0100 Message-Id: <20180321115211.17937-48-marcandre.lureau@redhat.com> In-Reply-To: <20180321115211.17937-1-marcandre.lureau@redhat.com> References: <20180321115211.17937-1-marcandre.lureau@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.11.54.5 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.11.55.6]); Wed, 21 Mar 2018 11:54:14 +0000 (UTC) X-Greylist: inspected by milter-greylist-4.5.16 (mx1.redhat.com [10.11.55.6]); Wed, 21 Mar 2018 11:54:14 +0000 (UTC) for IP:'10.11.54.5' DOMAIN:'int-mx05.intmail.prod.int.rdu2.redhat.com' HELO:'smtp.corp.redhat.com' FROM:'marcandre.lureau@redhat.com' RCPT:'' Content-Transfer-Encoding: quoted-printable X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] [fuzzy] X-Received-From: 66.187.233.73 Subject: [Qemu-devel] [PATCH v3 47/49] qapi: make query-cpu-definitions depend on specific targets X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: =?UTF-8?q?Marc-Andr=C3=A9=20Lureau?= , armbru@redhat.com Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail: RSF_0 Z_629925259 SPT_0 Content-Type: text/plain; charset="utf-8" It depends on TARGET_PPC || TARGET_ARM || TARGET_I386 || TARGET_S390X. Signed-off-by: Marc-Andr=C3=A9 Lureau Reviewed-by: Eduardo Habkost Acked-by: Cornelia Huck --- qapi/misc.json | 10 ---------- qapi/target.json | 12 ++++++++++++ include/sysemu/arch_init.h | 1 - monitor.c | 22 ---------------------- qmp.c | 5 ----- stubs/arch-query-cpu-def.c | 11 ----------- target/arm/helper.c | 3 ++- target/i386/cpu.c | 3 ++- target/ppc/translate_init.c | 3 ++- target/s390x/cpu_models.c | 2 +- stubs/Makefile.objs | 1 - 11 files changed, 19 insertions(+), 54 deletions(-) delete mode 100644 stubs/arch-query-cpu-def.c diff --git a/qapi/misc.json b/qapi/misc.json index 602c99b174..e9538ecae6 100644 --- a/qapi/misc.json +++ b/qapi/misc.json @@ -2027,16 +2027,6 @@ ## { 'command': 'query-memory-size-summary', 'returns': 'MemoryInfo' } =20 -## -# @query-cpu-definitions: -# -# Return a list of supported virtual CPU definitions -# -# Returns: a list of CpuDefInfo -# -# Since: 1.2.0 -## -{ 'command': 'query-cpu-definitions', 'returns': ['CpuDefinitionInfo'] } =20 ## # @CpuModelInfo: diff --git a/qapi/target.json b/qapi/target.json index 323994a6ec..89ba4207b1 100644 --- a/qapi/target.json +++ b/qapi/target.json @@ -378,3 +378,15 @@ 'model': 'CpuModelInfo' }, 'returns': 'CpuModelExpansionInfo', 'if': 'defined(TARGET_S390X) || defined(TARGET_I386)' } + +## +# @query-cpu-definitions: +# +# Return a list of supported virtual CPU definitions +# +# Returns: a list of CpuDefInfo +# +# Since: 1.2.0 +## +{ 'command': 'query-cpu-definitions', 'returns': ['CpuDefinitionInfo'], + 'if': 'defined(TARGET_PPC) || defined(TARGET_ARM) || defined(TARGET_I386= ) || defined(TARGET_S390X)' } diff --git a/include/sysemu/arch_init.h b/include/sysemu/arch_init.h index 2497fd3351..10cbafe970 100644 --- a/include/sysemu/arch_init.h +++ b/include/sysemu/arch_init.h @@ -32,5 +32,4 @@ extern const uint32_t arch_type; int kvm_available(void); int xen_available(void); =20 -CpuDefinitionInfoList *arch_query_cpu_definitions(Error **errp); #endif diff --git a/monitor.c b/monitor.c index 63c51ee05d..377ea3c98b 100644 --- a/monitor.c +++ b/monitor.c @@ -1143,26 +1143,6 @@ static void qmp_query_qmp_schema(QDict *qdict, QObje= ct **ret_data, *ret_data =3D qobject_from_qlit(&qmp_schema_qlit); } =20 -/* - * We used to define commands in qmp-commands.hx in addition to the - * QAPI schema. This permitted defining some of them only in certain - * configurations. query-commands has always reflected that (good, - * because it lets QMP clients figure out what's actually available), - * while query-qmp-schema never did (not so good). This function is a - * hack to keep the configuration-specific commands defined exactly as - * before, even though qmp-commands.hx is gone. - * - * FIXME Educate the QAPI schema on configuration-specific commands, - * and drop this hack. - */ -static void qmp_unregister_commands_hack(void) -{ -#if !defined(TARGET_PPC) && !defined(TARGET_ARM) && !defined(TARGET_I386) \ - && !defined(TARGET_S390X) - qmp_unregister_command(&qmp_commands, "query-cpu-definitions"); -#endif -} - static void monitor_init_qmp_commands(void) { /* @@ -1184,8 +1164,6 @@ static void monitor_init_qmp_commands(void) qmp_register_command(&qmp_commands, "netdev_add", qmp_netdev_add, QCO_NO_OPTIONS); =20 - qmp_unregister_commands_hack(); - QTAILQ_INIT(&qmp_cap_negotiation_commands); qmp_register_command(&qmp_cap_negotiation_commands, "qmp_capabilities", qmp_marshal_qmp_capabilities, QCO_NO_OPTIONS); diff --git a/qmp.c b/qmp.c index 9ded2f48c4..cafda4417d 100644 --- a/qmp.c +++ b/qmp.c @@ -589,11 +589,6 @@ ObjectPropertyInfoList *qmp_qom_list_properties(const = char *typename, return prop_list; } =20 -CpuDefinitionInfoList *qmp_query_cpu_definitions(Error **errp) -{ - return arch_query_cpu_definitions(errp); -} - void qmp_add_client(const char *protocol, const char *fdname, bool has_skipauth, bool skipauth, bool has_tls, bool t= ls, Error **errp) diff --git a/stubs/arch-query-cpu-def.c b/stubs/arch-query-cpu-def.c deleted file mode 100644 index d436f95314..0000000000 --- a/stubs/arch-query-cpu-def.c +++ /dev/null @@ -1,11 +0,0 @@ -#include "qemu/osdep.h" -#include "qemu-common.h" -#include "sysemu/arch_init.h" -#include "qapi/error.h" -#include "qapi/qmp/qerror.h" - -CpuDefinitionInfoList *arch_query_cpu_definitions(Error **errp) -{ - error_setg(errp, QERR_UNSUPPORTED); - return NULL; -} diff --git a/target/arm/helper.c b/target/arm/helper.c index 09893e3f72..ab8520f07d 100644 --- a/target/arm/helper.c +++ b/target/arm/helper.c @@ -17,6 +17,7 @@ #include "exec/semihost.h" #include "sysemu/kvm.h" #include "fpu/softfloat.h" +#include "qapi/target-qapi-commands.h" =20 #define ARM_CPU_FREQ 1000000000 /* FIXME: 1 GHz, should be configurable */ =20 @@ -5549,7 +5550,7 @@ static void arm_cpu_add_definition(gpointer data, gpo= inter user_data) *cpu_list =3D entry; } =20 -CpuDefinitionInfoList *arch_query_cpu_definitions(Error **errp) +CpuDefinitionInfoList *qmp_query_cpu_definitions(Error **errp) { CpuDefinitionInfoList *cpu_list =3D NULL; GSList *list; diff --git a/target/i386/cpu.c b/target/i386/cpu.c index 563dad644c..62c0c5b1eb 100644 --- a/target/i386/cpu.c +++ b/target/i386/cpu.c @@ -34,6 +34,7 @@ #include "qapi/error.h" #include "qapi/qapi-visit-misc.h" #include "qapi/qapi-visit-run-state.h" +#include "qapi/target-qapi-commands.h" #include "qapi/qmp/qdict.h" #include "qapi/qmp/qerror.h" #include "qapi/visitor.h" @@ -2865,7 +2866,7 @@ static void x86_cpu_definition_entry(gpointer data, g= pointer user_data) *cpu_list =3D entry; } =20 -CpuDefinitionInfoList *arch_query_cpu_definitions(Error **errp) +CpuDefinitionInfoList *qmp_query_cpu_definitions(Error **errp) { CpuDefinitionInfoList *cpu_list =3D NULL; GSList *list =3D get_sorted_cpu_model_list(); diff --git a/target/ppc/translate_init.c b/target/ppc/translate_init.c index 391b94b97d..e679e8d301 100644 --- a/target/ppc/translate_init.c +++ b/target/ppc/translate_init.c @@ -39,6 +39,7 @@ #include "qemu/cutils.h" #include "disas/capstone.h" #include "fpu/softfloat.h" +#include "qapi/target-qapi-commands.h" =20 //#define PPC_DUMP_CPU //#define PPC_DEBUG_SPR @@ -10298,7 +10299,7 @@ static void ppc_cpu_defs_entry(gpointer data, gpoin= ter user_data) *first =3D entry; } =20 -CpuDefinitionInfoList *arch_query_cpu_definitions(Error **errp) +CpuDefinitionInfoList *qmp_query_cpu_definitions(Error **errp) { CpuDefinitionInfoList *cpu_list =3D NULL; GSList *list; diff --git a/target/s390x/cpu_models.c b/target/s390x/cpu_models.c index e25034231d..c9b5216284 100644 --- a/target/s390x/cpu_models.c +++ b/target/s390x/cpu_models.c @@ -425,7 +425,7 @@ static void create_cpu_model_list(ObjectClass *klass, v= oid *opaque) *cpu_list =3D entry; } =20 -CpuDefinitionInfoList *arch_query_cpu_definitions(Error **errp) +CpuDefinitionInfoList *qmp_query_cpu_definitions(Error **errp) { struct CpuDefinitionInfoListData list_data =3D { .list =3D NULL, diff --git a/stubs/Makefile.objs b/stubs/Makefile.objs index 1cd325841c..54f3e7e152 100644 --- a/stubs/Makefile.objs +++ b/stubs/Makefile.objs @@ -1,4 +1,3 @@ -stub-obj-y +=3D arch-query-cpu-def.o stub-obj-y +=3D bdrv-next-monitor-owned.o stub-obj-y +=3D blk-commit-all.o stub-obj-y +=3D blockdev-close-all-bdrv-states.o --=20 2.16.2.521.g9aa15f885a