qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: Pierrick Bouvier <pierrick.bouvier@linaro.org>
To: qemu-devel@nongnu.org
Cc: Pierrick Bouvier <pierrick.bouvier@linaro.org>,
	alex.bennee@linaro.org, stefanha@redhat.com,
	peter.maydell@linaro.org, Markus Armbruster <armbru@redhat.com>,
	richard.henderson@linaro.org, pbonzini@redhat.com,
	jsnow@redhat.com, philmd@linaro.org, berrange@redhat.com,
	thuth@redhat.com, Michael Roth <michael.roth@amd.com>
Subject: [PATCH 07/13] qapi: add access to qemu/target-info.h
Date: Wed,  7 May 2025 16:14:37 -0700	[thread overview]
Message-ID: <20250507231442.879619-8-pierrick.bouvier@linaro.org> (raw)
In-Reply-To: <20250507231442.879619-1-pierrick.bouvier@linaro.org>

Add a default include qemu/target-info.h in QAPI generated code. This
allows runtime conditionals to use any function defined in this header.

Signed-off-by: Pierrick Bouvier <pierrick.bouvier@linaro.org>
---
 scripts/qapi/commands.py   | 2 ++
 scripts/qapi/introspect.py | 1 +
 scripts/qapi/visit.py      | 2 ++
 3 files changed, 5 insertions(+)

