Re: [PATCH v2 09/16] scripts/qapi: add QAPISchemaIfCond.rsgen()

Zhao Liu
2026-01-19T06:33:34Z

On Thu, Jan 08, 2026 at 02:10:36PM +0100, Paolo Bonzini wrote:
> Date: Thu, 8 Jan 2026 14:10:36 +0100
> From: Paolo Bonzini <pbonzini@redhat.com>
> Subject: [PATCH v2 09/16] scripts/qapi: add QAPISchemaIfCond.rsgen()
> X-Mailer: git-send-email 2.52.0
>
> From: Marc-André Lureau <marcandre.lureau@redhat.com>
>
> Generate Rust #[cfg(...)] guards from QAPI 'if' conditions; it
> turns out that they are very similar, with both of them using
> not/any/all, so just walk the tree.
>
> The next commit will put it to use.
>
> Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com>
> Link: https://lore.kernel.org/r/20210907121943.3498701-15-marcandre.lureau@redhat.com
> Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
> ---
> scripts/qapi/common.py | 19 +++++++++++++++++++
> scripts/qapi/schema.py | 4 ++++
> 2 files changed, 23 insertions(+)
>
> diff --git a/scripts/qapi/common.py b/scripts/qapi/common.py
> index d7c8aa3365c..14d5dd259c4 100644
> --- a/scripts/qapi/common.py
> +++ b/scripts/qapi/common.py
> @@ -199,6 +199,25 @@ def guardend(name: str) -> str:
> name=c_fname(name).upper())
>

LGTM,

Reviewed-by: Zhao Liu <zhao1.liu@intel.com>