From patchwork Wed May 7 23:14:37 2025 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Pierrick Bouvier X-Patchwork-Id: 888118 Delivered-To: patch@linaro.org Received: by 2002:a5d:4683:0:b0:38f:210b:807b with SMTP id u3csp624640wrq; Wed, 7 May 2025 16:15:45 -0700 (PDT) X-Forwarded-Encrypted: i=2; AJvYcCUu/c6CVxRNMesg107CW/oL6CN0NSa8BggX0DwMBxobwbK2xkbFQ9odjP+VNtdrGlFqnXSrPQ==@linaro.org X-Google-Smtp-Source: AGHT+IEKlaMUAnvGdXars+s7tmgY3+/HqNcIRhbx+/s+wUlXYwxEW7FsNSw1i0kmSyvIX5sNQGOC X-Received: by 2002:a05:6102:2c02:b0:4bb:e14a:944b with SMTP id ada2fe7eead31-4dc738a88ccmr4390056137.20.1746659744932; Wed, 07 May 2025 16:15:44 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1746659744; cv=none; d=google.com; s=arc-20240605; b=MXpMRL4EM+2FpvJq3rI39N+YHuM62mmATP5lqAqTyVqF5Uq2fs2vey6wJcfQBfz0zf KKVYSv7o3il26XZO59F6HPSidWBLtYjee0JjIvZkA10Lbyqq94Cq3clXHZdW26qOO2KW W86Z1sYA83LnhLCHkJSvYp05TEws93FIycYVQfNZHwS5iBuXWBbvyhi1CaA2dTTDcCzz to51U8TBQoDilhmaUEdpayhIuU5D0GgCxffwLMEJq25kF0qA9Suil0hjNTay4DhO8Xu8 gZTKR9wQBSCduCyRL3VsUQYHekHcRjM0g8SgxtJHhp1zqK/l5RZZE4r7huyoTkC/8YRd MvzA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20240605; h=sender:errors-to:list-subscribe:list-help:list-post:list-archive :list-unsubscribe:list-id:precedence:content-transfer-encoding :mime-version:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=QGmrC9Lpdjuz6pj+NV/O+8IjV/h+/Pk7pyNiZqlJEW0=; fh=C3ex6Ep0JlVVkO8k9Lw7rcozgcHcGXw85BZvhIOfcrk=; b=hY+b+yynPEPg29JEhKds8gtm0jqJnfzAW43wSw/zd2iCuB4zdES0iA0FaY3EeF4GId nprNE4EGx8c7ne4GaHpkIS+3n5L7ss0CRGBiUm9WOO9T8lRW+VZ3/aVNULNxUSgK+oPp 4DgnDhgxbZ7S3r/VZtzznDETtquNl1WYq56twKaqnfsTkHzRbhr8osf3/I3A9JJF/9Ib pc6r0YpIikOuGXmc/9iWXNwm6XZeWnbpo4s66oVr+LJEjnTBEgzJ+GiIQSAu5pjyCS1+ jZfu0ONVkirnIHkTkjMY2d5pgb9sOvZ/0f5wSj6vJYRl8w4X0QOhDHGC5Js4rZn+yIZZ ijDA==; dara=google.com ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=eyBRZDOb; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom="qemu-devel-bounces+patch=linaro.org@nongnu.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org; dara=neutral header.i=@linaro.org Return-Path: Received: from lists.gnu.org (lists.gnu.org. [209.51.188.17]) by mx.google.com with ESMTPS id ada2fe7eead31-4ddb31aaa05si45006137.225.2025.05.07.16.15.44 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Wed, 07 May 2025 16:15:44 -0700 (PDT) Received-SPF: pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=eyBRZDOb; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom="qemu-devel-bounces+patch=linaro.org@nongnu.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org; dara=neutral header.i=@linaro.org Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1uCnyh-0000hV-Tf; Wed, 07 May 2025 19:15:04 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1uCnye-0000fJ-O0 for qemu-devel@nongnu.org; Wed, 07 May 2025 19:15:00 -0400 Received: from mail-pl1-x632.google.com ([2607:f8b0:4864:20::632]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1uCnyd-0007AR-0h for qemu-devel@nongnu.org; Wed, 07 May 2025 19:15:00 -0400 Received: by mail-pl1-x632.google.com with SMTP id d9443c01a7336-22c33677183so4516875ad.2 for ; Wed, 07 May 2025 16:14:58 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1746659697; x=1747264497; darn=nongnu.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=QGmrC9Lpdjuz6pj+NV/O+8IjV/h+/Pk7pyNiZqlJEW0=; b=eyBRZDObxziNIhXqd0qHGWpxIxAU72VjVm/DVVx47QLC2mTqopv4Kt1k/+niwuI2Ns 0tg9QrIh3PjmGvaJRF+P62Ars4JpY74lgvHK2gGPQak6/wVlLszzfFHoOv1jM0KdTjgC FJ3ynU7aEKOdOMhuhgJ/HsJstsFrG7i/1pNxuYhAs8GfXM8jAU7CdS34z7pcYIj9TYD6 niBqtMUCxWqmkg+bdHsk+oLzh6M/uvDHbtIaUHg67xaMrfznRl1m06MQ7bPeicAzkl+i 0Qt0The++7p5OLTwN/iV+vH2tbveXXndQrxpHRFcR2SYojwoUFELcKrfgN3nd0Y1c61P Aj5A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1746659697; x=1747264497; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=QGmrC9Lpdjuz6pj+NV/O+8IjV/h+/Pk7pyNiZqlJEW0=; b=Cg+PpMVVEyKTVnncynSGt9mXyjXGK0JIuufPWlDEj7gZTtGaShUygkqrsiPAY8HEZ3 4dBLJXdZrmqqHLyXmruxVpeBOckUQKuPNA93zw9NGfaBRIpuL1zJTjBLYApEiRVi5xav xTXSYA+4om1OCJnHK29k7A6bdPeHxhhZr1CGiJ0dMFoITAGDmgd1rdECCelAENDf+VWD BmfkxtM4vU0RWdWgUYOBxcYgfErPsK7EnEtPHDPZegvBA1I6mGiNPn+D1eX2SdYWN8NI ZY9vh6ToqvrMQE55TM+w8zQ7RMCi7zFUoHQZUKdAA7OtIWfFGiFOlNjJ/uESVZfo9pnL e6XA== X-Gm-Message-State: AOJu0YwfK0rE8JoxpbH5UYcmMgvfJZJcJ47hG2+bU6oL6seRZgg28tXP WxtMF0SMCPV4cKk6nkdRaKRMB7xGhpULVEvTRqD7UryJVepXSVzqFVutz5ujVQ/B0JjsZjSLiqX LA+bePA== X-Gm-Gg: ASbGncvsCPAKP18skToB2CbGTUNVyi6uNmkzHw5Rj2SxsBgXrvY+pKn8AwJlTvoLvfm Ueb3jWxyD2iTAv1EUnruQ0RcdDeQoEFJxUQLkkSGx3e+XEdNk2zmyUZ5Mgusqf8cO+WkeH7JoTf AJl2RgSpPDxB3HPF+4UwpJtbyLy4dhhbDCyWYBzybOzFk5Tya3kEpRzwMis7atotWXgdrqK5KAQ QAjfY1nD9Op9BrW+sJrRDQyIyxmRuUk0TA30owgsjtAnN72pRaFi3lGP8rwwIFy8X0ZRXM5/PMG gKISpuxWMsgYnPi5zPf7QgiMDvUYI+PEFPiHXCk3 X-Received: by 2002:a17:902:e743:b0:21f:61a9:be7d with SMTP id d9443c01a7336-22e5edfa34bmr75155445ad.49.1746659697678; Wed, 07 May 2025 16:14:57 -0700 (PDT) Received: from pc.. ([38.41.223.211]) by smtp.gmail.com with ESMTPSA id d9443c01a7336-22e421a7dafsm40103205ad.69.2025.05.07.16.14.56 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 07 May 2025 16:14:57 -0700 (PDT) From: Pierrick Bouvier To: qemu-devel@nongnu.org Cc: Pierrick Bouvier , alex.bennee@linaro.org, stefanha@redhat.com, peter.maydell@linaro.org, Markus Armbruster , richard.henderson@linaro.org, pbonzini@redhat.com, jsnow@redhat.com, philmd@linaro.org, berrange@redhat.com, thuth@redhat.com, Michael Roth Subject: [PATCH 07/13] qapi: add access to qemu/target-info.h Date: Wed, 7 May 2025 16:14:37 -0700 Message-ID: <20250507231442.879619-8-pierrick.bouvier@linaro.org> X-Mailer: git-send-email 2.47.2 In-Reply-To: <20250507231442.879619-1-pierrick.bouvier@linaro.org> References: <20250507231442.879619-1-pierrick.bouvier@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2607:f8b0:4864:20::632; envelope-from=pierrick.bouvier@linaro.org; helo=mail-pl1-x632.google.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+patch=linaro.org@nongnu.org Sender: qemu-devel-bounces+patch=linaro.org@nongnu.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 Reviewed-by: Philippe Mathieu-Daudé --- 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"