diff --git a/scripts/qapi/commands.py b/scripts/qapi/commands.py
index 7b172f7c081..7776c84fe64 100644
--- a/scripts/qapi/commands.py
+++ b/scripts/qapi/commands.py
@@ -319,6 +319,7 @@ def _begin_user_module(self, name: str) -> None:
         visit = self._module_basename('qapi-visit', name)
         self._genc.add(mcgen('''
 #include "qemu/osdep.h"
+#include "qemu/target-info.h"
 #include "qapi/compat-policy.h"
 #include "qapi/visitor.h"
 #include "qobject/qdict.h"
@@ -354,6 +355,7 @@ def visit_begin(self, schema: QAPISchema) -> None:
                              c_prefix=c_name(self._prefix, protect=False)))
         self._genc.add(mcgen('''
 #include "qemu/osdep.h"
+#include "qemu/target-info.h"
 #include "%(prefix)sqapi-commands.h"
 #include "%(prefix)sqapi-init-commands.h"
 #include "%(prefix)sqapi-features.h"
diff --git a/scripts/qapi/introspect.py b/scripts/qapi/introspect.py
index c70b97a455d..a16d6bad012 100644
--- a/scripts/qapi/introspect.py
+++ b/scripts/qapi/introspect.py
@@ -190,6 +190,7 @@ def __init__(self, prefix: str, unmask: bool):
         self._name_map: Dict[str, str] = {}
         self._genc.add(mcgen('''
 #include "qemu/osdep.h"
+#include "qemu/target-info.h"
 #include "%(prefix)sqapi-introspect.h"
 
 ''',
diff --git a/scripts/qapi/visit.py b/scripts/qapi/visit.py
index 82caf8c5f0b..6836eb8ed60 100644
--- a/scripts/qapi/visit.py
+++ b/scripts/qapi/visit.py
@@ -342,6 +342,7 @@ def __init__(self, prefix: str):
     def _begin_builtin_module(self) -> None:
         self._genc.preamble_add(mcgen('''
 #include "qemu/osdep.h"
+#include "qemu/target-info.h"
 #include "qapi/error.h"
 #include "qapi/qapi-builtin-visit.h"
 '''))
@@ -356,6 +357,7 @@ def _begin_user_module(self, name: str) -> None:
         visit = self._module_basename('qapi-visit', name)
         self._genc.preamble_add(mcgen('''
 #include "qemu/osdep.h"
+#include "qemu/target-info.h"
 #include "qapi/error.h"
 #include "%(visit)s.h"
 #include "%(prefix)sqapi-features.h"
-- 
2.47.2



  parent reply	other threads:[~2025-05-07 23:15 UTC|newest]

Thread overview: 37+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-05-07 23:14 [PATCH 00/13] single-binary: make QAPI generated files common Pierrick Bouvier
2025-05-07 23:14 ` [PATCH 01/13] qapi: introduce 'runtime_if' for QAPI json Pierrick Bouvier
2025-05-08  6:53   ` Philippe Mathieu-Daudé
2025-05-08 20:22     ` Pierrick Bouvier
2025-05-15  4:39   ` Markus Armbruster
2025-05-15 15:42     ` Pierrick Bouvier
2025-05-07 23:14 ` [PATCH 02/13] qapi/introspect: generate schema as a QObject directly Pierrick Bouvier
2025-05-07 23:14 ` [PATCH 03/13] qobject/qlit: allow to hide dict or list entries Pierrick Bouvier
2025-05-08 14:21   ` Daniel P. Berrangé
2025-05-08 20:25     ` Pierrick Bouvier
2025-05-07 23:14 ` [PATCH 04/13] qapi/introspect: hide fields in schema Pierrick Bouvier
2025-05-07 23:14 ` [PATCH 05/13] qapi/commands: register commands conditionally Pierrick Bouvier
2025-05-07 23:14 ` [PATCH 06/13] qapi/visit: hide fields in JSON marshalling Pierrick Bouvier
2025-05-07 23:14 ` Pierrick Bouvier [this message]
2025-05-08  6:57   ` [PATCH 07/13] qapi: add access to qemu/target-info.h Philippe Mathieu-Daudé
2025-05-07 23:14 ` [PATCH 08/13] qemu/target-info: implement missing helpers Pierrick Bouvier
2025-05-08  6:40   ` Philippe Mathieu-Daudé
2025-05-08 20:30     ` Pierrick Bouvier
2025-05-07 23:14 ` [PATCH 09/13] qapi: transform target specific 'if' in runtime checks Pierrick Bouvier
2025-05-08  6:44   ` Philippe Mathieu-Daudé
2025-05-08 14:40   ` Daniel P. Berrangé
2025-05-08 20:48     ` Pierrick Bouvier
2025-05-10  6:57     ` Markus Armbruster
2025-05-13  0:36       ` Pierrick Bouvier
2025-05-13  7:08         ` Markus Armbruster
2025-05-13 22:52           ` Pierrick Bouvier
2025-05-14  7:13             ` Markus Armbruster
2025-05-14 16:54               ` Pierrick Bouvier
2025-05-14 14:09   ` Markus Armbruster
2025-05-14 16:50     ` Pierrick Bouvier
2025-05-07 23:14 ` [PATCH 10/13] qapi: add weak stubs for target specific commands Pierrick Bouvier
2025-05-08  6:57   ` Philippe Mathieu-Daudé
2025-05-08 20:33     ` Pierrick Bouvier
2025-05-07 23:14 ` [PATCH 11/13] qapi: make all generated files common Pierrick Bouvier
2025-05-08  6:57   ` Philippe Mathieu-Daudé
2025-05-07 23:14 ` [PATCH 13/13] [ANNEX] build/qapi: after series Pierrick Bouvier
2025-05-07 23:33 ` [PATCH 00/13] single-binary: make QAPI generated files common Pierrick Bouvier

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20250507231442.879619-8-pierrick.bouvier@linaro.org \
    --to=pierrick.bouvier@linaro.org \
    --cc=alex.bennee@linaro.org \
    --cc=armbru@redhat.com \
    --cc=berrange@redhat.com \
    --cc=jsnow@redhat.com \
    --cc=michael.roth@amd.com \
    --cc=pbonzini@redhat.com \
    --cc=peter.maydell@linaro.org \
    --cc=philmd@linaro.org \
    --cc=qemu-devel@nongnu.org \
    --cc=richard.henderson@linaro.org \
    --cc=stefanha@redhat.com \
    --cc=thuth@redhat.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).