From nobody Mon May 6 10:03:50 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zoho.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.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 209.51.188.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 (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1550499408900638.076241748141; Mon, 18 Feb 2019 06:16:48 -0800 (PST) Received: from localhost ([127.0.0.1]:59261 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1gvjir-00026m-VB for importer@patchew.org; Mon, 18 Feb 2019 09:16:43 -0500 Received: from eggs.gnu.org ([209.51.188.92]:60026) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1gvjYu-0001yI-Sw for qemu-devel@nongnu.org; Mon, 18 Feb 2019 09:06:34 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1gvjYm-0005SF-Nn for qemu-devel@nongnu.org; Mon, 18 Feb 2019 09:06:24 -0500 Received: from mx1.redhat.com ([209.132.183.28]:51760) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1gvjYm-0005OM-AF for qemu-devel@nongnu.org; Mon, 18 Feb 2019 09:06:16 -0500 Received: from smtp.corp.redhat.com (int-mx07.intmail.prod.int.phx2.redhat.com [10.5.11.22]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id B5325C068BF8 for ; Mon, 18 Feb 2019 14:06:09 +0000 (UTC) Received: from blackfin.pond.sub.org (ovpn-116-92.ams2.redhat.com [10.36.116.92]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 80711104811F for ; Mon, 18 Feb 2019 14:06:09 +0000 (UTC) Received: by blackfin.pond.sub.org (Postfix, from userid 1000) id 01C931138661; Mon, 18 Feb 2019 15:06:08 +0100 (CET) From: Markus Armbruster To: qemu-devel@nongnu.org Date: Mon, 18 Feb 2019 15:05:50 +0100 Message-Id: <20190218140607.31998-2-armbru@redhat.com> In-Reply-To: <20190218140607.31998-1-armbru@redhat.com> References: <20190218140607.31998-1-armbru@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.84 on 10.5.11.22 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.32]); Mon, 18 Feb 2019 14:06:09 +0000 (UTC) Content-Transfer-Encoding: quoted-printable X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 209.132.183.28 Subject: [Qemu-devel] [PULL 01/18] qapi: Belatedly document modular code generation 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: , Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" Content-Type: text/plain; charset="utf-8" We generate code for built-ins and sub-modules into separate files since commit cdb6610ae42 and 252dc3105fc (v2.12.0). Both commits neglected to update documentation. Do that now. Signed-off-by: Markus Armbruster Reviewed-by: Marc-Andr=C3=A9 Lureau Message-Id: <20190214152251.2073-2-armbru@redhat.com> --- docs/devel/qapi-code-gen.txt | 38 ++++++++++++++++++++++++++++++++++++ 1 file changed, 38 insertions(+) diff --git a/docs/devel/qapi-code-gen.txt b/docs/devel/qapi-code-gen.txt index 87183d3a09..b91bde647c 100644 --- a/docs/devel/qapi-code-gen.txt +++ b/docs/devel/qapi-code-gen.txt @@ -1113,6 +1113,19 @@ Example: =20 [Uninteresting stuff omitted...] =20 +For a modular QAPI schema (see section Include directives), code for +each sub-module SUBDIR/SUBMODULE.json is actually generated into + +SUBDIR/$(prefix)qapi-types-SUBMODULE.h +SUBDIR/$(prefix)qapi-types-SUBMODULE.c + +If qapi-gen.py is run with option --builtins, additional files are +created: + +qapi-builtin-types.h - C types corresponding to built-in types + +qapi-builtin-types.c - Cleanup functions for the above C types + =3D=3D=3D Code generated for visiting QAPI types =3D=3D=3D =20 These are the visitor functions used to walk through and convert @@ -1244,6 +1257,19 @@ Example: =20 [Uninteresting stuff omitted...] =20 +For a modular QAPI schema (see section Include directives), code for +each sub-module SUBDIR/SUBMODULE.json is actually generated into + +SUBDIR/$(prefix)qapi-visit-SUBMODULE.h +SUBDIR/$(prefix)qapi-visit-SUBMODULE.c + +If qapi-gen.py is run with option --builtins, additional files are +created: + +qapi-builtin-visit.h - Visitor functions for built-in types + +qapi-builtin-visit.c - Declarations for these visitor functions + =3D=3D=3D Code generated for commands =3D=3D=3D =20 These are the marshaling/dispatch functions for the commands defined @@ -1342,6 +1368,12 @@ Example: =20 [Uninteresting stuff omitted...] =20 +For a modular QAPI schema (see section Include directives), code for +each sub-module SUBDIR/SUBMODULE.json is actually generated into + +SUBDIR/$(prefix)qapi-commands-SUBMODULE.h +SUBDIR/$(prefix)qapi-commands-SUBMODULE.c + =3D=3D=3D Code generated for events =3D=3D=3D =20 This is the code related to events defined in the schema, providing @@ -1402,6 +1434,12 @@ Example: =20 [Uninteresting stuff omitted...] =20 +For a modular QAPI schema (see section Include directives), code for +each sub-module SUBDIR/SUBMODULE.json is actually generated into + +SUBDIR/$(prefix)qapi-events-SUBMODULE.h +SUBDIR/$(prefix)qapi-events-SUBMODULE.c + =3D=3D=3D Code generated for introspection =3D=3D=3D =20 The following files are created: --=20 2.17.2 From nobody Mon May 6 10:03:50 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zoho.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.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 209.51.188.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 (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1550499119810367.62895803088475; Mon, 18 Feb 2019 06:11:59 -0800 (PST) Received: from localhost ([127.0.0.1]:59180 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1gvjeC-0006IQ-Ky for importer@patchew.org; Mon, 18 Feb 2019 09:11:52 -0500 Received: from eggs.gnu.org ([209.51.188.92]:59905) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1gvjYn-0001qo-KB for qemu-devel@nongnu.org; Mon, 18 Feb 2019 09:06:19 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1gvjYm-0005R5-98 for qemu-devel@nongnu.org; Mon, 18 Feb 2019 09:06:17 -0500 Received: from mx1.redhat.com ([209.132.183.28]:2916) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1gvjYk-0005OK-7V for qemu-devel@nongnu.org; Mon, 18 Feb 2019 09:06:16 -0500 Received: from smtp.corp.redhat.com (int-mx06.intmail.prod.int.phx2.redhat.com [10.5.11.16]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id B2694D77F2 for ; Mon, 18 Feb 2019 14:06:09 +0000 (UTC) Received: from blackfin.pond.sub.org (ovpn-116-92.ams2.redhat.com [10.36.116.92]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 811215C1B2 for ; Mon, 18 Feb 2019 14:06:09 +0000 (UTC) Received: by blackfin.pond.sub.org (Postfix, from userid 1000) id 050FE11385D4; Mon, 18 Feb 2019 15:06:08 +0100 (CET) From: Markus Armbruster To: qemu-devel@nongnu.org Date: Mon, 18 Feb 2019 15:05:51 +0100 Message-Id: <20190218140607.31998-3-armbru@redhat.com> In-Reply-To: <20190218140607.31998-1-armbru@redhat.com> References: <20190218140607.31998-1-armbru@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.16 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.38]); Mon, 18 Feb 2019 14:06:09 +0000 (UTC) Content-Transfer-Encoding: quoted-printable X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 209.132.183.28 Subject: [Qemu-devel] [PULL 02/18] qapi: Fix up documentation for recent commit a95291007b2 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: , Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" Content-Type: text/plain; charset="utf-8" Signed-off-by: Markus Armbruster Reviewed-by: Marc-Andr=C3=A9 Lureau Message-Id: <20190214152251.2073-3-armbru@redhat.com> --- docs/devel/qapi-code-gen.txt | 2 ++ 1 file changed, 2 insertions(+) diff --git a/docs/devel/qapi-code-gen.txt b/docs/devel/qapi-code-gen.txt index b91bde647c..c9ba8ddb2e 100644 --- a/docs/devel/qapi-code-gen.txt +++ b/docs/devel/qapi-code-gen.txt @@ -1410,6 +1410,8 @@ Example: =20 extern const QEnumLookup example_QAPIEvent_lookup; =20 + void example_qapi_event_emit(example_QAPIEvent event, QDict *qdict); + #endif /* EXAMPLE_QAPI_EVENTS_H */ $ cat qapi-generated/example-qapi-events.c [Uninteresting stuff omitted...] --=20 2.17.2 From nobody Mon May 6 10:03:50 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zoho.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.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 209.51.188.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 (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1550500219324546.3007174711021; Mon, 18 Feb 2019 06:30:19 -0800 (PST) Received: from localhost ([127.0.0.1]:59436 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1gvjvx-0004Gi-8l for importer@patchew.org; Mon, 18 Feb 2019 09:30:13 -0500 Received: from eggs.gnu.org ([209.51.188.92]:60028) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1gvjYu-0001yL-TS for qemu-devel@nongnu.org; Mon, 18 Feb 2019 09:06:29 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1gvjYm-0005SU-R5 for qemu-devel@nongnu.org; Mon, 18 Feb 2019 09:06:24 -0500 Received: from mx1.redhat.com ([209.132.183.28]:39348) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1gvjYm-0005OW-BH for qemu-devel@nongnu.org; Mon, 18 Feb 2019 09:06:16 -0500 Received: from smtp.corp.redhat.com (int-mx05.intmail.prod.int.phx2.redhat.com [10.5.11.15]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id E22551301A5 for ; Mon, 18 Feb 2019 14:06:09 +0000 (UTC) Received: from blackfin.pond.sub.org (ovpn-116-92.ams2.redhat.com [10.36.116.92]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 849405D717 for ; Mon, 18 Feb 2019 14:06:09 +0000 (UTC) Received: by blackfin.pond.sub.org (Postfix, from userid 1000) id 08C7911385D5; Mon, 18 Feb 2019 15:06:08 +0100 (CET) From: Markus Armbruster To: qemu-devel@nongnu.org Date: Mon, 18 Feb 2019 15:05:52 +0100 Message-Id: <20190218140607.31998-4-armbru@redhat.com> In-Reply-To: <20190218140607.31998-1-armbru@redhat.com> References: <20190218140607.31998-1-armbru@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.15 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.39]); Mon, 18 Feb 2019 14:06:09 +0000 (UTC) Content-Transfer-Encoding: quoted-printable X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 209.132.183.28 Subject: [Qemu-devel] [PULL 03/18] qapi: Clean up modular built-in code generation a bit 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: , Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" Content-Type: text/plain; charset="utf-8" We neglect to call .visit_module() for the special module we use for built-ins. Harmless, but clean it up anyway. The tests/qapi-schema/*.out now show the built-in module as 'module None'. Subclasses of QAPISchemaModularCVisitor need to ._add_module() this special module to enable code generation for built-ins. When this hasn't been done, QAPISchemaModularCVisitor.visit_module() does nothing for the special module. That looks like built-ins could accidentally be generated into the wrong module when a subclass neglects to call ._add_module(). Can't happen, because built-ins are all visited before any other module. But that's non-obvious. Switch off code generation explicitly. Rename QAPISchemaModularCVisitor._begin_module() to ._begin_user_module(). New QAPISchemaModularCVisitor._is_builtin_module(), for clarity. Signed-off-by: Markus Armbruster Reviewed-by: Marc-Andr=C3=A9 Lureau Message-Id: <20190214152251.2073-4-armbru@redhat.com> --- scripts/qapi/commands.py | 2 +- scripts/qapi/common.py | 24 ++++++++++++++++++------ scripts/qapi/events.py | 2 +- scripts/qapi/types.py | 2 +- scripts/qapi/visit.py | 2 +- tests/qapi-schema/comments.out | 1 + tests/qapi-schema/doc-bad-section.out | 1 + tests/qapi-schema/doc-good.out | 1 + tests/qapi-schema/empty.out | 1 + tests/qapi-schema/event-case.out | 1 + tests/qapi-schema/ident-with-escape.out | 1 + tests/qapi-schema/include-relpath.out | 1 + tests/qapi-schema/include-repetition.out | 1 + tests/qapi-schema/include-simple.out | 1 + tests/qapi-schema/indented-expr.out | 1 + tests/qapi-schema/qapi-schema-test.out | 1 + 16 files changed, 33 insertions(+), 10 deletions(-) diff --git a/scripts/qapi/commands.py b/scripts/qapi/commands.py index 0f3c991918..ebf488953d 100644 --- a/scripts/qapi/commands.py +++ b/scripts/qapi/commands.py @@ -242,7 +242,7 @@ class QAPISchemaGenCommandVisitor(QAPISchemaModularCVis= itor): self._regy =3D QAPIGenCCode() self._visited_ret_types =3D {} =20 - def _begin_module(self, name): + def _begin_user_module(self, name): self._visited_ret_types[self._genc] =3D set() commands =3D self._module_basename('qapi-commands', name) types =3D self._module_basename('qapi-types', name) diff --git a/scripts/qapi/common.py b/scripts/qapi/common.py index c89edc0cb0..0e3ec598a4 100644 --- a/scripts/qapi/common.py +++ b/scripts/qapi/common.py @@ -1868,6 +1868,7 @@ class QAPISchema(object): def visit(self, visitor): visitor.visit_begin(self) module =3D None + visitor.visit_module(module) for entity in self._entity_list: if visitor.visit_needed(entity): if entity.module !=3D module: @@ -2321,9 +2322,15 @@ class QAPISchemaModularCVisitor(QAPISchemaVisitor): self._what =3D what self._blurb =3D blurb self._pydoc =3D pydoc + self._genc =3D None + self._genh =3D None self._module =3D {} self._main_module =3D None =20 + @staticmethod + def _is_builtin_module(name): + return not name + def _module_basename(self, what, name): if name is None: return re.sub(r'-', '-builtin-', what) @@ -2334,7 +2341,7 @@ class QAPISchemaModularCVisitor(QAPISchemaVisitor): return basename + '-' + os.path.splitext(os.path.basename(name))[0] =20 def _add_module(self, name, blurb): - if self._main_module is None and name is not None: + if self._main_module is None and not self._is_builtin_module(name): self._main_module =3D name genc =3D QAPIGenC(blurb, self._pydoc) genh =3D QAPIGenH(blurb, self._pydoc) @@ -2346,22 +2353,27 @@ class QAPISchemaModularCVisitor(QAPISchemaVisitor): =20 def write(self, output_dir, opt_builtins=3DFalse): for name in self._module: - if name is None and not opt_builtins: + if self._is_builtin_module(name) and not opt_builtins: continue basename =3D self._module_basename(self._what, name) (genc, genh) =3D self._module[name] genc.write(output_dir, basename + '.c') genh.write(output_dir, basename + '.h') =20 - def _begin_module(self, name): + def _begin_user_module(self, name): pass =20 def visit_module(self, name): if name in self._module: self._set_module(name) - return - self._add_module(name, self._blurb) - self._begin_module(name) + elif self._is_builtin_module(name): + # The built-in module has not been created. No code may + # be generated. + self._genc =3D None + self._genh =3D None + else: + self._add_module(name, self._blurb) + self._begin_user_module(name) =20 def visit_include(self, name, info): basename =3D self._module_basename(self._what, name) diff --git a/scripts/qapi/events.py b/scripts/qapi/events.py index d86a2d2b3e..6f39cf8196 100644 --- a/scripts/qapi/events.py +++ b/scripts/qapi/events.py @@ -142,7 +142,7 @@ class QAPISchemaGenEventVisitor(QAPISchemaModularCVisit= or): self._event_enum_members =3D [] self._event_emit_name =3D c_name(prefix + 'qapi_event_emit') =20 - def _begin_module(self, name): + def _begin_user_module(self, name): types =3D self._module_basename('qapi-types', name) visit =3D self._module_basename('qapi-visit', name) self._genc.add(mcgen(''' diff --git a/scripts/qapi/types.py b/scripts/qapi/types.py index 62d4cf9f95..9fa510f7df 100644 --- a/scripts/qapi/types.py +++ b/scripts/qapi/types.py @@ -194,7 +194,7 @@ class QAPISchemaGenTypeVisitor(QAPISchemaModularCVisito= r): #include "qapi/util.h" ''')) =20 - def _begin_module(self, name): + def _begin_user_module(self, name): types =3D self._module_basename('qapi-types', name) visit =3D self._module_basename('qapi-visit', name) self._genc.preamble_add(mcgen(''' diff --git a/scripts/qapi/visit.py b/scripts/qapi/visit.py index 82eab72b21..ca86009398 100644 --- a/scripts/qapi/visit.py +++ b/scripts/qapi/visit.py @@ -298,7 +298,7 @@ class QAPISchemaGenVisitVisitor(QAPISchemaModularCVisit= or): ''', prefix=3Dprefix)) =20 - def _begin_module(self, name): + def _begin_user_module(self, name): types =3D self._module_basename('qapi-types', name) visit =3D self._module_basename('qapi-visit', name) self._genc.preamble_add(mcgen(''' diff --git a/tests/qapi-schema/comments.out b/tests/qapi-schema/comments.out index d1abc4b5a1..273f0f54e1 100644 --- a/tests/qapi-schema/comments.out +++ b/tests/qapi-schema/comments.out @@ -1,3 +1,4 @@ +module None object q_empty enum QType prefix QTYPE diff --git a/tests/qapi-schema/doc-bad-section.out b/tests/qapi-schema/doc-= bad-section.out index db8014eed0..367e2a1c3e 100644 --- a/tests/qapi-schema/doc-bad-section.out +++ b/tests/qapi-schema/doc-bad-section.out @@ -1,3 +1,4 @@ +module None object q_empty enum QType prefix QTYPE diff --git a/tests/qapi-schema/doc-good.out b/tests/qapi-schema/doc-good.out index 21bf345ff0..d3bca343eb 100644 --- a/tests/qapi-schema/doc-good.out +++ b/tests/qapi-schema/doc-good.out @@ -1,3 +1,4 @@ +module None object q_empty enum QType prefix QTYPE diff --git a/tests/qapi-schema/empty.out b/tests/qapi-schema/empty.out index 5483cb7bc6..5b53d00702 100644 --- a/tests/qapi-schema/empty.out +++ b/tests/qapi-schema/empty.out @@ -1,3 +1,4 @@ +module None object q_empty enum QType prefix QTYPE diff --git a/tests/qapi-schema/event-case.out b/tests/qapi-schema/event-cas= e.out index f69d4ffe4e..ec8a1406e4 100644 --- a/tests/qapi-schema/event-case.out +++ b/tests/qapi-schema/event-case.out @@ -1,3 +1,4 @@ +module None object q_empty enum QType prefix QTYPE diff --git a/tests/qapi-schema/ident-with-escape.out b/tests/qapi-schema/id= ent-with-escape.out index 7f891f7e90..39754eba8c 100644 --- a/tests/qapi-schema/ident-with-escape.out +++ b/tests/qapi-schema/ident-with-escape.out @@ -1,3 +1,4 @@ +module None object q_empty enum QType prefix QTYPE diff --git a/tests/qapi-schema/include-relpath.out b/tests/qapi-schema/incl= ude-relpath.out index 783ccfc855..cf8636b78f 100644 --- a/tests/qapi-schema/include-relpath.out +++ b/tests/qapi-schema/include-relpath.out @@ -1,3 +1,4 @@ +module None object q_empty enum QType prefix QTYPE diff --git a/tests/qapi-schema/include-repetition.out b/tests/qapi-schema/i= nclude-repetition.out index d45977ee56..5423983239 100644 --- a/tests/qapi-schema/include-repetition.out +++ b/tests/qapi-schema/include-repetition.out @@ -1,3 +1,4 @@ +module None object q_empty enum QType prefix QTYPE diff --git a/tests/qapi-schema/include-simple.out b/tests/qapi-schema/inclu= de-simple.out index 1afe20802a..061f81e509 100644 --- a/tests/qapi-schema/include-simple.out +++ b/tests/qapi-schema/include-simple.out @@ -1,3 +1,4 @@ +module None object q_empty enum QType prefix QTYPE diff --git a/tests/qapi-schema/indented-expr.out b/tests/qapi-schema/indent= ed-expr.out index c0cf3243f3..bffdf6756d 100644 --- a/tests/qapi-schema/indented-expr.out +++ b/tests/qapi-schema/indented-expr.out @@ -1,3 +1,4 @@ +module None object q_empty enum QType prefix QTYPE diff --git a/tests/qapi-schema/qapi-schema-test.out b/tests/qapi-schema/qap= i-schema-test.out index 9464101d26..d8aec17115 100644 --- a/tests/qapi-schema/qapi-schema-test.out +++ b/tests/qapi-schema/qapi-schema-test.out @@ -1,3 +1,4 @@ +module None object q_empty enum QType prefix QTYPE --=20 2.17.2 From nobody Mon May 6 10:03:50 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zoho.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.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 209.51.188.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 (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1550499478936854.5356117513936; Mon, 18 Feb 2019 06:17:58 -0800 (PST) Received: from localhost ([127.0.0.1]:59265 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1gvjk0-0002y4-F4 for importer@patchew.org; Mon, 18 Feb 2019 09:17:52 -0500 Received: from eggs.gnu.org ([209.51.188.92]:60013) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1gvjYu-0001yA-S7 for qemu-devel@nongnu.org; Mon, 18 Feb 2019 09:06:26 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1gvjYm-0005Rc-EU for qemu-devel@nongnu.org; Mon, 18 Feb 2019 09:06:24 -0500 Received: from mx1.redhat.com ([209.132.183.28]:51766) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1gvjYk-0005OU-7A for qemu-devel@nongnu.org; Mon, 18 Feb 2019 09:06:16 -0500 Received: from smtp.corp.redhat.com (int-mx01.intmail.prod.int.phx2.redhat.com [10.5.11.11]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id E2162C0BF2BD for ; Mon, 18 Feb 2019 14:06:09 +0000 (UTC) Received: from blackfin.pond.sub.org (ovpn-116-92.ams2.redhat.com [10.36.116.92]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 867F7600C8 for ; Mon, 18 Feb 2019 14:06:09 +0000 (UTC) Received: by blackfin.pond.sub.org (Postfix, from userid 1000) id 0C59811384DA; Mon, 18 Feb 2019 15:06:08 +0100 (CET) From: Markus Armbruster To: qemu-devel@nongnu.org Date: Mon, 18 Feb 2019 15:05:53 +0100 Message-Id: <20190218140607.31998-5-armbru@redhat.com> In-Reply-To: <20190218140607.31998-1-armbru@redhat.com> References: <20190218140607.31998-1-armbru@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.11 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.32]); Mon, 18 Feb 2019 14:06:09 +0000 (UTC) Content-Transfer-Encoding: quoted-printable X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 209.132.183.28 Subject: [Qemu-devel] [PULL 04/18] qapi: Prepare for system modules other than 'builtin' 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: , Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" Content-Type: text/plain; charset="utf-8" The next commit wants to generate qapi-emit-events.{c.h}. To enable that, extend QAPISchemaModularCVisitor to support additional "system modules", i.e. modules that don't correspond to a (user-defined) QAPI schema module. Signed-off-by: Markus Armbruster Reviewed-by: Marc-Andr=C3=A9 Lureau Message-Id: <20190214152251.2073-5-armbru@redhat.com> --- scripts/qapi/common.py | 35 +++++++++++++++++++++++++---------- scripts/qapi/types.py | 2 +- scripts/qapi/visit.py | 2 +- 3 files changed, 27 insertions(+), 12 deletions(-) diff --git a/scripts/qapi/common.py b/scripts/qapi/common.py index 0e3ec598a4..c327ae5036 100644 --- a/scripts/qapi/common.py +++ b/scripts/qapi/common.py @@ -2327,27 +2327,42 @@ class QAPISchemaModularCVisitor(QAPISchemaVisitor): self._module =3D {} self._main_module =3D None =20 + @staticmethod + def _is_user_module(name): + return name and not name.startswith('./') + @staticmethod def _is_builtin_module(name): return not name =20 def _module_basename(self, what, name): - if name is None: - return re.sub(r'-', '-builtin-', what) - basename =3D os.path.join(os.path.dirname(name), - self._prefix + what) - if name =3D=3D self._main_module: - return basename - return basename + '-' + os.path.splitext(os.path.basename(name))[0] + ret =3D '' if self._is_builtin_module(name) else self._prefix + if self._is_user_module(name): + dirname, basename =3D os.path.split(name) + ret +=3D what + if name !=3D self._main_module: + ret +=3D '-' + os.path.splitext(basename)[0] + ret =3D os.path.join(dirname, ret) + else: + name =3D name[2:] if name else 'builtin' + ret +=3D re.sub(r'-', '-' + name + '-', what) + return ret =20 def _add_module(self, name, blurb): - if self._main_module is None and not self._is_builtin_module(name): - self._main_module =3D name genc =3D QAPIGenC(blurb, self._pydoc) genh =3D QAPIGenH(blurb, self._pydoc) self._module[name] =3D (genc, genh) self._set_module(name) =20 + def _add_user_module(self, name, blurb): + assert self._is_user_module(name) + if self._main_module is None: + self._main_module =3D name + self._add_module(name, blurb) + + def _add_system_module(self, name, blurb): + self._add_module(name and './' + name, blurb) + def _set_module(self, name): self._genc, self._genh =3D self._module[name] =20 @@ -2372,7 +2387,7 @@ class QAPISchemaModularCVisitor(QAPISchemaVisitor): self._genc =3D None self._genh =3D None else: - self._add_module(name, self._blurb) + self._add_user_module(name, self._blurb) self._begin_user_module(name) =20 def visit_include(self, name, info): diff --git a/scripts/qapi/types.py b/scripts/qapi/types.py index 9fa510f7df..2bd6fcd44f 100644 --- a/scripts/qapi/types.py +++ b/scripts/qapi/types.py @@ -183,7 +183,7 @@ class QAPISchemaGenTypeVisitor(QAPISchemaModularCVisito= r): QAPISchemaModularCVisitor.__init__( self, prefix, 'qapi-types', ' * Schema-defined QAPI types', __doc__) - self._add_module(None, ' * Built-in QAPI types') + self._add_system_module(None, ' * Built-in QAPI types') self._genc.preamble_add(mcgen(''' #include "qemu/osdep.h" #include "qapi/dealloc-visitor.h" diff --git a/scripts/qapi/visit.py b/scripts/qapi/visit.py index ca86009398..826b8066e1 100644 --- a/scripts/qapi/visit.py +++ b/scripts/qapi/visit.py @@ -284,7 +284,7 @@ class QAPISchemaGenVisitVisitor(QAPISchemaModularCVisit= or): QAPISchemaModularCVisitor.__init__( self, prefix, 'qapi-visit', ' * Schema-defined QAPI visitors', __doc__) - self._add_module(None, ' * Built-in QAPI visitors') + self._add_system_module(None, ' * Built-in QAPI visitors') self._genc.preamble_add(mcgen(''' #include "qemu/osdep.h" #include "qemu-common.h" --=20 2.17.2 From nobody Mon May 6 10:03:50 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zoho.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.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 209.51.188.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 (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1550499232202644.0616816864753; Mon, 18 Feb 2019 06:13:52 -0800 (PST) Received: from localhost ([127.0.0.1]:59206 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1gvjg5-0007xG-4A for importer@patchew.org; Mon, 18 Feb 2019 09:13:49 -0500 Received: from eggs.gnu.org ([209.51.188.92]:60011) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1gvjYu-0001y9-RV for qemu-devel@nongnu.org; Mon, 18 Feb 2019 09:06:32 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1gvjYm-0005S9-N7 for qemu-devel@nongnu.org; Mon, 18 Feb 2019 09:06:24 -0500 Received: from mx1.redhat.com ([209.132.183.28]:29471) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1gvjYm-0005P5-9Z for qemu-devel@nongnu.org; Mon, 18 Feb 2019 09:06:16 -0500 Received: from smtp.corp.redhat.com (int-mx01.intmail.prod.int.phx2.redhat.com [10.5.11.11]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 5F49587622 for ; Mon, 18 Feb 2019 14:06:11 +0000 (UTC) Received: from blackfin.pond.sub.org (ovpn-116-92.ams2.redhat.com [10.36.116.92]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 029A26013D for ; Mon, 18 Feb 2019 14:06:11 +0000 (UTC) Received: by blackfin.pond.sub.org (Postfix, from userid 1000) id 0FD711133040; Mon, 18 Feb 2019 15:06:08 +0100 (CET) From: Markus Armbruster To: qemu-devel@nongnu.org Date: Mon, 18 Feb 2019 15:05:54 +0100 Message-Id: <20190218140607.31998-6-armbru@redhat.com> In-Reply-To: <20190218140607.31998-1-armbru@redhat.com> References: <20190218140607.31998-1-armbru@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.11 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.26]); Mon, 18 Feb 2019 14:06:11 +0000 (UTC) Content-Transfer-Encoding: quoted-printable X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 209.132.183.28 Subject: [Qemu-devel] [PULL 05/18] qapi: Generate QAPIEvent stuff into separate files 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: , Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" Content-Type: text/plain; charset="utf-8" Having to include qapi-events.h just for QAPIEvent is suboptimal, but quite tolerable now. It'll become problematic when we have events conditional on the target, because then qapi-events.h won't be usable from target-independent code anymore. Avoid that by generating it into separate files. Signed-off-by: Markus Armbruster Reviewed-by: Marc-Andr=C3=A9 Lureau Message-Id: <20190214152251.2073-6-armbru@redhat.com> --- .gitignore | 1 + Makefile | 1 + Makefile.objs | 1 + docs/devel/qapi-code-gen.txt | 48 ++++++++++++++++++++++++------------ monitor.c | 2 +- scripts/qapi/events.py | 32 +++++++++++++++--------- stubs/monitor.c | 2 +- tests/test-qmp-event.c | 1 + ui/vnc.c | 3 ++- 9 files changed, 61 insertions(+), 30 deletions(-) diff --git a/.gitignore b/.gitignore index 321095bf1a..b66b772551 100644 --- a/.gitignore +++ b/.gitignore @@ -32,6 +32,7 @@ /qapi/qapi-builtin-visit.[ch] /qapi/qapi-commands-*.[ch] /qapi/qapi-commands.[ch] +/qapi/qapi-emit-events.[ch] /qapi/qapi-events-*.[ch] /qapi/qapi-events.[ch] /qapi/qapi-introspect.[ch] diff --git a/Makefile b/Makefile index 3658310b95..53d161b65f 100644 --- a/Makefile +++ b/Makefile @@ -101,6 +101,7 @@ GENERATED_QAPI_FILES +=3D $(QAPI_MODULES:%=3Dqapi/qapi-= visit-%.c) GENERATED_QAPI_FILES +=3D qapi/qapi-commands.h qapi/qapi-commands.c GENERATED_QAPI_FILES +=3D $(QAPI_MODULES:%=3Dqapi/qapi-commands-%.h) GENERATED_QAPI_FILES +=3D $(QAPI_MODULES:%=3Dqapi/qapi-commands-%.c) +GENERATED_QAPI_FILES +=3D qapi/qapi-emit-events.h qapi/qapi-emit-events.c GENERATED_QAPI_FILES +=3D qapi/qapi-events.h qapi/qapi-events.c GENERATED_QAPI_FILES +=3D $(QAPI_MODULES:%=3Dqapi/qapi-events-%.h) GENERATED_QAPI_FILES +=3D $(QAPI_MODULES:%=3Dqapi/qapi-events-%.c) diff --git a/Makefile.objs b/Makefile.objs index b7aae33367..ec11a0f55b 100644 --- a/Makefile.objs +++ b/Makefile.objs @@ -12,6 +12,7 @@ util-obj-y +=3D $(QAPI_MODULES:%=3Dqapi/qapi-types-%.o) util-obj-y +=3D qapi/qapi-builtin-visit.o util-obj-y +=3D qapi/qapi-visit.o util-obj-y +=3D $(QAPI_MODULES:%=3Dqapi/qapi-visit-%.o) +util-obj-y +=3D qapi/qapi-emit-events.o util-obj-y +=3D qapi/qapi-events.o util-obj-y +=3D $(QAPI_MODULES:%=3Dqapi/qapi-events-%.o) util-obj-y +=3D qapi/qapi-introspect.o diff --git a/docs/devel/qapi-code-gen.txt b/docs/devel/qapi-code-gen.txt index c9ba8ddb2e..b517b0cfbf 100644 --- a/docs/devel/qapi-code-gen.txt +++ b/docs/devel/qapi-code-gen.txt @@ -1381,11 +1381,15 @@ qapi_event_send_EVENT(). =20 The following files are created: =20 -$(prefix)qapi-events.h - Function prototypes for each event type, plus an - enumeration of all event names +$(prefix)qapi-events.h - Function prototypes for each event type =20 $(prefix)qapi-events.c - Implementation of functions to send an event =20 +$(prefix)qapi-emit-events.h - Enumeration of all event names, and + common event code declarations + +$(prefix)qapi-emit-events.c - Common event code definitions + Example: =20 $ cat qapi-generated/example-qapi-events.h @@ -1397,9 +1401,32 @@ Example: #include "qapi/util.h" #include "example-qapi-types.h" =20 - void qapi_event_send_my_event(void); =20 + #endif /* EXAMPLE_QAPI_EVENTS_H */ + $ cat qapi-generated/example-qapi-events.c +[Uninteresting stuff omitted...] + + void qapi_event_send_my_event(void) + { + QDict *qmp; + + qmp =3D qmp_event_build_dict("MY_EVENT"); + + example_qapi_event_emit(EXAMPLE_QAPI_EVENT_MY_EVENT, qmp); + + qobject_unref(qmp); + } + +[Uninteresting stuff omitted...] + $ cat qapi-generated/example-qapi-emit-events.h +[Uninteresting stuff omitted...] + + #ifndef EXAMPLE_QAPI_EMIT_EVENTS_H + #define EXAMPLE_QAPI_EMIT_EVENTS_H + + #include "qapi/util.h" + typedef enum example_QAPIEvent { EXAMPLE_QAPI_EVENT_MY_EVENT, EXAMPLE_QAPI_EVENT__MAX, @@ -1412,21 +1439,10 @@ Example: =20 void example_qapi_event_emit(example_QAPIEvent event, QDict *qdict); =20 - #endif /* EXAMPLE_QAPI_EVENTS_H */ - $ cat qapi-generated/example-qapi-events.c + #endif /* EXAMPLE_QAPI_EMIT_EVENTS_H */ + $ cat qapi-generated/example-qapi-emit-events.c [Uninteresting stuff omitted...] =20 - void qapi_event_send_my_event(void) - { - QDict *qmp; - - qmp =3D qmp_event_build_dict("MY_EVENT"); - - example_qapi_event_emit(EXAMPLE_QAPI_EVENT_MY_EVENT, qmp); - - qobject_unref(qmp); - } - const QEnumLookup example_QAPIEvent_lookup =3D { .array =3D (const char *const[]) { [EXAMPLE_QAPI_EVENT_MY_EVENT] =3D "MY_EVENT", diff --git a/monitor.c b/monitor.c index e5de5765b8..8e02a001a3 100644 --- a/monitor.c +++ b/monitor.c @@ -75,7 +75,7 @@ #include "qemu/thread.h" #include "block/qapi.h" #include "qapi/qapi-commands.h" -#include "qapi/qapi-events.h" +#include "qapi/qapi-emit-events.h" #include "qapi/error.h" #include "qapi/qmp-event.h" #include "qapi/qapi-introspect.h" diff --git a/scripts/qapi/events.py b/scripts/qapi/events.py index 6f39cf8196..28bbc3745d 100644 --- a/scripts/qapi/events.py +++ b/scripts/qapi/events.py @@ -143,12 +143,14 @@ class QAPISchemaGenEventVisitor(QAPISchemaModularCVis= itor): self._event_emit_name =3D c_name(prefix + 'qapi_event_emit') =20 def _begin_user_module(self, name): + events =3D self._module_basename('qapi-events', name) types =3D self._module_basename('qapi-types', name) visit =3D self._module_basename('qapi-visit', name) self._genc.add(mcgen(''' #include "qemu/osdep.h" #include "qemu-common.h" -#include "%(prefix)sqapi-events.h" +#include "%(prefix)sqapi-emit-events.h" +#include "%(events)s.h" #include "%(visit)s.h" #include "qapi/error.h" #include "qapi/qmp/qdict.h" @@ -156,26 +158,34 @@ class QAPISchemaGenEventVisitor(QAPISchemaModularCVis= itor): #include "qapi/qmp-event.h" =20 ''', - visit=3Dvisit, prefix=3Dself._prefix)) + events=3Devents, visit=3Dvisit, + prefix=3Dself._prefix)) self._genh.add(mcgen(''' #include "qapi/util.h" #include "%(types)s.h" - ''', types=3Dtypes)) =20 def visit_end(self): - (genc, genh) =3D self._module[self._main_module] - genh.add(gen_enum(self._event_enum_name, - self._event_enum_members)) - genc.add(gen_enum_lookup(self._event_enum_name, - self._event_enum_members)) - genh.add(mcgen(''' + self._add_system_module('emit', ' * QAPI Events emission') + self._genc.preamble_add(mcgen(''' +#include "qemu/osdep.h" +#include "%(prefix)sqapi-emit-events.h" +''', + prefix=3Dself._prefix)) + self._genh.preamble_add(mcgen(''' +#include "qapi/util.h" +''')) + self._genh.add(gen_enum(self._event_enum_name, + self._event_enum_members)) + self._genc.add(gen_enum_lookup(self._event_enum_name, + self._event_enum_members)) + self._genh.add(mcgen(''' =20 void %(event_emit)s(%(event_enum)s event, QDict *qdict); ''', - event_emit=3Dself._event_emit_name, - event_enum=3Dself._event_enum_name)) + event_emit=3Dself._event_emit_name, + event_enum=3Dself._event_enum_name)) =20 def visit_event(self, name, info, ifcond, arg_type, boxed): with ifcontext(ifcond, self._genh, self._genc): diff --git a/stubs/monitor.c b/stubs/monitor.c index 32bd7012c3..b57fe6c32f 100644 --- a/stubs/monitor.c +++ b/stubs/monitor.c @@ -1,6 +1,6 @@ #include "qemu/osdep.h" #include "qapi/error.h" -#include "qapi/qapi-events.h" +#include "qapi/qapi-emit-events.h" #include "qemu-common.h" #include "monitor/monitor.h" =20 diff --git a/tests/test-qmp-event.c b/tests/test-qmp-event.c index bf900f14f4..eee7e08ab6 100644 --- a/tests/test-qmp-event.c +++ b/tests/test-qmp-event.c @@ -21,6 +21,7 @@ #include "qapi/qmp/qstring.h" #include "qapi/qmp-event.h" #include "test-qapi-events.h" +#include "test-qapi-emit-events.h" =20 typedef struct TestEventData { QDict *expect; diff --git a/ui/vnc.c b/ui/vnc.c index 0fef646fc4..7e0710ed8f 100644 --- a/ui/vnc.c +++ b/ui/vnc.c @@ -35,7 +35,8 @@ #include "qemu/timer.h" #include "qemu/acl.h" #include "qemu/config-file.h" -#include "qapi/qapi-events.h" +#include "qapi/qapi-emit-events.h" +#include "qapi/qapi-events-ui.h" #include "qapi/error.h" #include "qapi/qapi-commands-ui.h" #include "ui/input.h" --=20 2.17.2 From nobody Mon May 6 10:03:50 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zoho.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.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 209.51.188.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 (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 155049985788248.259317523968775; Mon, 18 Feb 2019 06:24:17 -0800 (PST) Received: from localhost ([127.0.0.1]:59347 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1gvjq9-0007gI-LP for importer@patchew.org; Mon, 18 Feb 2019 09:24:13 -0500 Received: from eggs.gnu.org ([209.51.188.92]:60009) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1gvjYu-0001y3-Qi for qemu-devel@nongnu.org; Mon, 18 Feb 2019 09:06:26 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1gvjYm-0005RM-Du for qemu-devel@nongnu.org; Mon, 18 Feb 2019 09:06:24 -0500 Received: from mx1.redhat.com ([209.132.183.28]:39424) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1gvjYk-0005Oz-AB for qemu-devel@nongnu.org; Mon, 18 Feb 2019 09:06:16 -0500 Received: from smtp.corp.redhat.com (int-mx01.intmail.prod.int.phx2.redhat.com [10.5.11.11]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 395781314EA for ; Mon, 18 Feb 2019 14:06:11 +0000 (UTC) Received: from blackfin.pond.sub.org (ovpn-116-92.ams2.redhat.com [10.36.116.92]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 029286013C; Mon, 18 Feb 2019 14:06:11 +0000 (UTC) Received: by blackfin.pond.sub.org (Postfix, from userid 1000) id 1348E1133056; Mon, 18 Feb 2019 15:06:08 +0100 (CET) From: Markus Armbruster To: qemu-devel@nongnu.org Date: Mon, 18 Feb 2019 15:05:55 +0100 Message-Id: <20190218140607.31998-7-armbru@redhat.com> In-Reply-To: <20190218140607.31998-1-armbru@redhat.com> References: <20190218140607.31998-1-armbru@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.11 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.39]); Mon, 18 Feb 2019 14:06:11 +0000 (UTC) Content-Transfer-Encoding: quoted-printable X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 209.132.183.28 Subject: [Qemu-devel] [PULL 06/18] build-sys: move qmp-introspect per target 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?= Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" Content-Type: text/plain; charset="utf-8" From: Marc-Andr=C3=A9 Lureau The following patches are going to introduce per-target #ifdef in the schemas. The introspection data is statically generated once, and must thus be built per-target to reflect target-specific configuration. Drop "do_test_visitor_in_qmp_introspect(&qmp_schema_qlit)" since the schema is no longer in a common object. It is covered by the per-target query-qmp-schema test instead. Signed-off-by: Marc-Andr=C3=A9 Lureau Reviewed-by: Markus Armbruster Signed-off-by: Markus Armbruster Message-Id: <20190214152251.2073-7-armbru@redhat.com> --- Makefile.objs | 2 -- Makefile.target | 2 ++ tests/test-qobject-input-visitor.c | 1 - 3 files changed, 2 insertions(+), 3 deletions(-) diff --git a/Makefile.objs b/Makefile.objs index ec11a0f55b..bc78e26f55 100644 --- a/Makefile.objs +++ b/Makefile.objs @@ -15,7 +15,6 @@ util-obj-y +=3D $(QAPI_MODULES:%=3Dqapi/qapi-visit-%.o) util-obj-y +=3D qapi/qapi-emit-events.o util-obj-y +=3D qapi/qapi-events.o util-obj-y +=3D $(QAPI_MODULES:%=3Dqapi/qapi-events-%.o) -util-obj-y +=3D qapi/qapi-introspect.o =20 chardev-obj-y =3D chardev/ slirp-obj-$(CONFIG_SLIRP) =3D slirp/ @@ -95,7 +94,6 @@ common-obj-$(CONFIG_FDT) +=3D device_tree.o =20 common-obj-y +=3D qapi/qapi-commands.o common-obj-y +=3D $(QAPI_MODULES:%=3Dqapi/qapi-commands-%.o) -common-obj-y +=3D qapi/qapi-introspect.o common-obj-y +=3D qmp.o hmp.o endif =20 diff --git a/Makefile.target b/Makefile.target index 401dc1ea6f..d8af835890 100644 --- a/Makefile.target +++ b/Makefile.target @@ -164,6 +164,8 @@ endif =20 GENERATED_FILES +=3D hmp-commands.h hmp-commands-info.h =20 +obj-y +=3D qapi/qapi-introspect.o + endif # CONFIG_SOFTMMU =20 dummy :=3D $(call unnest-vars,,obj-y) diff --git a/tests/test-qobject-input-visitor.c b/tests/test-qobject-input-= visitor.c index caa90b3d7e..609334adf6 100644 --- a/tests/test-qobject-input-visitor.c +++ b/tests/test-qobject-input-visitor.c @@ -1271,7 +1271,6 @@ static void test_visitor_in_qmp_introspect(TestInputV= isitorData *data, const void *unused) { do_test_visitor_in_qmp_introspect(data, &test_qmp_schema_qlit); - do_test_visitor_in_qmp_introspect(data, &qmp_schema_qlit); } =20 int main(int argc, char **argv) --=20 2.17.2 From nobody Mon May 6 10:03:50 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zoho.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.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 209.51.188.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 (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1550499675373137.51733664811047; Mon, 18 Feb 2019 06:21:15 -0800 (PST) Received: from localhost ([127.0.0.1]:59319 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1gvjnD-0005LK-9i for importer@patchew.org; Mon, 18 Feb 2019 09:21:11 -0500 Received: from eggs.gnu.org ([209.51.188.92]:60024) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1gvjYu-0001yG-Sw for qemu-devel@nongnu.org; Mon, 18 Feb 2019 09:06:29 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1gvjYn-0005Sp-18 for qemu-devel@nongnu.org; Mon, 18 Feb 2019 09:06:24 -0500 Received: from mx1.redhat.com ([209.132.183.28]:39426) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1gvjYm-0005P3-HY for qemu-devel@nongnu.org; Mon, 18 Feb 2019 09:06:16 -0500 Received: from smtp.corp.redhat.com (int-mx08.intmail.prod.int.phx2.redhat.com [10.5.11.23]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 58CB71316E9 for ; Mon, 18 Feb 2019 14:06:11 +0000 (UTC) Received: from blackfin.pond.sub.org (ovpn-116-92.ams2.redhat.com [10.36.116.92]) by smtp.corp.redhat.com (Postfix) with ESMTPS id F2784277A9 for ; Mon, 18 Feb 2019 14:06:10 +0000 (UTC) Received: by blackfin.pond.sub.org (Postfix, from userid 1000) id 16BC2113305C; Mon, 18 Feb 2019 15:06:08 +0100 (CET) From: Markus Armbruster To: qemu-devel@nongnu.org Date: Mon, 18 Feb 2019 15:05:56 +0100 Message-Id: <20190218140607.31998-8-armbru@redhat.com> In-Reply-To: <20190218140607.31998-1-armbru@redhat.com> References: <20190218140607.31998-1-armbru@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.84 on 10.5.11.23 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.39]); Mon, 18 Feb 2019 14:06:11 +0000 (UTC) Content-Transfer-Encoding: quoted-printable X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 209.132.183.28 Subject: [Qemu-devel] [PULL 07/18] build: Deal with all of QAPI's .o in qapi/Makefile.objs 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: , Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" Content-Type: text/plain; charset="utf-8" Adding QAPI's .o to util-obj-y, common-obj-y and obj-y is spread over three places: Makefile.objs takes care of target-independent generated code, Makefile.target of target-dependent generated code, and qapi/Makefile.objs of (target-independent) hand-written code. Do everything in qapi/Makefile.objs. Suggested-by: Paolo Bonzini Signed-off-by: Markus Armbruster Reviewed-by: Marc-Andr=C3=A9 Lureau Message-Id: <20190214152251.2073-8-armbru@redhat.com> --- Makefile | 1 - Makefile.objs | 16 +--------------- Makefile.target | 3 +-- qapi/Makefile.objs | 19 +++++++++++++++++++ 4 files changed, 21 insertions(+), 18 deletions(-) diff --git a/Makefile b/Makefile index 53d161b65f..a6de28677f 100644 --- a/Makefile +++ b/Makefile @@ -89,7 +89,6 @@ include $(SRC_PATH)/rules.mak =20 GENERATED_FILES =3D qemu-version.h config-host.h qemu-options.def =20 -#see Makefile.objs for the definition of QAPI_MODULES GENERATED_QAPI_FILES =3D qapi/qapi-builtin-types.h qapi/qapi-builtin-types= .c GENERATED_QAPI_FILES +=3D qapi/qapi-types.h qapi/qapi-types.c GENERATED_QAPI_FILES +=3D $(QAPI_MODULES:%=3Dqapi/qapi-types-%.h) diff --git a/Makefile.objs b/Makefile.objs index bc78e26f55..5fb022d7ad 100644 --- a/Makefile.objs +++ b/Makefile.objs @@ -1,20 +1,7 @@ -QAPI_MODULES =3D block-core block char common crypto introspect job migrat= ion -QAPI_MODULES +=3D misc net rdma rocker run-state sockets tpm trace transac= tion -QAPI_MODULES +=3D ui - ####################################################################### # Common libraries for tools and emulators stub-obj-y =3D stubs/ crypto/ util-obj-y =3D util/ qobject/ qapi/ -util-obj-y +=3D qapi/qapi-builtin-types.o -util-obj-y +=3D qapi/qapi-types.o -util-obj-y +=3D $(QAPI_MODULES:%=3Dqapi/qapi-types-%.o) -util-obj-y +=3D qapi/qapi-builtin-visit.o -util-obj-y +=3D qapi/qapi-visit.o -util-obj-y +=3D $(QAPI_MODULES:%=3Dqapi/qapi-visit-%.o) -util-obj-y +=3D qapi/qapi-emit-events.o -util-obj-y +=3D qapi/qapi-events.o -util-obj-y +=3D $(QAPI_MODULES:%=3Dqapi/qapi-events-%.o) =20 chardev-obj-y =3D chardev/ slirp-obj-$(CONFIG_SLIRP) =3D slirp/ @@ -92,9 +79,8 @@ common-obj-$(CONFIG_FDT) +=3D device_tree.o ###################################################################### # qapi =20 -common-obj-y +=3D qapi/qapi-commands.o -common-obj-y +=3D $(QAPI_MODULES:%=3Dqapi/qapi-commands-%.o) common-obj-y +=3D qmp.o hmp.o +common-obj-y +=3D qapi/ endif =20 ####################################################################### diff --git a/Makefile.target b/Makefile.target index d8af835890..d6ce549388 100644 --- a/Makefile.target +++ b/Makefile.target @@ -148,6 +148,7 @@ ifdef CONFIG_SOFTMMU obj-y +=3D arch_init.o cpus.o monitor.o gdbstub.o balloon.o ioport.o numa.o obj-y +=3D qtest.o obj-y +=3D hw/ +obj-y +=3D qapi/ obj-y +=3D memory.o obj-y +=3D memory_mapping.o obj-y +=3D dump.o @@ -164,8 +165,6 @@ endif =20 GENERATED_FILES +=3D hmp-commands.h hmp-commands-info.h =20 -obj-y +=3D qapi/qapi-introspect.o - endif # CONFIG_SOFTMMU =20 dummy :=3D $(call unnest-vars,,obj-y) diff --git a/qapi/Makefile.objs b/qapi/Makefile.objs index 33906ff321..05bb0564f2 100644 --- a/qapi/Makefile.objs +++ b/qapi/Makefile.objs @@ -4,3 +4,22 @@ util-obj-y +=3D string-input-visitor.o string-output-visit= or.o util-obj-y +=3D opts-visitor.o qapi-clone-visitor.o util-obj-y +=3D qmp-event.o util-obj-y +=3D qapi-util.o + +QAPI_MODULES =3D block-core block char common crypto introspect job migrat= ion +QAPI_MODULES +=3D misc net rdma rocker run-state sockets tpm trace transac= tion +QAPI_MODULES +=3D ui + +util-obj-y +=3D qapi-builtin-types.o +util-obj-y +=3D qapi-types.o +util-obj-y +=3D $(QAPI_MODULES:%=3Dqapi-types-%.o) +util-obj-y +=3D qapi-builtin-visit.o +util-obj-y +=3D qapi-visit.o +util-obj-y +=3D $(QAPI_MODULES:%=3Dqapi-visit-%.o) +util-obj-y +=3D qapi-emit-events.o +util-obj-y +=3D qapi-events.o +util-obj-y +=3D $(QAPI_MODULES:%=3Dqapi-events-%.o) + +common-obj-y =3D qapi-commands.o +common-obj-y +=3D $(QAPI_MODULES:%=3Dqapi-commands-%.o) + +obj-y =3D qapi-introspect.o --=20 2.17.2 From nobody Mon May 6 10:03:50 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zoho.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.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 209.51.188.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 (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1550499073964680.9423214486953; Mon, 18 Feb 2019 06:11:13 -0800 (PST) Received: from localhost ([127.0.0.1]:59176 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1gvjdR-0005Yg-Ka for importer@patchew.org; Mon, 18 Feb 2019 09:11:05 -0500 Received: from eggs.gnu.org ([209.51.188.92]:60022) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1gvjYu-0001yF-Sm for qemu-devel@nongnu.org; Mon, 18 Feb 2019 09:06:31 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1gvjYm-0005Sf-TM for qemu-devel@nongnu.org; Mon, 18 Feb 2019 09:06:24 -0500 Received: from mx1.redhat.com ([209.132.183.28]:55834) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1gvjYm-0005Ox-E8 for qemu-devel@nongnu.org; Mon, 18 Feb 2019 09:06:16 -0500 Received: from smtp.corp.redhat.com (int-mx07.intmail.prod.int.phx2.redhat.com [10.5.11.22]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 32BF488E58 for ; Mon, 18 Feb 2019 14:06:11 +0000 (UTC) Received: from blackfin.pond.sub.org (ovpn-116-92.ams2.redhat.com [10.36.116.92]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 009B91024948 for ; Mon, 18 Feb 2019 14:06:10 +0000 (UTC) Received: by blackfin.pond.sub.org (Postfix, from userid 1000) id 1A241113303F; Mon, 18 Feb 2019 15:06:08 +0100 (CET) From: Markus Armbruster To: qemu-devel@nongnu.org Date: Mon, 18 Feb 2019 15:05:57 +0100 Message-Id: <20190218140607.31998-9-armbru@redhat.com> In-Reply-To: <20190218140607.31998-1-armbru@redhat.com> References: <20190218140607.31998-1-armbru@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.84 on 10.5.11.22 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.25]); Mon, 18 Feb 2019 14:06:11 +0000 (UTC) Content-Transfer-Encoding: quoted-printable X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 209.132.183.28 Subject: [Qemu-devel] [PULL 08/18] qapi: New module target.json 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: , Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" Content-Type: text/plain; charset="utf-8" We can't add appropriate target-specific conditionals to misc.json, because that would make all of misc.json unusable in target-independent code. To keep misc.json target-independent, we need to split off target-dependent target.json. This commit doesn't actually split off anything, it merely creates the empty module. The next few patches will move stuff from misc.json there. Signed-off-by: Markus Armbruster Reviewed-by: Marc-Andr=C3=A9 Lureau Message-Id: <20190214152251.2073-9-armbru@redhat.com> --- qapi/Makefile.objs | 28 +++++++++++++++++----------- qapi/qapi-schema.json | 1 + qapi/target.json | 13 +++++++++++++ 3 files changed, 31 insertions(+), 11 deletions(-) create mode 100644 qapi/target.json diff --git a/qapi/Makefile.objs b/qapi/Makefile.objs index 05bb0564f2..87e4df1660 100644 --- a/qapi/Makefile.objs +++ b/qapi/Makefile.objs @@ -5,21 +5,27 @@ util-obj-y +=3D opts-visitor.o qapi-clone-visitor.o util-obj-y +=3D qmp-event.o util-obj-y +=3D qapi-util.o =20 -QAPI_MODULES =3D block-core block char common crypto introspect job migrat= ion -QAPI_MODULES +=3D misc net rdma rocker run-state sockets tpm trace transac= tion -QAPI_MODULES +=3D ui +QAPI_COMMON_MODULES =3D block-core block char common crypto introspect +QAPI_COMMON_MODULES +=3D job migration misc net rdma rocker run-state +QAPI_COMMON_MODULES +=3D sockets tpm trace transaction ui +QAPI_TARGET_MODULES =3D target +QAPI_MODULES =3D $(QAPI_COMMON_MODULES) $(QAPI_TARGET_MODULES) =20 util-obj-y +=3D qapi-builtin-types.o -util-obj-y +=3D qapi-types.o -util-obj-y +=3D $(QAPI_MODULES:%=3Dqapi-types-%.o) +util-obj-y +=3D $(QAPI_COMMON_MODULES:%=3Dqapi-types-%.o) util-obj-y +=3D qapi-builtin-visit.o -util-obj-y +=3D qapi-visit.o -util-obj-y +=3D $(QAPI_MODULES:%=3Dqapi-visit-%.o) +util-obj-y +=3D $(QAPI_COMMON_MODULES:%=3Dqapi-visit-%.o) util-obj-y +=3D qapi-emit-events.o -util-obj-y +=3D qapi-events.o -util-obj-y +=3D $(QAPI_MODULES:%=3Dqapi-events-%.o) +util-obj-y +=3D $(QAPI_COMMON_MODULES:%=3Dqapi-events-%.o) =20 -common-obj-y =3D qapi-commands.o -common-obj-y +=3D $(QAPI_MODULES:%=3Dqapi-commands-%.o) +common-obj-y =3D $(QAPI_COMMON_MODULES:%=3Dqapi-commands-%.o) =20 obj-y =3D qapi-introspect.o +obj-y +=3D $(QAPI_TARGET_MODULES:%=3Dqapi-types-%.o) +obj-y +=3D qapi-types.o +obj-y +=3D $(QAPI_TARGET_MODULES:%=3Dqapi-visit-%.o) +obj-y +=3D qapi-visit.o +obj-y +=3D $(QAPI_TARGET_MODULES:%=3Dqapi-events-%.o) +obj-y +=3D qapi-events.o +obj-y +=3D $(QAPI_TARGET_MODULES:%=3Dqapi-commands-%.o) +obj-y +=3D qapi-commands.o diff --git a/qapi/qapi-schema.json b/qapi/qapi-schema.json index 1845aa78ff..db61bfd688 100644 --- a/qapi/qapi-schema.json +++ b/qapi/qapi-schema.json @@ -97,3 +97,4 @@ { 'include': 'trace.json' } { 'include': 'introspect.json' } { 'include': 'misc.json' } +{ 'include': 'target.json' } diff --git a/qapi/target.json b/qapi/target.json new file mode 100644 index 0000000000..8054926293 --- /dev/null +++ b/qapi/target.json @@ -0,0 +1,13 @@ +# -*- Mode: Python -*- +# + +## +# =3D Target-specific commands & events +## + +## +# @TARGET-TEMPORARY-DUMMY: +# Will go away in the next commit. Needed in this one because empty +# modules don't generate anything, defeating this commit's purpose. +## +{ 'event': 'TARGET-TEMPORARY-DUMMY' } --=20 2.17.2 From nobody Mon May 6 10:03:50 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zoho.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.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 209.51.188.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 (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1550499672003233.3012092228522; Mon, 18 Feb 2019 06:21:12 -0800 (PST) Received: from localhost ([127.0.0.1]:59317 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1gvjnA-0005Km-Rz for importer@patchew.org; Mon, 18 Feb 2019 09:21:08 -0500 Received: from eggs.gnu.org ([209.51.188.92]:60017) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1gvjYu-0001yC-SY for qemu-devel@nongnu.org; Mon, 18 Feb 2019 09:06:27 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1gvjYm-0005Qt-7g for qemu-devel@nongnu.org; Mon, 18 Feb 2019 09:06:24 -0500 Received: from mx1.redhat.com ([209.132.183.28]:39430) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1gvjYk-0005P7-37 for qemu-devel@nongnu.org; Mon, 18 Feb 2019 09:06:14 -0500 Received: from smtp.corp.redhat.com (int-mx04.intmail.prod.int.phx2.redhat.com [10.5.11.14]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 7E16D1314ED for ; Mon, 18 Feb 2019 14:06:11 +0000 (UTC) Received: from blackfin.pond.sub.org (ovpn-116-92.ams2.redhat.com [10.36.116.92]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 1D9875ED4C; Mon, 18 Feb 2019 14:06:11 +0000 (UTC) Received: by blackfin.pond.sub.org (Postfix, from userid 1000) id 1DBA81132EC4; Mon, 18 Feb 2019 15:06:08 +0100 (CET) From: Markus Armbruster To: qemu-devel@nongnu.org Date: Mon, 18 Feb 2019 15:05:58 +0100 Message-Id: <20190218140607.31998-10-armbru@redhat.com> In-Reply-To: <20190218140607.31998-1-armbru@redhat.com> References: <20190218140607.31998-1-armbru@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.14 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.39]); Mon, 18 Feb 2019 14:06:11 +0000 (UTC) Content-Transfer-Encoding: quoted-printable X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 209.132.183.28 Subject: [Qemu-devel] [PULL 09/18] qapi: make rtc-reset-reinjection and SEV depend on TARGET_I386 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?= Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" Content-Type: text/plain; charset="utf-8" From: Marc-Andr=C3=A9 Lureau Move rtc-reset-reinjection and SEV in target.json and make them conditional on TARGET_I386. Signed-off-by: Marc-Andr=C3=A9 Lureau Reviewed-by: Markus Armbruster Signed-off-by: Markus Armbruster Message-Id: <20190214152251.2073-10-armbru@redhat.com> --- hw/timer/mc146818rtc.c | 2 +- monitor.c | 31 -------- qapi/misc.json | 166 -------------------------------------- qapi/target.json | 177 ++++++++++++++++++++++++++++++++++++++++- target/i386/sev_i386.h | 2 +- 5 files changed, 175 insertions(+), 203 deletions(-) diff --git a/hw/timer/mc146818rtc.c b/hw/timer/mc146818rtc.c index 69483152c3..bc1862b6fc 100644 --- a/hw/timer/mc146818rtc.c +++ b/hw/timer/mc146818rtc.c @@ -31,7 +31,7 @@ #include "sysemu/replay.h" #include "hw/timer/mc146818rtc.h" #include "qapi/error.h" -#include "qapi/qapi-commands-misc.h" +#include "qapi/qapi-commands-target.h" #include "qapi/qapi-events-misc.h" #include "qapi/visitor.h" #include "exec/address-spaces.h" diff --git a/monitor.c b/monitor.c index 8e02a001a3..ec901fbb47 100644 --- a/monitor.c +++ b/monitor.c @@ -1145,12 +1145,6 @@ static void qmp_query_qmp_schema(QDict *qdict, QObje= ct **ret_data, */ static void qmp_unregister_commands_hack(void) { -#ifndef TARGET_I386 - qmp_unregister_command(&qmp_commands, "rtc-reset-reinjection"); - qmp_unregister_command(&qmp_commands, "query-sev"); - qmp_unregister_command(&qmp_commands, "query-sev-launch-measure"); - qmp_unregister_command(&qmp_commands, "query-sev-capabilities"); -#endif #ifndef TARGET_S390X qmp_unregister_command(&qmp_commands, "dump-skeys"); #endif @@ -4670,31 +4664,6 @@ QemuOptsList qemu_mon_opts =3D { }, }; =20 -#ifndef TARGET_I386 -void qmp_rtc_reset_reinjection(Error **errp) -{ - error_setg(errp, QERR_FEATURE_DISABLED, "rtc-reset-reinjection"); -} - -SevInfo *qmp_query_sev(Error **errp) -{ - error_setg(errp, QERR_FEATURE_DISABLED, "query-sev"); - return NULL; -} - -SevLaunchMeasureInfo *qmp_query_sev_launch_measure(Error **errp) -{ - error_setg(errp, QERR_FEATURE_DISABLED, "query-sev-launch-measure"); - return NULL; -} - -SevCapability *qmp_query_sev_capabilities(Error **errp) -{ - error_setg(errp, QERR_FEATURE_DISABLED, "query-sev-capabilities"); - return NULL; -} -#endif - #ifndef TARGET_S390X void qmp_dump_skeys(const char *filename, Error **errp) { diff --git a/qapi/misc.json b/qapi/misc.json index 426274ecf8..0d9682ba4c 100644 --- a/qapi/misc.json +++ b/qapi/misc.json @@ -3119,24 +3119,6 @@ { 'event': 'ACPI_DEVICE_OST', 'data': { 'info': 'ACPIOSTInfo' } } =20 -## -# @rtc-reset-reinjection: -# -# This command will reset the RTC interrupt reinjection backlog. -# Can be used if another mechanism to synchronize guest time -# is in effect, for example QEMU guest agent's guest-set-time -# command. -# -# Since: 2.1 -# -# Example: -# -# -> { "execute": "rtc-reset-reinjection" } -# <- { "return": {} } -# -## -{ 'command': 'rtc-reset-reinjection' } - ## # @RTC_CHANGE: # @@ -3365,154 +3347,6 @@ ## { 'command': 'query-vm-generation-id', 'returns': 'GuidInfo' } =20 - -## -# @SevState: -# -# An enumeration of SEV state information used during @query-sev. -# -# @uninit: The guest is uninitialized. -# -# @launch-update: The guest is currently being launched; plaintext data and -# register state is being imported. -# -# @launch-secret: The guest is currently being launched; ciphertext data -# is being imported. -# -# @running: The guest is fully launched or migrated in. -# -# @send-update: The guest is currently being migrated out to another machi= ne. -# -# @receive-update: The guest is currently being migrated from another mach= ine. -# -# Since: 2.12 -## -{ 'enum': 'SevState', - 'data': ['uninit', 'launch-update', 'launch-secret', 'running', - 'send-update', 'receive-update' ] } - -## -# @SevInfo: -# -# Information about Secure Encrypted Virtualization (SEV) support -# -# @enabled: true if SEV is active -# -# @api-major: SEV API major version -# -# @api-minor: SEV API minor version -# -# @build-id: SEV FW build id -# -# @policy: SEV policy value -# -# @state: SEV guest state -# -# @handle: SEV firmware handle -# -# Since: 2.12 -## -{ 'struct': 'SevInfo', - 'data': { 'enabled': 'bool', - 'api-major': 'uint8', - 'api-minor' : 'uint8', - 'build-id' : 'uint8', - 'policy' : 'uint32', - 'state' : 'SevState', - 'handle' : 'uint32' - } -} - -## -# @query-sev: -# -# Returns information about SEV -# -# Returns: @SevInfo -# -# Since: 2.12 -# -# Example: -# -# -> { "execute": "query-sev" } -# <- { "return": { "enabled": true, "api-major" : 0, "api-minor" : 0, -# "build-id" : 0, "policy" : 0, "state" : "running", -# "handle" : 1 } } -# -## -{ 'command': 'query-sev', 'returns': 'SevInfo' } - -## -# @SevLaunchMeasureInfo: -# -# SEV Guest Launch measurement information -# -# @data: the measurement value encoded in base64 -# -# Since: 2.12 -# -## -{ 'struct': 'SevLaunchMeasureInfo', 'data': {'data': 'str'} } - -## -# @query-sev-launch-measure: -# -# Query the SEV guest launch information. -# -# Returns: The @SevLaunchMeasureInfo for the guest -# -# Since: 2.12 -# -# Example: -# -# -> { "execute": "query-sev-launch-measure" } -# <- { "return": { "data": "4l8LXeNlSPUDlXPJG5966/8%YZ" } } -# -## -{ 'command': 'query-sev-launch-measure', 'returns': 'SevLaunchMeasureInfo'= } - -## -# @SevCapability: -# -# The struct describes capability for a Secure Encrypted Virtualization -# feature. -# -# @pdh: Platform Diffie-Hellman key (base64 encoded) -# -# @cert-chain: PDH certificate chain (base64 encoded) -# -# @cbitpos: C-bit location in page table entry -# -# @reduced-phys-bits: Number of physical Address bit reduction when SEV is -# enabled -# -# Since: 2.12 -## -{ 'struct': 'SevCapability', - 'data': { 'pdh': 'str', - 'cert-chain': 'str', - 'cbitpos': 'int', - 'reduced-phys-bits': 'int'} } - -## -# @query-sev-capabilities: -# -# This command is used to get the SEV capabilities, and is supported on AMD -# X86 platforms only. -# -# Returns: SevCapability objects. -# -# Since: 2.12 -# -# Example: -# -# -> { "execute": "query-sev-capabilities" } -# <- { "return": { "pdh": "8CCDD8DDD", "cert-chain": "888CCCDDDEE", -# "cbitpos": 47, "reduced-phys-bits": 5}} -# -## -{ 'command': 'query-sev-capabilities', 'returns': 'SevCapability' } - ## # @set-numa-node: # diff --git a/qapi/target.json b/qapi/target.json index 8054926293..2cafd7a0be 100644 --- a/qapi/target.json +++ b/qapi/target.json @@ -6,8 +6,177 @@ ## =20 ## -# @TARGET-TEMPORARY-DUMMY: -# Will go away in the next commit. Needed in this one because empty -# modules don't generate anything, defeating this commit's purpose. +# @rtc-reset-reinjection: +# +# This command will reset the RTC interrupt reinjection backlog. +# Can be used if another mechanism to synchronize guest time +# is in effect, for example QEMU guest agent's guest-set-time +# command. +# +# Since: 2.1 +# +# Example: +# +# -> { "execute": "rtc-reset-reinjection" } +# <- { "return": {} } +# ## -{ 'event': 'TARGET-TEMPORARY-DUMMY' } +{ 'command': 'rtc-reset-reinjection', + 'if': 'defined(TARGET_I386)' } + + +## +# @SevState: +# +# An enumeration of SEV state information used during @query-sev. +# +# @uninit: The guest is uninitialized. +# +# @launch-update: The guest is currently being launched; plaintext data and +# register state is being imported. +# +# @launch-secret: The guest is currently being launched; ciphertext data +# is being imported. +# +# @running: The guest is fully launched or migrated in. +# +# @send-update: The guest is currently being migrated out to another machi= ne. +# +# @receive-update: The guest is currently being migrated from another mach= ine. +# +# Since: 2.12 +## +{ 'enum': 'SevState', + 'data': ['uninit', 'launch-update', 'launch-secret', 'running', + 'send-update', 'receive-update' ], + 'if': 'defined(TARGET_I386)' } + +## +# @SevInfo: +# +# Information about Secure Encrypted Virtualization (SEV) support +# +# @enabled: true if SEV is active +# +# @api-major: SEV API major version +# +# @api-minor: SEV API minor version +# +# @build-id: SEV FW build id +# +# @policy: SEV policy value +# +# @state: SEV guest state +# +# @handle: SEV firmware handle +# +# Since: 2.12 +## +{ 'struct': 'SevInfo', + 'data': { 'enabled': 'bool', + 'api-major': 'uint8', + 'api-minor' : 'uint8', + 'build-id' : 'uint8', + 'policy' : 'uint32', + 'state' : 'SevState', + 'handle' : 'uint32' + }, + 'if': 'defined(TARGET_I386)' +} + +## +# @query-sev: +# +# Returns information about SEV +# +# Returns: @SevInfo +# +# Since: 2.12 +# +# Example: +# +# -> { "execute": "query-sev" } +# <- { "return": { "enabled": true, "api-major" : 0, "api-minor" : 0, +# "build-id" : 0, "policy" : 0, "state" : "running", +# "handle" : 1 } } +# +## +{ 'command': 'query-sev', 'returns': 'SevInfo', + 'if': 'defined(TARGET_I386)' } + + +## +# @SevLaunchMeasureInfo: +# +# SEV Guest Launch measurement information +# +# @data: the measurement value encoded in base64 +# +# Since: 2.12 +# +## +{ 'struct': 'SevLaunchMeasureInfo', 'data': {'data': 'str'}, + 'if': 'defined(TARGET_I386)' } + +## +# @query-sev-launch-measure: +# +# Query the SEV guest launch information. +# +# Returns: The @SevLaunchMeasureInfo for the guest +# +# Since: 2.12 +# +# Example: +# +# -> { "execute": "query-sev-launch-measure" } +# <- { "return": { "data": "4l8LXeNlSPUDlXPJG5966/8%YZ" } } +# +## +{ 'command': 'query-sev-launch-measure', 'returns': 'SevLaunchMeasureInfo', + 'if': 'defined(TARGET_I386)' } + + +## +# @SevCapability: +# +# The struct describes capability for a Secure Encrypted Virtualization +# feature. +# +# @pdh: Platform Diffie-Hellman key (base64 encoded) +# +# @cert-chain: PDH certificate chain (base64 encoded) +# +# @cbitpos: C-bit location in page table entry +# +# @reduced-phys-bits: Number of physical Address bit reduction when SEV is +# enabled +# +# Since: 2.12 +## +{ 'struct': 'SevCapability', + 'data': { 'pdh': 'str', + 'cert-chain': 'str', + 'cbitpos': 'int', + 'reduced-phys-bits': 'int'}, + 'if': 'defined(TARGET_I386)' } + +## +# @query-sev-capabilities: +# +# This command is used to get the SEV capabilities, and is supported on AMD +# X86 platforms only. +# +# Returns: SevCapability objects. +# +# Since: 2.12 +# +# Example: +# +# -> { "execute": "query-sev-capabilities" } +# <- { "return": { "pdh": "8CCDD8DDD", "cert-chain": "888CCCDDDEE", +# "cbitpos": 47, "reduced-phys-bits": 5}} +# +## +{ 'command': 'query-sev-capabilities', 'returns': 'SevCapability', + 'if': 'defined(TARGET_I386)' } diff --git a/target/i386/sev_i386.h b/target/i386/sev_i386.h index b8622dfb1e..c0f9373beb 100644 --- a/target/i386/sev_i386.h +++ b/target/i386/sev_i386.h @@ -19,7 +19,7 @@ #include "sysemu/kvm.h" #include "sysemu/sev.h" #include "qemu/error-report.h" -#include "qapi/qapi-commands-misc.h" +#include "qapi/qapi-commands-target.h" =20 #define SEV_POLICY_NODBG 0x1 #define SEV_POLICY_NOKS 0x2 --=20 2.17.2 From nobody Mon May 6 10:03:50 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zoho.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.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 209.51.188.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 (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1550500033523447.4425011923113; Mon, 18 Feb 2019 06:27:13 -0800 (PST) Received: from localhost ([127.0.0.1]:59407 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1gvjt0-0001gV-BE for importer@patchew.org; Mon, 18 Feb 2019 09:27:10 -0500 Received: from eggs.gnu.org ([209.51.188.92]:60007) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1gvjYu-0001y1-PM for qemu-devel@nongnu.org; Mon, 18 Feb 2019 09:06:34 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1gvjYm-0005R0-8x for qemu-devel@nongnu.org; Mon, 18 Feb 2019 09:06:23 -0500 Received: from mx1.redhat.com ([209.132.183.28]:28295) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1gvjYk-0005PD-2Y for qemu-devel@nongnu.org; Mon, 18 Feb 2019 09:06:14 -0500 Received: from smtp.corp.redhat.com (int-mx06.intmail.prod.int.phx2.redhat.com [10.5.11.16]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id A995099CE0 for ; Mon, 18 Feb 2019 14:06:11 +0000 (UTC) Received: from blackfin.pond.sub.org (ovpn-116-92.ams2.redhat.com [10.36.116.92]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 246C761488; Mon, 18 Feb 2019 14:06:11 +0000 (UTC) Received: by blackfin.pond.sub.org (Postfix, from userid 1000) id 214771132D3C; Mon, 18 Feb 2019 15:06:08 +0100 (CET) From: Markus Armbruster To: qemu-devel@nongnu.org Date: Mon, 18 Feb 2019 15:05:59 +0100 Message-Id: <20190218140607.31998-11-armbru@redhat.com> In-Reply-To: <20190218140607.31998-1-armbru@redhat.com> References: <20190218140607.31998-1-armbru@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.16 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.38]); Mon, 18 Feb 2019 14:06:11 +0000 (UTC) Content-Transfer-Encoding: quoted-printable X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 209.132.183.28 Subject: [Qemu-devel] [PULL 10/18] qapi: make s390 commands depend on TARGET_S390X 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?= Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" Content-Type: text/plain; charset="utf-8" From: Marc-Andr=C3=A9 Lureau Signed-off-by: Marc-Andr=C3=A9 Lureau Acked-by: Cornelia Huck Reviewed-by: Markus Armbruster Signed-off-by: Markus Armbruster Message-Id: <20190214152251.2073-11-armbru@redhat.com> --- hw/s390x/s390-skeys.c | 2 +- include/sysemu/arch_init.h | 7 -- monitor.c | 14 --- qapi/misc.json | 137 ----------------------- qapi/target.json | 142 ++++++++++++++++++++++++ qmp.c | 14 --- stubs/Makefile.objs | 2 - stubs/arch-query-cpu-model-baseline.c | 13 --- stubs/arch-query-cpu-model-comparison.c | 13 --- target/s390x/cpu_models.c | 5 +- 10 files changed, 146 insertions(+), 203 deletions(-) delete mode 100644 stubs/arch-query-cpu-model-baseline.c delete mode 100644 stubs/arch-query-cpu-model-comparison.c diff --git a/hw/s390x/s390-skeys.c b/hw/s390x/s390-skeys.c index 15f7ab0e53..daac936698 100644 --- a/hw/s390x/s390-skeys.c +++ b/hw/s390x/s390-skeys.c @@ -14,7 +14,7 @@ #include "hw/boards.h" #include "hw/s390x/storage-keys.h" #include "qapi/error.h" -#include "qapi/qapi-commands-misc.h" +#include "qapi/qapi-commands-target.h" #include "qapi/qmp/qdict.h" #include "qemu/error-report.h" #include "sysemu/kvm.h" diff --git a/include/sysemu/arch_init.h b/include/sysemu/arch_init.h index 32abdfe6a1..f0ef652b2a 100644 --- a/include/sysemu/arch_init.h +++ b/include/sysemu/arch_init.h @@ -36,11 +36,4 @@ CpuDefinitionInfoList *arch_query_cpu_definitions(Error = **errp); CpuModelExpansionInfo *arch_query_cpu_model_expansion(CpuModelExpansionTyp= e type, CpuModelInfo *mode, Error **errp); -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/monitor.c b/monitor.c index ec901fbb47..621e26cc94 100644 --- a/monitor.c +++ b/monitor.c @@ -1145,19 +1145,12 @@ static void qmp_query_qmp_schema(QDict *qdict, QObj= ect **ret_data, */ static void qmp_unregister_commands_hack(void) { -#ifndef TARGET_S390X - qmp_unregister_command(&qmp_commands, "dump-skeys"); -#endif #ifndef TARGET_ARM qmp_unregister_command(&qmp_commands, "query-gic-capabilities"); #endif #if !defined(TARGET_S390X) && !defined(TARGET_I386) qmp_unregister_command(&qmp_commands, "query-cpu-model-expansion"); #endif -#if !defined(TARGET_S390X) - qmp_unregister_command(&qmp_commands, "query-cpu-model-baseline"); - qmp_unregister_command(&qmp_commands, "query-cpu-model-comparison"); -#endif #if !defined(TARGET_PPC) && !defined(TARGET_ARM) && !defined(TARGET_I386) \ && !defined(TARGET_S390X) qmp_unregister_command(&qmp_commands, "query-cpu-definitions"); @@ -4664,13 +4657,6 @@ QemuOptsList qemu_mon_opts =3D { }, }; =20 -#ifndef TARGET_S390X -void qmp_dump_skeys(const char *filename, Error **errp) -{ - error_setg(errp, QERR_FEATURE_DISABLED, "dump-skeys"); -} -#endif - #ifndef TARGET_ARM GICCapabilityList *qmp_query_gic_capabilities(Error **errp) { diff --git a/qapi/misc.json b/qapi/misc.json index 0d9682ba4c..431de64590 100644 --- a/qapi/misc.json +++ b/qapi/misc.json @@ -1907,27 +1907,6 @@ { 'command': 'query-dump-guest-memory-capability', 'returns': 'DumpGuestMemoryCapability' } =20 -## -# @dump-skeys: -# -# Dump guest's storage keys -# -# @filename: the path to the file to dump to -# -# This command is only supported on s390 architecture. -# -# Since: 2.5 -# -# Example: -# -# -> { "execute": "dump-skeys", -# "arguments": { "filename": "/tmp/skeys" } } -# <- { "return": {} } -# -## -{ 'command': 'dump-skeys', - 'data': { 'filename': 'str' } } - ## # @object-add: # @@ -2294,122 +2273,6 @@ { 'enum': 'CpuModelCompareResult', 'data': [ 'incompatible', 'identical', 'superset', 'subset' ] } =20 -## -# @CpuModelCompareInfo: -# -# The result of a CPU model comparison. -# -# @result: The result of the compare operation. -# @responsible-properties: List of properties that led to the comparison r= esult -# not being identical. -# -# @responsible-properties is a list of QOM property names that led to -# both CPUs not being detected as identical. For identical models, this -# list is empty. -# If a QOM property is read-only, that means there's no known way to make = the -# CPU models identical. If the special property name "type" is included, t= he -# models are by definition not identical and cannot be made identical. -# -# Since: 2.8.0 -## -{ 'struct': 'CpuModelCompareInfo', - 'data': {'result': 'CpuModelCompareResult', - 'responsible-properties': ['str'] - } -} - -## -# @query-cpu-model-comparison: -# -# Compares two CPU models, returning how they compare in a specific -# configuration. The results indicates how both models compare regarding -# runnability. This result can be used by tooling to make decisions if a -# certain CPU model will run in a certain configuration or if a compatible -# CPU model has to be created by baselining. -# -# Usually, a CPU model is compared against the maximum possible CPU model -# of a certain configuration (e.g. the "host" model for KVM). If that CPU -# model is identical or a subset, it will run in that configuration. -# -# The result returned by this command may be affected by: -# -# * QEMU version: CPU models may look different depending on the QEMU vers= ion. -# (Except for CPU models reported as "static" in query-cpu-definitions.) -# * machine-type: CPU model may look different depending on the machine-ty= pe. -# (Except for CPU models reported as "static" in query-cpu-definitions.) -# * machine options (including accelerator): in some architectures, CPU mo= dels -# may look different depending on machine and accelerator options. (Exce= pt for -# CPU models reported as "static" in query-cpu-definitions.) -# * "-cpu" arguments and global properties: arguments to the -cpu option a= nd -# global properties may affect expansion of CPU models. Using -# query-cpu-model-expansion while using these is not advised. -# -# Some architectures may not support comparing CPU models. s390x supports -# comparing CPU models. -# -# Returns: a CpuModelBaselineInfo. Returns an error if comparing CPU model= s 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-comparison', - '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). -# -# This interface can be used by tooling to create a compatible CPU model o= ut -# two CPU models. The created CPU model will be identical to or a subset of -# both CPU models when comparing them. Therefore, the created CPU model is -# guaranteed to run where the given CPU models run. -# -# The result returned by this command may be affected by: -# -# * QEMU version: CPU models may look different depending on the QEMU vers= ion. -# (Except for CPU models reported as "static" in query-cpu-definitions.) -# * machine-type: CPU model may look different depending on the machine-ty= pe. -# (Except for CPU models reported as "static" in query-cpu-definitions.) -# * machine options (including accelerator): in some architectures, CPU mo= dels -# may look different depending on machine and accelerator options. (Exce= pt for -# CPU models reported as "static" in query-cpu-definitions.) -# * "-cpu" arguments and global properties: arguments to the -cpu option a= nd -# global properties may affect expansion of CPU models. Using -# query-cpu-model-expansion while using these is not advised. -# -# Some architectures may not support baselining CPU models. s390x supports -# baselining CPU models. -# -# Returns: a CpuModelBaselineInfo. Returns an error if baselining CPU mode= ls 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: # diff --git a/qapi/target.json b/qapi/target.json index 2cafd7a0be..17671d77c1 100644 --- a/qapi/target.json +++ b/qapi/target.json @@ -5,6 +5,8 @@ # =3D Target-specific commands & events ## =20 +{ 'include': 'misc.json' } + ## # @rtc-reset-reinjection: # @@ -180,3 +182,143 @@ ## { 'command': 'query-sev-capabilities', 'returns': 'SevCapability', 'if': 'defined(TARGET_I386)' } + +## +# @dump-skeys: +# +# Dump guest's storage keys +# +# @filename: the path to the file to dump to +# +# This command is only supported on s390 architecture. +# +# Since: 2.5 +# +# Example: +# +# -> { "execute": "dump-skeys", +# "arguments": { "filename": "/tmp/skeys" } } +# <- { "return": {} } +# +## +{ 'command': 'dump-skeys', + 'data': { 'filename': 'str' }, + 'if': 'defined(TARGET_S390X)' } + +## +# @CpuModelBaselineInfo: +# +# The result of a CPU model baseline. +# +# @model: the baselined CpuModelInfo. +# +# Since: 2.8.0 +## +{ 'struct': 'CpuModelBaselineInfo', + 'data': { 'model': 'CpuModelInfo' }, + 'if': 'defined(TARGET_S390X)' } + +## +# @CpuModelCompareInfo: +# +# The result of a CPU model comparison. +# +# @result: The result of the compare operation. +# @responsible-properties: List of properties that led to the comparison r= esult +# not being identical. +# +# @responsible-properties is a list of QOM property names that led to +# both CPUs not being detected as identical. For identical models, this +# list is empty. +# If a QOM property is read-only, that means there's no known way to make = the +# CPU models identical. If the special property name "type" is included, t= he +# models are by definition not identical and cannot be made identical. +# +# Since: 2.8.0 +## +{ 'struct': 'CpuModelCompareInfo', + 'data': { 'result': 'CpuModelCompareResult', + 'responsible-properties': ['str'] }, + 'if': 'defined(TARGET_S390X)' } + +## +# @query-cpu-model-comparison: +# +# Compares two CPU models, returning how they compare in a specific +# configuration. The results indicates how both models compare regarding +# runnability. This result can be used by tooling to make decisions if a +# certain CPU model will run in a certain configuration or if a compatible +# CPU model has to be created by baselining. +# +# Usually, a CPU model is compared against the maximum possible CPU model +# of a certain configuration (e.g. the "host" model for KVM). If that CPU +# model is identical or a subset, it will run in that configuration. +# +# The result returned by this command may be affected by: +# +# * QEMU version: CPU models may look different depending on the QEMU vers= ion. +# (Except for CPU models reported as "static" in query-cpu-definitions.) +# * machine-type: CPU model may look different depending on the machine-ty= pe. +# (Except for CPU models reported as "static" in query-cpu-definitions.) +# * machine options (including accelerator): in some architectures, CPU mo= dels +# may look different depending on machine and accelerator options. (Exce= pt for +# CPU models reported as "static" in query-cpu-definitions.) +# * "-cpu" arguments and global properties: arguments to the -cpu option a= nd +# global properties may affect expansion of CPU models. Using +# query-cpu-model-expansion while using these is not advised. +# +# Some architectures may not support comparing CPU models. s390x supports +# comparing CPU models. +# +# Returns: a CpuModelBaselineInfo. Returns an error if comparing CPU model= s 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-comparison', + 'data': { 'modela': 'CpuModelInfo', 'modelb': 'CpuModelInfo' }, + 'returns': 'CpuModelCompareInfo', + 'if': 'defined(TARGET_S390X)' } + +## +# @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). +# +# This interface can be used by tooling to create a compatible CPU model o= ut +# two CPU models. The created CPU model will be identical to or a subset of +# both CPU models when comparing them. Therefore, the created CPU model is +# guaranteed to run where the given CPU models run. +# +# The result returned by this command may be affected by: +# +# * QEMU version: CPU models may look different depending on the QEMU vers= ion. +# (Except for CPU models reported as "static" in query-cpu-definitions.) +# * machine-type: CPU model may look different depending on the machine-ty= pe. +# (Except for CPU models reported as "static" in query-cpu-definitions.) +# * machine options (including accelerator): in some architectures, CPU mo= dels +# may look different depending on machine and accelerator options. (Exce= pt for +# CPU models reported as "static" in query-cpu-definitions.) +# * "-cpu" arguments and global properties: arguments to the -cpu option a= nd +# global properties may affect expansion of CPU models. Using +# query-cpu-model-expansion while using these is not advised. +# +# Some architectures may not support baselining CPU models. s390x supports +# baselining CPU models. +# +# Returns: a CpuModelBaselineInfo. Returns an error if baselining CPU mode= ls 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', + 'if': 'defined(TARGET_S390X)' } diff --git a/qmp.c b/qmp.c index 4c819dd8cf..8a613bf7c7 100644 --- a/qmp.c +++ b/qmp.c @@ -617,20 +617,6 @@ CpuModelExpansionInfo *qmp_query_cpu_model_expansion(C= puModelExpansionType type, return arch_query_cpu_model_expansion(type, model, errp); } =20 -CpuModelCompareInfo *qmp_query_cpu_model_comparison(CpuModelInfo *modela, - CpuModelInfo *modelb, - Error **errp) -{ - 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 t= ls, Error **errp) diff --git a/stubs/Makefile.objs b/stubs/Makefile.objs index 1558ff1fe7..8394a079d1 100644 --- a/stubs/Makefile.objs +++ b/stubs/Makefile.objs @@ -1,7 +1,5 @@ stub-obj-y +=3D arch-query-cpu-def.o stub-obj-y +=3D arch-query-cpu-model-expansion.o -stub-obj-y +=3D arch-query-cpu-model-comparison.o -stub-obj-y +=3D arch-query-cpu-model-baseline.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 diff --git a/stubs/arch-query-cpu-model-baseline.c b/stubs/arch-query-cpu-m= odel-baseline.c deleted file mode 100644 index 0d066da328..0000000000 --- a/stubs/arch-query-cpu-model-baseline.c +++ /dev/null @@ -1,13 +0,0 @@ -#include "qemu/osdep.h" -#include "qemu-common.h" -#include "sysemu/arch_init.h" -#include "qapi/error.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; -} diff --git a/stubs/arch-query-cpu-model-comparison.c b/stubs/arch-query-cpu= -model-comparison.c deleted file mode 100644 index 8eb311a26c..0000000000 --- a/stubs/arch-query-cpu-model-comparison.c +++ /dev/null @@ -1,13 +0,0 @@ -#include "qemu/osdep.h" -#include "qemu-common.h" -#include "sysemu/arch_init.h" -#include "qapi/error.h" -#include "qapi/qmp/qerror.h" - -CpuModelCompareInfo *arch_query_cpu_model_comparison(CpuModelInfo *modela, - CpuModelInfo *modelb, - Error **errp) -{ - error_setg(errp, QERR_UNSUPPORTED); - return NULL; -} diff --git a/target/s390x/cpu_models.c b/target/s390x/cpu_models.c index 7c253ff308..b532cd8d10 100644 --- a/target/s390x/cpu_models.c +++ b/target/s390x/cpu_models.c @@ -25,6 +25,7 @@ #include "sysemu/arch_init.h" #include "hw/pci/pci.h" #endif +#include "qapi/qapi-commands-target.h" =20 #define CPUDEF_INIT(_type, _gen, _ec_ga, _mha_pow, _hmfai, _name, _desc) \ { \ @@ -605,7 +606,7 @@ static void list_add_feat(const char *name, void *opaqu= e) *last =3D entry; } =20 -CpuModelCompareInfo *arch_query_cpu_model_comparison(CpuModelInfo *infoa, +CpuModelCompareInfo *qmp_query_cpu_model_comparison(CpuModelInfo *infoa, CpuModelInfo *infob, Error **errp) { @@ -678,7 +679,7 @@ CpuModelCompareInfo *arch_query_cpu_model_comparison(Cp= uModelInfo *infoa, return compare_info; } =20 -CpuModelBaselineInfo *arch_query_cpu_model_baseline(CpuModelInfo *infoa, +CpuModelBaselineInfo *qmp_query_cpu_model_baseline(CpuModelInfo *infoa, CpuModelInfo *infob, Error **errp) { --=20 2.17.2 From nobody Mon May 6 10:03:50 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zoho.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.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 209.51.188.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 (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1550499477326237.89388513578638; Mon, 18 Feb 2019 06:17:57 -0800 (PST) Received: from localhost ([127.0.0.1]:59263 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1gvjjz-0002wq-4m for importer@patchew.org; Mon, 18 Feb 2019 09:17:51 -0500 Received: from eggs.gnu.org ([209.51.188.92]:60010) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1gvjYu-0001y6-RG for qemu-devel@nongnu.org; Mon, 18 Feb 2019 09:06:27 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1gvjYm-0005SZ-RH for qemu-devel@nongnu.org; Mon, 18 Feb 2019 09:06:24 -0500 Received: from mx1.redhat.com ([209.132.183.28]:39582) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1gvjYm-0005QW-FJ for qemu-devel@nongnu.org; Mon, 18 Feb 2019 09:06:16 -0500 Received: from smtp.corp.redhat.com (int-mx05.intmail.prod.int.phx2.redhat.com [10.5.11.15]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 23883131712 for ; Mon, 18 Feb 2019 14:06:15 +0000 (UTC) Received: from blackfin.pond.sub.org (ovpn-116-92.ams2.redhat.com [10.36.116.92]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 266655D717; Mon, 18 Feb 2019 14:06:11 +0000 (UTC) Received: by blackfin.pond.sub.org (Postfix, from userid 1000) id 24AB91132D3F; Mon, 18 Feb 2019 15:06:08 +0100 (CET) From: Markus Armbruster To: qemu-devel@nongnu.org Date: Mon, 18 Feb 2019 15:06:00 +0100 Message-Id: <20190218140607.31998-12-armbru@redhat.com> In-Reply-To: <20190218140607.31998-1-armbru@redhat.com> References: <20190218140607.31998-1-armbru@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.15 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.39]); Mon, 18 Feb 2019 14:06:15 +0000 (UTC) Content-Transfer-Encoding: quoted-printable X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 209.132.183.28 Subject: [Qemu-devel] [PULL 11/18] target.json: add a note about query-cpu* not being s390x-specific 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?= Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" Content-Type: text/plain; charset="utf-8" From: Marc-Andr=C3=A9 Lureau Signed-off-by: Marc-Andr=C3=A9 Lureau Acked-by: Cornelia Huck Reviewed-by: Markus Armbruster Signed-off-by: Markus Armbruster Message-Id: <20190214152251.2073-12-armbru@redhat.com> --- qapi/target.json | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/qapi/target.json b/qapi/target.json index 17671d77c1..010df35ebb 100644 --- a/qapi/target.json +++ b/qapi/target.json @@ -275,6 +275,9 @@ # an unknown cpu definition name, unknown properties or properties # with wrong types. # +# Note: this command isn't specific to s390x, but is only implemented +# on this architecture currently. +# # Since: 2.8.0 ## { 'command': 'query-cpu-model-comparison', @@ -315,6 +318,9 @@ # an unknown cpu definition name, unknown properties or properties # with wrong types. # +# Note: this command isn't specific to s390x, but is only implemented +# on this architecture currently. +# # Since: 2.8.0 ## { 'command': 'query-cpu-model-baseline', --=20 2.17.2 From nobody Mon May 6 10:03:50 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zoho.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.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 209.51.188.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 (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1550499854953114.58765920193594; Mon, 18 Feb 2019 06:24:14 -0800 (PST) Received: from localhost ([127.0.0.1]:59345 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1gvjq7-0007eb-SJ for importer@patchew.org; Mon, 18 Feb 2019 09:24:11 -0500 Received: from eggs.gnu.org ([209.51.188.92]:60112) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1gvjZ0-00024J-Ay for qemu-devel@nongnu.org; Mon, 18 Feb 2019 09:06:31 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1gvjYu-0005X5-TP for qemu-devel@nongnu.org; Mon, 18 Feb 2019 09:06:28 -0500 Received: from mx1.redhat.com ([209.132.183.28]:50870) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1gvjYs-0005UQ-Li for qemu-devel@nongnu.org; Mon, 18 Feb 2019 09:06:24 -0500 Received: from smtp.corp.redhat.com (int-mx05.intmail.prod.int.phx2.redhat.com [10.5.11.15]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id CB6A1C010930 for ; Mon, 18 Feb 2019 14:06:18 +0000 (UTC) Received: from blackfin.pond.sub.org (ovpn-116-92.ams2.redhat.com [10.36.116.92]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 267625D71A; Mon, 18 Feb 2019 14:06:11 +0000 (UTC) Received: by blackfin.pond.sub.org (Postfix, from userid 1000) id 2B1A41132BD8; Mon, 18 Feb 2019 15:06:08 +0100 (CET) From: Markus Armbruster To: qemu-devel@nongnu.org Date: Mon, 18 Feb 2019 15:06:01 +0100 Message-Id: <20190218140607.31998-13-armbru@redhat.com> In-Reply-To: <20190218140607.31998-1-armbru@redhat.com> References: <20190218140607.31998-1-armbru@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.15 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.31]); Mon, 18 Feb 2019 14:06:18 +0000 (UTC) Content-Transfer-Encoding: quoted-printable X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 209.132.183.28 Subject: [Qemu-devel] [PULL 12/18] qapi: make query-gic-capabilities depend on TARGET_ARM 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?= Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" Content-Type: text/plain; charset="utf-8" From: Marc-Andr=C3=A9 Lureau Signed-off-by: Marc-Andr=C3=A9 Lureau Reviewed-by: Markus Armbruster Signed-off-by: Markus Armbruster Message-Id: <20190214152251.2073-13-armbru@redhat.com> --- monitor.c | 11 ----------- qapi/misc.json | 43 ------------------------------------------ qapi/target.json | 45 ++++++++++++++++++++++++++++++++++++++++++++ target/arm/monitor.c | 2 +- 4 files changed, 46 insertions(+), 55 deletions(-) diff --git a/monitor.c b/monitor.c index 621e26cc94..33a0d81677 100644 --- a/monitor.c +++ b/monitor.c @@ -1145,9 +1145,6 @@ static void qmp_query_qmp_schema(QDict *qdict, QObjec= t **ret_data, */ static void qmp_unregister_commands_hack(void) { -#ifndef TARGET_ARM - qmp_unregister_command(&qmp_commands, "query-gic-capabilities"); -#endif #if !defined(TARGET_S390X) && !defined(TARGET_I386) qmp_unregister_command(&qmp_commands, "query-cpu-model-expansion"); #endif @@ -4657,14 +4654,6 @@ QemuOptsList qemu_mon_opts =3D { }, }; =20 -#ifndef TARGET_ARM -GICCapabilityList *qmp_query_gic_capabilities(Error **errp) -{ - error_setg(errp, QERR_FEATURE_DISABLED, "query-gic-capabilities"); - return NULL; -} -#endif - HotpluggableCPUList *qmp_query_hotpluggable_cpus(Error **errp) { MachineState *ms =3D MACHINE(qdev_get_machine()); diff --git a/qapi/misc.json b/qapi/misc.json index 431de64590..9df45a27ca 100644 --- a/qapi/misc.json +++ b/qapi/misc.json @@ -3044,49 +3044,6 @@ ## { 'command': 'xen-load-devices-state', 'data': {'filename': 'str'} } =20 -## -# @GICCapability: -# -# The struct describes capability for a specific GIC (Generic -# Interrupt Controller) version. These bits are not only decided by -# QEMU/KVM software version, but also decided by the hardware that -# the program is running upon. -# -# @version: version of GIC to be described. Currently, only 2 and 3 -# are supported. -# -# @emulated: whether current QEMU/hardware supports emulated GIC -# device in user space. -# -# @kernel: whether current QEMU/hardware supports hardware -# accelerated GIC device in kernel. -# -# Since: 2.6 -## -{ 'struct': 'GICCapability', - 'data': { 'version': 'int', - 'emulated': 'bool', - 'kernel': 'bool' } } - -## -# @query-gic-capabilities: -# -# This command is ARM-only. It will return a list of GICCapability -# objects that describe its capability bits. -# -# Returns: a list of GICCapability objects. -# -# Since: 2.6 -# -# Example: -# -# -> { "execute": "query-gic-capabilities" } -# <- { "return": [{ "version": 2, "emulated": true, "kernel": false }, -# { "version": 3, "emulated": false, "kernel": true } ] } -# -## -{ 'command': 'query-gic-capabilities', 'returns': ['GICCapability'] } - ## # @CpuInstanceProperties: # diff --git a/qapi/target.json b/qapi/target.json index 010df35ebb..f4a7054921 100644 --- a/qapi/target.json +++ b/qapi/target.json @@ -328,3 +328,48 @@ 'modelb': 'CpuModelInfo' }, 'returns': 'CpuModelBaselineInfo', 'if': 'defined(TARGET_S390X)' } + +## +# @GICCapability: +# +# The struct describes capability for a specific GIC (Generic +# Interrupt Controller) version. These bits are not only decided by +# QEMU/KVM software version, but also decided by the hardware that +# the program is running upon. +# +# @version: version of GIC to be described. Currently, only 2 and 3 +# are supported. +# +# @emulated: whether current QEMU/hardware supports emulated GIC +# device in user space. +# +# @kernel: whether current QEMU/hardware supports hardware +# accelerated GIC device in kernel. +# +# Since: 2.6 +## +{ 'struct': 'GICCapability', + 'data': { 'version': 'int', + 'emulated': 'bool', + 'kernel': 'bool' }, + 'if': 'defined(TARGET_ARM)' } + +## +# @query-gic-capabilities: +# +# This command is ARM-only. It will return a list of GICCapability +# objects that describe its capability bits. +# +# Returns: a list of GICCapability objects. +# +# Since: 2.6 +# +# Example: +# +# -> { "execute": "query-gic-capabilities" } +# <- { "return": [{ "version": 2, "emulated": true, "kernel": false }, +# { "version": 3, "emulated": false, "kernel": true } ] } +# +## +{ 'command': 'query-gic-capabilities', 'returns': ['GICCapability'], + 'if': 'defined(TARGET_ARM)' } diff --git a/target/arm/monitor.c b/target/arm/monitor.c index 4cdd2676dd..41b32b94b2 100644 --- a/target/arm/monitor.c +++ b/target/arm/monitor.c @@ -23,7 +23,7 @@ #include "qemu/osdep.h" #include "hw/boards.h" #include "kvm_arm.h" -#include "qapi/qapi-commands-misc.h" +#include "qapi/qapi-commands-target.h" =20 static GICCapability *gic_cap_new(int version) { --=20 2.17.2 From nobody Mon May 6 10:03:50 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zoho.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.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 209.51.188.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 (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1550500045409397.222041798591; Mon, 18 Feb 2019 06:27:25 -0800 (PST) Received: from localhost ([127.0.0.1]:59410 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1gvjtC-0001qk-7x for importer@patchew.org; Mon, 18 Feb 2019 09:27:22 -0500 Received: from eggs.gnu.org ([209.51.188.92]:60014) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1gvjYu-0001yB-S6 for qemu-devel@nongnu.org; Mon, 18 Feb 2019 09:06:28 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1gvjYm-0005Rm-Fr for qemu-devel@nongnu.org; Mon, 18 Feb 2019 09:06:24 -0500 Received: from mx1.redhat.com ([209.132.183.28]:15221) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1gvjYk-0005PA-8H for qemu-devel@nongnu.org; Mon, 18 Feb 2019 09:06:16 -0500 Received: from smtp.corp.redhat.com (int-mx07.intmail.prod.int.phx2.redhat.com [10.5.11.22]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 89724811AC for ; Mon, 18 Feb 2019 14:06:11 +0000 (UTC) Received: from blackfin.pond.sub.org (ovpn-116-92.ams2.redhat.com [10.36.116.92]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 2A0DC1001F52; Mon, 18 Feb 2019 14:06:11 +0000 (UTC) Received: by blackfin.pond.sub.org (Postfix, from userid 1000) id 2BCE51132B6B; Mon, 18 Feb 2019 15:06:08 +0100 (CET) From: Markus Armbruster To: qemu-devel@nongnu.org Date: Mon, 18 Feb 2019 15:06:02 +0100 Message-Id: <20190218140607.31998-14-armbru@redhat.com> In-Reply-To: <20190218140607.31998-1-armbru@redhat.com> References: <20190218140607.31998-1-armbru@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.84 on 10.5.11.22 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.27]); Mon, 18 Feb 2019 14:06:11 +0000 (UTC) Content-Transfer-Encoding: quoted-printable X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 209.132.183.28 Subject: [Qemu-devel] [PULL 13/18] qapi: make query-cpu-model-expansion depend on s390 or x86 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?= Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" Content-Type: text/plain; charset="utf-8" From: Marc-Andr=C3=A9 Lureau Signed-off-by: Marc-Andr=C3=A9 Lureau Reviewed-by: Eduardo Habkost Acked-by: Cornelia Huck Reviewed-by: Markus Armbruster Signed-off-by: Markus Armbruster Message-Id: <20190214152251.2073-14-armbru@redhat.com> --- include/sysemu/arch_init.h | 3 -- monitor.c | 3 -- qapi/misc.json | 51 ------------------------- qapi/target.json | 52 ++++++++++++++++++++++++++ qmp.c | 7 ---- stubs/Makefile.objs | 1 - stubs/arch-query-cpu-model-expansion.c | 13 ------- target/i386/cpu.c | 5 ++- target/s390x/cpu_models.c | 2 +- 9 files changed, 57 insertions(+), 80 deletions(-) delete mode 100644 stubs/arch-query-cpu-model-expansion.c diff --git a/include/sysemu/arch_init.h b/include/sysemu/arch_init.h index f0ef652b2a..2497fd3351 100644 --- a/include/sysemu/arch_init.h +++ b/include/sysemu/arch_init.h @@ -33,7 +33,4 @@ int kvm_available(void); int xen_available(void); =20 CpuDefinitionInfoList *arch_query_cpu_definitions(Error **errp); -CpuModelExpansionInfo *arch_query_cpu_model_expansion(CpuModelExpansionTyp= e type, - CpuModelInfo *mode, - Error **errp); #endif diff --git a/monitor.c b/monitor.c index 33a0d81677..22a551b16b 100644 --- a/monitor.c +++ b/monitor.c @@ -1145,9 +1145,6 @@ static void qmp_query_qmp_schema(QDict *qdict, QObjec= t **ret_data, */ static void qmp_unregister_commands_hack(void) { -#if !defined(TARGET_S390X) && !defined(TARGET_I386) - qmp_unregister_command(&qmp_commands, "query-cpu-model-expansion"); -#endif #if !defined(TARGET_PPC) && !defined(TARGET_ARM) && !defined(TARGET_I386) \ && !defined(TARGET_S390X) qmp_unregister_command(&qmp_commands, "query-cpu-definitions"); diff --git a/qapi/misc.json b/qapi/misc.json index 9df45a27ca..1255201267 100644 --- a/qapi/misc.json +++ b/qapi/misc.json @@ -2199,57 +2199,6 @@ 'data': [ 'static', 'full' ] } =20 =20 -## -# @CpuModelExpansionInfo: -# -# The result of a cpu model expansion. -# -# @model: the expanded CpuModelInfo. -# -# Since: 2.8.0 -## -{ 'struct': 'CpuModelExpansionInfo', - 'data': { 'model': 'CpuModelInfo' } } - - -## -# @query-cpu-model-expansion: -# -# Expands a given CPU model (or a combination of CPU model + additional op= tions) -# to different granularities, allowing tooling to get an understanding wha= t a -# specific CPU model looks like in QEMU under a certain configuration. -# -# This interface can be used to query the "host" CPU model. -# -# The data returned by this command may be affected by: -# -# * QEMU version: CPU models may look different depending on the QEMU vers= ion. -# (Except for CPU models reported as "static" in query-cpu-definitions.) -# * machine-type: CPU model may look different depending on the machine-t= ype. -# (Except for CPU models reported as "static" in query-cpu-definitions.) -# * machine options (including accelerator): in some architectures, CPU mo= dels -# may look different depending on machine and accelerator options. (Exce= pt for -# CPU models reported as "static" in query-cpu-definitions.) -# * "-cpu" arguments and global properties: arguments to the -cpu option a= nd -# global properties may affect expansion of CPU models. Using -# query-cpu-model-expansion while using these is not advised. -# -# Some architectures may not support all expansion types. s390x supports -# "full" and "static". -# -# Returns: a CpuModelExpansionInfo. Returns an error if expanding CPU mode= ls is -# not supported, if the model cannot be expanded, if the model co= ntains -# an unknown CPU definition name, unknown properties or properties -# with a wrong type. Also returns an error if an expansion type is -# not supported. -# -# Since: 2.8.0 -## -{ 'command': 'query-cpu-model-expansion', - 'data': { 'type': 'CpuModelExpansionType', - 'model': 'CpuModelInfo' }, - 'returns': 'CpuModelExpansionInfo' } - ## # @CpuModelCompareResult: # diff --git a/qapi/target.json b/qapi/target.json index f4a7054921..35653648bb 100644 --- a/qapi/target.json +++ b/qapi/target.json @@ -373,3 +373,55 @@ ## { 'command': 'query-gic-capabilities', 'returns': ['GICCapability'], 'if': 'defined(TARGET_ARM)' } + +## +# @CpuModelExpansionInfo: +# +# The result of a cpu model expansion. +# +# @model: the expanded CpuModelInfo. +# +# Since: 2.8.0 +## +{ 'struct': 'CpuModelExpansionInfo', + 'data': { 'model': 'CpuModelInfo' }, + 'if': 'defined(TARGET_S390X) || defined(TARGET_I386)' } + +## +# @query-cpu-model-expansion: +# +# Expands a given CPU model (or a combination of CPU model + additional op= tions) +# to different granularities, allowing tooling to get an understanding wha= t a +# specific CPU model looks like in QEMU under a certain configuration. +# +# This interface can be used to query the "host" CPU model. +# +# The data returned by this command may be affected by: +# +# * QEMU version: CPU models may look different depending on the QEMU vers= ion. +# (Except for CPU models reported as "static" in query-cpu-definitions.) +# * machine-type: CPU model may look different depending on the machine-t= ype. +# (Except for CPU models reported as "static" in query-cpu-definitions.) +# * machine options (including accelerator): in some architectures, CPU mo= dels +# may look different depending on machine and accelerator options. (Exce= pt for +# CPU models reported as "static" in query-cpu-definitions.) +# * "-cpu" arguments and global properties: arguments to the -cpu option a= nd +# global properties may affect expansion of CPU models. Using +# query-cpu-model-expansion while using these is not advised. +# +# Some architectures may not support all expansion types. s390x supports +# "full" and "static". +# +# Returns: a CpuModelExpansionInfo. Returns an error if expanding CPU mode= ls is +# not supported, if the model cannot be expanded, if the model co= ntains +# an unknown CPU definition name, unknown properties or properties +# with a wrong type. Also returns an error if an expansion type is +# not supported. +# +# Since: 2.8.0 +## +{ 'command': 'query-cpu-model-expansion', + 'data': { 'type': 'CpuModelExpansionType', + 'model': 'CpuModelInfo' }, + 'returns': 'CpuModelExpansionInfo', + 'if': 'defined(TARGET_S390X) || defined(TARGET_I386)' } diff --git a/qmp.c b/qmp.c index 8a613bf7c7..c81af9d23f 100644 --- a/qmp.c +++ b/qmp.c @@ -610,13 +610,6 @@ CpuDefinitionInfoList *qmp_query_cpu_definitions(Error= **errp) return arch_query_cpu_definitions(errp); } =20 -CpuModelExpansionInfo *qmp_query_cpu_model_expansion(CpuModelExpansionType= type, - CpuModelInfo *model, - Error **errp) -{ - return arch_query_cpu_model_expansion(type, model, 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/Makefile.objs b/stubs/Makefile.objs index 8394a079d1..f337208179 100644 --- a/stubs/Makefile.objs +++ b/stubs/Makefile.objs @@ -1,5 +1,4 @@ stub-obj-y +=3D arch-query-cpu-def.o -stub-obj-y +=3D arch-query-cpu-model-expansion.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 diff --git a/stubs/arch-query-cpu-model-expansion.c b/stubs/arch-query-cpu-= model-expansion.c deleted file mode 100644 index 26273a8b10..0000000000 --- a/stubs/arch-query-cpu-model-expansion.c +++ /dev/null @@ -1,13 +0,0 @@ -#include "qemu/osdep.h" -#include "qemu-common.h" -#include "sysemu/arch_init.h" -#include "qapi/error.h" -#include "qapi/qmp/qerror.h" - -CpuModelExpansionInfo *arch_query_cpu_model_expansion(CpuModelExpansionTyp= e type, - CpuModelInfo *mode, - Error **errp) -{ - error_setg(errp, QERR_UNSUPPORTED); - return NULL; -} diff --git a/target/i386/cpu.c b/target/i386/cpu.c index b077196611..aa3a1f3a4f 100644 --- a/target/i386/cpu.c +++ b/target/i386/cpu.c @@ -41,6 +41,7 @@ #include "qapi/visitor.h" #include "qom/qom-qobject.h" #include "sysemu/arch_init.h" +#include "qapi/qapi-commands-target.h" =20 #include "standard-headers/asm-x86/kvm_para.h" =20 @@ -3918,6 +3919,7 @@ static void x86_cpu_load_def(X86CPU *cpu, X86CPUDefin= ition *def, Error **errp) =20 } =20 +#ifndef CONFIG_USER_ONLY /* Return a QDict containing keys for all properties that can be included * in static expansion of CPU models. All properties set by x86_cpu_load_d= ef() * must be included in the dictionary. @@ -4065,7 +4067,7 @@ out: } =20 CpuModelExpansionInfo * -arch_query_cpu_model_expansion(CpuModelExpansionType type, +qmp_query_cpu_model_expansion(CpuModelExpansionType type, CpuModelInfo *model, Error **errp) { @@ -4120,6 +4122,7 @@ out: } return ret; } +#endif /* !CONFIG_USER_ONLY */ =20 static gchar *x86_gdb_arch_name(CPUState *cs) { diff --git a/target/s390x/cpu_models.c b/target/s390x/cpu_models.c index b532cd8d10..cf87488bfc 100644 --- a/target/s390x/cpu_models.c +++ b/target/s390x/cpu_models.c @@ -567,7 +567,7 @@ static void cpu_info_from_model(CpuModelInfo *info, con= st S390CPUModel *model, } } =20 -CpuModelExpansionInfo *arch_query_cpu_model_expansion(CpuModelExpansionTyp= e type, +CpuModelExpansionInfo *qmp_query_cpu_model_expansion(CpuModelExpansionType= type, CpuModelInfo *model, Error **errp) { --=20 2.17.2 From nobody Mon May 6 10:03:50 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zoho.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.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 209.51.188.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 (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1550500397648571.1124012502286; Mon, 18 Feb 2019 06:33:17 -0800 (PST) Received: from localhost ([127.0.0.1]:59514 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1gvjyr-0006qG-Hp for importer@patchew.org; Mon, 18 Feb 2019 09:33:13 -0500 Received: from eggs.gnu.org ([209.51.188.92]:60018) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1gvjYu-0001yD-SX for qemu-devel@nongnu.org; Mon, 18 Feb 2019 09:06:35 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1gvjYm-0005Rt-G7 for qemu-devel@nongnu.org; Mon, 18 Feb 2019 09:06:24 -0500 Received: from mx1.redhat.com ([209.132.183.28]:38050) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1gvjYm-0005PF-3q for qemu-devel@nongnu.org; Mon, 18 Feb 2019 09:06:16 -0500 Received: from smtp.corp.redhat.com (int-mx07.intmail.prod.int.phx2.redhat.com [10.5.11.22]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id B90492D7FF for ; Mon, 18 Feb 2019 14:06:11 +0000 (UTC) Received: from blackfin.pond.sub.org (ovpn-116-92.ams2.redhat.com [10.36.116.92]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 301751024968; Mon, 18 Feb 2019 14:06:11 +0000 (UTC) Received: by blackfin.pond.sub.org (Postfix, from userid 1000) id 2F3AC1132B2C; Mon, 18 Feb 2019 15:06:08 +0100 (CET) From: Markus Armbruster To: qemu-devel@nongnu.org Date: Mon, 18 Feb 2019 15:06:03 +0100 Message-Id: <20190218140607.31998-15-armbru@redhat.com> In-Reply-To: <20190218140607.31998-1-armbru@redhat.com> References: <20190218140607.31998-1-armbru@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.84 on 10.5.11.22 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.30]); Mon, 18 Feb 2019 14:06:11 +0000 (UTC) Content-Transfer-Encoding: quoted-printable X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 209.132.183.28 Subject: [Qemu-devel] [PULL 14/18] 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?= Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" Content-Type: text/plain; charset="utf-8" From: Marc-Andr=C3=A9 Lureau 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 Reviewed-by: Markus Armbruster Signed-off-by: Markus Armbruster Message-Id: <20190214152251.2073-15-armbru@redhat.com> --- include/sysemu/arch_init.h | 1 - monitor.c | 22 ------------ qapi/misc.json | 58 ------------------------------ qapi/target.json | 64 +++++++++++++++++++++++++++++++++ qmp.c | 5 --- stubs/Makefile.objs | 1 - stubs/arch-query-cpu-def.c | 11 ------ target/arm/helper.c | 3 +- target/i386/cpu.c | 2 +- target/ppc/translate_init.inc.c | 3 +- target/s390x/cpu_models.c | 2 +- 11 files changed, 70 insertions(+), 102 deletions(-) delete mode 100644 stubs/arch-query-cpu-def.c 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 22a551b16b..1673db7015 100644 --- a/monitor.c +++ b/monitor.c @@ -1131,26 +1131,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) { /* @@ -1169,8 +1149,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_ALLOW_PRECONFIG= ); diff --git a/qapi/misc.json b/qapi/misc.json index 1255201267..82f9147353 100644 --- a/qapi/misc.json +++ b/qapi/misc.json @@ -2057,54 +2057,6 @@ ## { 'command': 'query-current-machine', 'returns': 'CurrentMachineParams' } =20 -## -# @CpuDefinitionInfo: -# -# Virtual CPU definition. -# -# @name: the name of the CPU definition -# -# @migration-safe: whether a CPU definition can be safely used for -# migration in combination with a QEMU compatibility mach= ine -# when migrating between different QEMU versions and betw= een -# hosts with different sets of (hardware or software) -# capabilities. If not provided, information is not avail= able -# and callers should not assume the CPU definition to be -# migration-safe. (since 2.8) -# -# @static: whether a CPU definition is static and will not change dependin= g on -# QEMU version, machine type, machine options and accelerator opt= ions. -# A static model is always migration-safe. (since 2.8) -# -# @unavailable-features: List of properties that prevent -# the CPU model from running in the current -# host. (since 2.8) -# @typename: Type name that can be used as argument to @device-list-proper= ties, -# to introspect properties configurable using -cpu or -global. -# (since 2.9) -# -# @unavailable-features is a list of QOM property names that -# represent CPU model attributes that prevent the CPU from running. -# If the QOM property is read-only, that means there's no known -# way to make the CPU model run in the current host. Implementations -# that choose not to provide specific information return the -# property name "type". -# If the property is read-write, it means that it MAY be possible -# to run the CPU model in the current host if that property is -# changed. Management software can use it as hints to suggest or -# choose an alternative for the user, or just to generate meaningful -# error messages explaining why the CPU model can't be used. -# If @unavailable-features is an empty list, the CPU model is -# runnable using the current host and machine-type. -# If @unavailable-features is not present, runnability -# information for the CPU is not available. -# -# Since: 1.2.0 -## -{ 'struct': 'CpuDefinitionInfo', - 'data': { 'name': 'str', '*migration-safe': 'bool', 'static': 'bool', - '*unavailable-features': [ 'str' ], 'typename': 'str' } } - ## # @MemoryInfo: # @@ -2137,16 +2089,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 35653648bb..5c41a0aee7 100644 --- a/qapi/target.json +++ b/qapi/target.json @@ -425,3 +425,67 @@ 'model': 'CpuModelInfo' }, 'returns': 'CpuModelExpansionInfo', 'if': 'defined(TARGET_S390X) || defined(TARGET_I386)' } + +## +# @CpuDefinitionInfo: +# +# Virtual CPU definition. +# +# @name: the name of the CPU definition +# +# @migration-safe: whether a CPU definition can be safely used for +# migration in combination with a QEMU compatibility mach= ine +# when migrating between different QEMU versions and betw= een +# hosts with different sets of (hardware or software) +# capabilities. If not provided, information is not avail= able +# and callers should not assume the CPU definition to be +# migration-safe. (since 2.8) +# +# @static: whether a CPU definition is static and will not change dependin= g on +# QEMU version, machine type, machine options and accelerator opt= ions. +# A static model is always migration-safe. (since 2.8) +# +# @unavailable-features: List of properties that prevent +# the CPU model from running in the current +# host. (since 2.8) +# @typename: Type name that can be used as argument to @device-list-proper= ties, +# to introspect properties configurable using -cpu or -global. +# (since 2.9) +# +# @unavailable-features is a list of QOM property names that +# represent CPU model attributes that prevent the CPU from running. +# If the QOM property is read-only, that means there's no known +# way to make the CPU model run in the current host. Implementations +# that choose not to provide specific information return the +# property name "type". +# If the property is read-write, it means that it MAY be possible +# to run the CPU model in the current host if that property is +# changed. Management software can use it as hints to suggest or +# choose an alternative for the user, or just to generate meaningful +# error messages explaining why the CPU model can't be used. +# If @unavailable-features is an empty list, the CPU model is +# runnable using the current host and machine-type. +# If @unavailable-features is not present, runnability +# information for the CPU is not available. +# +# Since: 1.2.0 +## +{ 'struct': 'CpuDefinitionInfo', + 'data': { 'name': 'str', + '*migration-safe': 'bool', + 'static': 'bool', + '*unavailable-features': [ 'str' ], + 'typename': 'str' }, + 'if': 'defined(TARGET_PPC) || defined(TARGET_ARM) || defined(TARGET_I386= ) || defined(TARGET_S390X)' } + +## +# @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/qmp.c b/qmp.c index c81af9d23f..b92d62cd5f 100644 --- a/qmp.c +++ b/qmp.c @@ -605,11 +605,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/Makefile.objs b/stubs/Makefile.objs index f337208179..269dfa5832 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 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 55e9b77bb1..a018eb23fe 100644 --- a/target/arm/helper.c +++ b/target/arm/helper.c @@ -19,6 +19,7 @@ #include "sysemu/kvm.h" #include "fpu/softfloat.h" #include "qemu/range.h" +#include "qapi/qapi-commands-target.h" =20 #define ARM_CPU_FREQ 1000000000 /* FIXME: 1 GHz, should be configurable */ =20 @@ -6733,7 +6734,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 aa3a1f3a4f..d3aa6a815b 100644 --- a/target/i386/cpu.c +++ b/target/i386/cpu.c @@ -3791,7 +3791,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.inc.c b/target/ppc/translate_init.in= c.c index 59e0b86762..f393a408ac 100644 --- a/target/ppc/translate_init.inc.c +++ b/target/ppc/translate_init.inc.c @@ -38,6 +38,7 @@ #include "qemu/cutils.h" #include "disas/capstone.h" #include "fpu/softfloat.h" +#include "qapi/qapi-commands-target.h" =20 //#define PPC_DUMP_CPU //#define PPC_DEBUG_SPR @@ -10201,7 +10202,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 cf87488bfc..5ef34abbf1 100644 --- a/target/s390x/cpu_models.c +++ b/target/s390x/cpu_models.c @@ -433,7 +433,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, --=20 2.17.2 From nobody Mon May 6 10:03:50 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zoho.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.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 209.51.188.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 (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1550499478836474.93901400470054; Mon, 18 Feb 2019 06:17:58 -0800 (PST) Received: from localhost ([127.0.0.1]:59267 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1gvjk3-00030U-N9 for importer@patchew.org; Mon, 18 Feb 2019 09:17:55 -0500 Received: from eggs.gnu.org ([209.51.188.92]:59945) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1gvjYo-0001r5-VX for qemu-devel@nongnu.org; Mon, 18 Feb 2019 09:06:21 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1gvjYm-0005SN-QQ for qemu-devel@nongnu.org; Mon, 18 Feb 2019 09:06:18 -0500 Received: from mx1.redhat.com ([209.132.183.28]:12657) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1gvjYm-0005PW-Ca for qemu-devel@nongnu.org; Mon, 18 Feb 2019 09:06:16 -0500 Received: from smtp.corp.redhat.com (int-mx07.intmail.prod.int.phx2.redhat.com [10.5.11.22]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id B22CAA0B5A for ; Mon, 18 Feb 2019 14:06:12 +0000 (UTC) Received: from blackfin.pond.sub.org (ovpn-116-92.ams2.redhat.com [10.36.116.92]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 6E28B1024968; Mon, 18 Feb 2019 14:06:12 +0000 (UTC) Received: by blackfin.pond.sub.org (Postfix, from userid 1000) id 32C1B11327AF; Mon, 18 Feb 2019 15:06:08 +0100 (CET) From: Markus Armbruster To: qemu-devel@nongnu.org Date: Mon, 18 Feb 2019 15:06:04 +0100 Message-Id: <20190218140607.31998-16-armbru@redhat.com> In-Reply-To: <20190218140607.31998-1-armbru@redhat.com> References: <20190218140607.31998-1-armbru@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.84 on 10.5.11.22 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.26]); Mon, 18 Feb 2019 14:06:12 +0000 (UTC) Content-Transfer-Encoding: quoted-printable X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 209.132.183.28 Subject: [Qemu-devel] [PULL 15/18] qapi: remove qmp_unregister_command() 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?= Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" Content-Type: text/plain; charset="utf-8" From: Marc-Andr=C3=A9 Lureau This command is no longer needed, the schema has compile-time configuration conditions. Signed-off-by: Marc-Andr=C3=A9 Lureau Reviewed-by: Markus Armbruster Signed-off-by: Markus Armbruster Message-Id: <20190214152251.2073-16-armbru@redhat.com> --- include/qapi/qmp/dispatch.h | 1 - qapi/qmp-registry.c | 8 -------- 2 files changed, 9 deletions(-) diff --git a/include/qapi/qmp/dispatch.h b/include/qapi/qmp/dispatch.h index 68a528a9aa..9aa426a398 100644 --- a/include/qapi/qmp/dispatch.h +++ b/include/qapi/qmp/dispatch.h @@ -39,7 +39,6 @@ typedef QTAILQ_HEAD(QmpCommandList, QmpCommand) QmpComman= dList; =20 void qmp_register_command(QmpCommandList *cmds, const char *name, QmpCommandFunc *fn, QmpCommandOptions options); -void qmp_unregister_command(QmpCommandList *cmds, const char *name); QmpCommand *qmp_find_command(QmpCommandList *cmds, const char *name); void qmp_disable_command(QmpCommandList *cmds, const char *name); void qmp_enable_command(QmpCommandList *cmds, const char *name); diff --git a/qapi/qmp-registry.c b/qapi/qmp-registry.c index 5af484cd9a..ca00f74795 100644 --- a/qapi/qmp-registry.c +++ b/qapi/qmp-registry.c @@ -27,14 +27,6 @@ void qmp_register_command(QmpCommandList *cmds, const ch= ar *name, QTAILQ_INSERT_TAIL(cmds, cmd, node); } =20 -void qmp_unregister_command(QmpCommandList *cmds, const char *name) -{ - QmpCommand *cmd =3D qmp_find_command(cmds, name); - - QTAILQ_REMOVE(cmds, cmd, node); - g_free(cmd); -} - QmpCommand *qmp_find_command(QmpCommandList *cmds, const char *name) { QmpCommand *cmd; --=20 2.17.2 From nobody Mon May 6 10:03:50 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zoho.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.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 209.51.188.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 (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 155049929557797.28147660185766; Mon, 18 Feb 2019 06:14:55 -0800 (PST) Received: from localhost ([127.0.0.1]:59212 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1gvjh5-0000UK-Gk for importer@patchew.org; Mon, 18 Feb 2019 09:14:51 -0500 Received: from eggs.gnu.org ([209.51.188.92]:59935) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1gvjYo-0001qs-Ih for qemu-devel@nongnu.org; Mon, 18 Feb 2019 09:06:21 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1gvjYm-0005Rz-Ju for qemu-devel@nongnu.org; Mon, 18 Feb 2019 09:06:18 -0500 Received: from mx1.redhat.com ([209.132.183.28]:47144) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1gvjYm-0005PV-95 for qemu-devel@nongnu.org; Mon, 18 Feb 2019 09:06:16 -0500 Received: from smtp.corp.redhat.com (int-mx07.intmail.prod.int.phx2.redhat.com [10.5.11.22]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id B0EAD86663 for ; Mon, 18 Feb 2019 14:06:12 +0000 (UTC) Received: from blackfin.pond.sub.org (ovpn-116-92.ams2.redhat.com [10.36.116.92]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 71F051048102 for ; Mon, 18 Feb 2019 14:06:12 +0000 (UTC) Received: by blackfin.pond.sub.org (Postfix, from userid 1000) id 36701113274D; Mon, 18 Feb 2019 15:06:08 +0100 (CET) From: Markus Armbruster To: qemu-devel@nongnu.org Date: Mon, 18 Feb 2019 15:06:05 +0100 Message-Id: <20190218140607.31998-17-armbru@redhat.com> In-Reply-To: <20190218140607.31998-1-armbru@redhat.com> References: <20190218140607.31998-1-armbru@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.84 on 10.5.11.22 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.26]); Mon, 18 Feb 2019 14:06:12 +0000 (UTC) Content-Transfer-Encoding: quoted-printable X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 209.132.183.28 Subject: [Qemu-devel] [PULL 16/18] Revert "qapi-events: add 'if' condition to implicit event enum" 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: , Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" Content-Type: text/plain; charset="utf-8" This reverts commit 7bd263490590ee6fcf34ecb6203437e22f6e5a9c. The commit applied the events' conditions to the members of enum QAPIEvent. Awkward, because it renders QAPIEvent unusable in target-independent code as soon as we make an event target-dependent. Reverting this has the following effects: * ui/vnc.c can remain target independent. * monitor_qapi_event_conf[] doesn't have to muck around with #ifdef. * query-events again doesn't reflect conditionals. I'm going to deprecate it in favor of query-qmp-schema. Another option would be to split target-dependent parts off enum QAPIEvent into a target-dependent enum. Doesn't seem worthwhile right now. Signed-off-by: Markus Armbruster Reviewed-by: Marc-Andr=C3=A9 Lureau Message-Id: <20190214152251.2073-17-armbru@redhat.com> --- scripts/qapi/events.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/scripts/qapi/events.py b/scripts/qapi/events.py index 28bbc3745d..2067660be4 100644 --- a/scripts/qapi/events.py +++ b/scripts/qapi/events.py @@ -193,7 +193,9 @@ void %(event_emit)s(%(event_enum)s event, QDict *qdict); self._genc.add(gen_event_send(name, arg_type, boxed, self._event_enum_name, self._event_emit_name)) - self._event_enum_members.append(QAPISchemaMember(name, ifcond)) + # Note: we generate the enum member regardless of @ifcond, to + # keep the enumeration usable in target-independent code. + self._event_enum_members.append(QAPISchemaMember(name)) =20 =20 def gen_events(schema, output_dir, prefix): --=20 2.17.2 From nobody Mon May 6 10:03:50 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zoho.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.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 209.51.188.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 (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1550499293294348.1001361265885; Mon, 18 Feb 2019 06:14:53 -0800 (PST) Received: from localhost ([127.0.0.1]:59210 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1gvjh4-0000SE-8d for importer@patchew.org; Mon, 18 Feb 2019 09:14:50 -0500 Received: from eggs.gnu.org ([209.51.188.92]:59909) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1gvjYn-0001qp-Mc for qemu-devel@nongnu.org; Mon, 18 Feb 2019 09:06:20 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1gvjYm-0005RF-By for qemu-devel@nongnu.org; Mon, 18 Feb 2019 09:06:17 -0500 Received: from mx1.redhat.com ([209.132.183.28]:51866) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1gvjYk-0005PT-7Y for qemu-devel@nongnu.org; Mon, 18 Feb 2019 09:06:16 -0500 Received: from smtp.corp.redhat.com (int-mx01.intmail.prod.int.phx2.redhat.com [10.5.11.11]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id AB9F3C0C057C for ; Mon, 18 Feb 2019 14:06:12 +0000 (UTC) Received: from blackfin.pond.sub.org (ovpn-116-92.ams2.redhat.com [10.36.116.92]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 787B76013D for ; Mon, 18 Feb 2019 14:06:12 +0000 (UTC) Received: by blackfin.pond.sub.org (Postfix, from userid 1000) id 39D241132750; Mon, 18 Feb 2019 15:06:08 +0100 (CET) From: Markus Armbruster To: qemu-devel@nongnu.org Date: Mon, 18 Feb 2019 15:06:06 +0100 Message-Id: <20190218140607.31998-18-armbru@redhat.com> In-Reply-To: <20190218140607.31998-1-armbru@redhat.com> References: <20190218140607.31998-1-armbru@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.11 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.32]); Mon, 18 Feb 2019 14:06:12 +0000 (UTC) Content-Transfer-Encoding: quoted-printable X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 209.132.183.28 Subject: [Qemu-devel] [PULL 17/18] qmp: Deprecate query-events in favor of query-qmp-schema 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: , Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" Content-Type: text/plain; charset="utf-8" query-events doesn't reflect compile-time configuration. Instead of fixing that, deprecate the command in favor of query-qmp-schema. Libvirt prefers query-qmp-schema as of commit 22d7222ec0 "qemu: caps: Don't call 'query-events' when we probe events from QMP schema". It'll be in the next release. Signed-off-by: Markus Armbruster Reviewed-by: Marc-Andr=C3=A9 Lureau Message-Id: <20190214152251.2073-18-armbru@redhat.com> --- monitor.c | 5 +++++ qapi/misc.json | 7 +++++-- qemu-deprecated.texi | 5 +++++ 3 files changed, 15 insertions(+), 2 deletions(-) diff --git a/monitor.c b/monitor.c index 1673db7015..33ccbf3957 100644 --- a/monitor.c +++ b/monitor.c @@ -1099,6 +1099,11 @@ CommandInfoList *qmp_query_commands(Error **errp) =20 EventInfoList *qmp_query_events(Error **errp) { + /* + * TODO This deprecated command is the only user of + * QAPIEvent_str() and QAPIEvent_lookup[]. When the command goes, + * they should go, too. + */ EventInfoList *info, *ev_list =3D NULL; QAPIEvent e; =20 diff --git a/qapi/misc.json b/qapi/misc.json index 82f9147353..98f59f828a 100644 --- a/qapi/misc.json +++ b/qapi/misc.json @@ -318,12 +318,15 @@ ## # @query-events: # -# Return a list of supported QMP events by this server +# Return information on QMP events. # -# Returns: A list of @EventInfo for all supported events +# Returns: A list of @EventInfo. # # Since: 1.2.0 # +# Note: This command is deprecated, because its output doesn't reflect +# compile-time configuration. Use query-qmp-schema instead. +# # Example: # # -> { "execute": "query-events" } diff --git a/qemu-deprecated.texi b/qemu-deprecated.texi index fe905551c5..45c57952da 100644 --- a/qemu-deprecated.texi +++ b/qemu-deprecated.texi @@ -82,6 +82,11 @@ Use ``device_add'' for hotplugging vCPUs instead of ``cp= u-add''. See documentation of ``query-hotpluggable-cpus'' for additional details. =20 +@subsection query-events (since 4.0) + +The ``query-events'' command has been superseded by the more powerful +and accurate ``query-qmp-schema'' command. + @section Human Monitor Protocol (HMP) commands =20 @subsection The hub_id parameter of 'hostfwd_add' / 'hostfwd_remove' (sinc= e 3.1) --=20 2.17.2 From nobody Mon May 6 10:03:50 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zoho.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.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 209.51.188.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 (209.51.188.17 [209.51.188.17]) by mx.zohomail.com with SMTPS id 1550499608256802.3548698173718; Mon, 18 Feb 2019 06:20:08 -0800 (PST) Received: from localhost ([127.0.0.1]:59285 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1gvjm6-0004WB-5f for importer@patchew.org; Mon, 18 Feb 2019 09:20:02 -0500 Received: from eggs.gnu.org ([209.51.188.92]:60121) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1gvjZ0-00024Y-Bw for qemu-devel@nongnu.org; Mon, 18 Feb 2019 09:06:36 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1gvjYx-0005Zx-Lu for qemu-devel@nongnu.org; Mon, 18 Feb 2019 09:06:30 -0500 Received: from mx1.redhat.com ([209.132.183.28]:50934) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1gvjYw-0005Vb-4w for qemu-devel@nongnu.org; Mon, 18 Feb 2019 09:06:26 -0500 Received: from smtp.corp.redhat.com (int-mx08.intmail.prod.int.phx2.redhat.com [10.5.11.23]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id C9273C07014C for ; Mon, 18 Feb 2019 14:06:21 +0000 (UTC) Received: from blackfin.pond.sub.org (ovpn-116-92.ams2.redhat.com [10.36.116.92]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 7B576277A9; Mon, 18 Feb 2019 14:06:12 +0000 (UTC) Received: by blackfin.pond.sub.org (Postfix, from userid 1000) id 3D56F1132754; Mon, 18 Feb 2019 15:06:08 +0100 (CET) From: Markus Armbruster To: qemu-devel@nongnu.org Date: Mon, 18 Feb 2019 15:06:07 +0100 Message-Id: <20190218140607.31998-19-armbru@redhat.com> In-Reply-To: <20190218140607.31998-1-armbru@redhat.com> References: <20190218140607.31998-1-armbru@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.84 on 10.5.11.23 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.31]); Mon, 18 Feb 2019 14:06:21 +0000 (UTC) Content-Transfer-Encoding: quoted-printable X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 209.132.183.28 Subject: [Qemu-devel] [PULL 18/18] qapi: move RTC_CHANGE to the target schema 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?= Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" Content-Type: text/plain; charset="utf-8" From: Marc-Andr=C3=A9 Lureau A few targets don't emit RTC_CHANGE, we could restrict the event to the tagets that do emit it. Note: There is a lot more of events & commands that we could restrict to capable targets, with the cost of some additional complexity, but the benefit of added correctness and better introspection. Signed-off-by: Marc-Andr=C3=A9 Lureau Reviewed-by: Markus Armbruster Signed-off-by: Markus Armbruster Message-Id: <20190214152251.2073-19-armbru@redhat.com> --- hw/ppc/spapr_rtc.c | 2 +- hw/timer/mc146818rtc.c | 2 +- qapi/misc.json | 23 ----------------------- qapi/target.json | 23 +++++++++++++++++++++++ 4 files changed, 25 insertions(+), 25 deletions(-) diff --git a/hw/ppc/spapr_rtc.c b/hw/ppc/spapr_rtc.c index cd049f389d..eb95a7077d 100644 --- a/hw/ppc/spapr_rtc.c +++ b/hw/ppc/spapr_rtc.c @@ -31,7 +31,7 @@ #include "sysemu/sysemu.h" #include "hw/ppc/spapr.h" #include "qapi/error.h" -#include "qapi/qapi-events-misc.h" +#include "qapi/qapi-events-target.h" #include "qemu/cutils.h" =20 void spapr_rtc_read(sPAPRRTCState *rtc, struct tm *tm, uint32_t *ns) diff --git a/hw/timer/mc146818rtc.c b/hw/timer/mc146818rtc.c index bc1862b6fc..513f105e62 100644 --- a/hw/timer/mc146818rtc.c +++ b/hw/timer/mc146818rtc.c @@ -32,7 +32,7 @@ #include "hw/timer/mc146818rtc.h" #include "qapi/error.h" #include "qapi/qapi-commands-target.h" -#include "qapi/qapi-events-misc.h" +#include "qapi/qapi-events-target.h" #include "qapi/visitor.h" #include "exec/address-spaces.h" =20 diff --git a/qapi/misc.json b/qapi/misc.json index 98f59f828a..8b3ca4fdd3 100644 --- a/qapi/misc.json +++ b/qapi/misc.json @@ -2876,29 +2876,6 @@ { 'event': 'ACPI_DEVICE_OST', 'data': { 'info': 'ACPIOSTInfo' } } =20 -## -# @RTC_CHANGE: -# -# Emitted when the guest changes the RTC time. -# -# @offset: offset between base RTC clock (as specified by -rtc base), and -# new RTC clock value. Note that value will be different depending -# on clock chosen to drive RTC (specified by -rtc clock). -# -# Note: This event is rate-limited. -# -# Since: 0.13.0 -# -# Example: -# -# <- { "event": "RTC_CHANGE", -# "data": { "offset": 78 }, -# "timestamp": { "seconds": 1267020223, "microseconds": 435656 } } -# -## -{ 'event': 'RTC_CHANGE', - 'data': { 'offset': 'int' } } - ## # @ReplayMode: # diff --git a/qapi/target.json b/qapi/target.json index 5c41a0aee7..da7b4be51e 100644 --- a/qapi/target.json +++ b/qapi/target.json @@ -7,6 +7,29 @@ =20 { 'include': 'misc.json' } =20 +## +# @RTC_CHANGE: +# +# Emitted when the guest changes the RTC time. +# +# @offset: offset between base RTC clock (as specified by -rtc base), and +# new RTC clock value +# +# Note: This event is rate-limited. +# +# Since: 0.13.0 +# +# Example: +# +# <- { "event": "RTC_CHANGE", +# "data": { "offset": 78 }, +# "timestamp": { "seconds": 1267020223, "microseconds": 435656 } } +# +## +{ 'event': 'RTC_CHANGE', + 'data': { 'offset': 'int' }, + 'if': 'defined(TARGET_ALPHA) || defined(TARGET_ARM) || defined(TARGET_HP= PA) || defined(TARGET_I386) || defined(TARGET_MIPS) || defined(TARGET_MIPS6= 4) || defined(TARGET_MOXIE) || defined(TARGET_PPC) || defined(TARGET_PPC64)= || defined(TARGET_S390X) || defined(TARGET_SH4) || defined(TARGET_SPARC)' } + ## # @rtc-reset-reinjection: # --=20 2.17.2