From nobody Sat Apr 11 18:39:15 2026 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org ARC-Seal: i=1; a=rsa-sha256; t=1775213053; cv=none; d=zohomail.com; s=zohoarc; b=cFY7K7bxm9fYB28iYaEPTJ1i/U8RAg7Ib6vjUnjwWTC6Su6taubGNf0HrsjuveflDfMAKqsiMLUuw7RrrBm1nAlfamRxf9Fy7YtrGa7kcdRE0NVNUrMR+fjaJCcGJrIBZVTTmwxqFXb3hszbVql1KP44hbIKiQu9J+2VosixogE= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1775213053; h=Content-Transfer-Encoding:Cc:Cc:Date:Date:From:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:Subject:To:To:Message-Id:Reply-To; bh=/5FSLLI+ioYZWPDO1/gOi5F2S9bEL+Okm253V0ZVgrs=; b=VJekOn/13ROFRv3l6L4nSw7NyjIYqRlkMLwuoeqTO9nUUtAlhHRwOGFza6qMqqSwP6XKlayIzpG5mdGfo8j4LsNGga3fM7ITGzE5GR0w/Lg+avEO4lB7MJA4rPKjQeO1DwUSu/nIyguKE1QSVxvz6hmMwxk6wNaXtFMlV4aVXaY= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1775213053674528.1556636204019; Fri, 3 Apr 2026 03:44:13 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1w8c01-0003xk-TS; Fri, 03 Apr 2026 06:43:38 -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 1w8bzz-0003x3-2M for qemu-devel@nongnu.org; Fri, 03 Apr 2026 06:43:35 -0400 Received: from isrv.corpit.ru ([212.248.84.144]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1w8bzw-0005XU-I1 for qemu-devel@nongnu.org; Fri, 03 Apr 2026 06:43:34 -0400 Received: from tsrv.corpit.ru (tsrv.tls.msk.ru [192.168.177.2]) by isrv.corpit.ru (Postfix) with ESMTP id 007AB19A63B for ; Fri, 03 Apr 2026 13:42:51 +0300 (MSK) Received: from think4mjt.tls.msk.ru (mjtthink.wg.tls.msk.ru [192.168.177.146]) by tsrv.corpit.ru (Postfix) with ESMTP id AA58C38DB6B; Fri, 03 Apr 2026 13:43:28 +0300 (MSK) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=tls.msk.ru; s=202602; t=1775212971; bh=iTD+YPwk/gZAcdlT6TByCohIFvhVzDKpWAe9TysC0vQ=; h=From:To:Cc:Subject:Date:In-Reply-To:References; b=DL/SFPFFVfGEpcg1SmA1dpdcsb8RSUJPWjBFnNiQOfDF6Eltv57OTwHOo80hiho2z DgJiK0LIkfrpf/OoxLO6BPPYMEHek2rSEZx5p3nOYI2qIJ26sf5NjlaziTpbJJlm0H nNM3CFG6acauJxQwOFEgwXFr7/lsMQbwYju7RS6r0K/ENdjY8OZfrdiwbhzaWjEMDS aECQikKh0gju+X1Tl1B3hy/rVU/Ga68E22PMOc+kGSmQf4UD9zyQTYkYWmhmWuaryo wcz/kuYxRy11TCp/vnLwae6ydbeWwIpnyilVW7Q4KGUYD098FrP2N7jwouJ9PbONYQ SI7AOBcDSCDyQ== From: Michael Tokarev To: qemu-devel@nongnu.org Cc: Michael Tokarev Subject: [PATCH for-11.0 1/6] util/meson.build: do not add cpuinfo-$arch to util_ss for 32bit CPUs Date: Fri, 3 Apr 2026 13:43:21 +0300 Message-ID: <20260403104327.1163942-2-mjt@tls.msk.ru> X-Mailer: git-send-email 2.47.3 In-Reply-To: <20260403104327.1163942-1-mjt@tls.msk.ru> References: <20260403104327.1163942-1-mjt@tls.msk.ru> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Received-SPF: pass (zohomail.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; Received-SPF: pass client-ip=212.248.84.144; envelope-from=mjt@tls.msk.ru; helo=isrv.corpit.ru X-Spam_score_int: -19 X-Spam_score: -2.0 X-Spam_bar: -- X-Spam_report: (-2.0 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, RCVD_IN_VALIDITY_CERTIFIED_BLOCKED=0.001, RCVD_IN_VALIDITY_RPBL_BLOCKED=0.001, 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: qemu development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @tls.msk.ru) X-ZM-MESSAGEID: 1775213055205158500 Content-Type: text/plain; charset="utf-8" qemu dropped support for 32bit CPUs recently, so this change is an additional clean-up on top. But in theory it will allow building qemu-guest-agent on a 32bit system. Signed-off-by: Michael Tokarev --- util/meson.build | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/util/meson.build b/util/meson.build index 33132c04ad..c2d77bf9de 100644 --- a/util/meson.build +++ b/util/meson.build @@ -116,13 +116,13 @@ endif =20 if cpu =3D=3D 'aarch64' util_ss.add(files('cpuinfo-aarch64.c')) -elif cpu in ['x86', 'x86_64'] +elif cpu =3D=3D 'x86_64' util_ss.add(files('cpuinfo-i386.c')) elif cpu =3D=3D 'loongarch64' util_ss.add(files('cpuinfo-loongarch.c')) -elif cpu in ['ppc', 'ppc64'] +elif cpu =3D=3D 'ppc64' util_ss.add(files('cpuinfo-ppc.c')) -elif cpu in ['riscv32', 'riscv64'] +elif cpu =3D=3D 'riscv64' util_ss.add(files('cpuinfo-riscv.c')) elif cpu =3D=3D 's390x' util_ss.add(files('s390x_pci_mmio.c')) --=20 2.47.3 From nobody Sat Apr 11 18:39:15 2026 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org ARC-Seal: i=1; a=rsa-sha256; t=1775213080; cv=none; d=zohomail.com; s=zohoarc; b=a8/myFtMBxYlH1lwhK8NHL9My+zCwLT9SWpINhcpuUYsos1LAP7mcL6mlCB8bx3KFPFjjqm537VNw73Syjxzr0d33CG6f426wGVNTFq8m75XltUUhbofajJQ/eWFs2moevu7ejafyqhB0Y6JpK3bZ1n1MzsoiJPl41ZwhwIZeI8= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1775213080; h=Content-Type:Content-Transfer-Encoding:Cc:Cc:Date:Date:From:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:Subject:To:To:Message-Id:Reply-To; bh=cmbjx85776YbScjF4hGxn3WebdCzgPKj6qKiHxrekb4=; b=OpDtwJtE86k+WXL/UmC0muWSm9F7v4Bkku22ZbNBM7oJMWmN1L+GL3bVorea06nXlUkH5YdUTXamzP6eSetvPmRiO9EZyoPXFVAo62FzJbGQ/QLQ2snTYhlDF8sqidIXUwMj8iQc7mCjcm8pOigg29vzR4jZvSZT5hFEecF/5Ws= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1775213080134229.2192015707925; Fri, 3 Apr 2026 03:44:40 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1w8c06-0003zV-7Q; Fri, 03 Apr 2026 06:43:42 -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 1w8c03-0003yc-EW for qemu-devel@nongnu.org; Fri, 03 Apr 2026 06:43:39 -0400 Received: from isrv.corpit.ru ([212.248.84.144]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1w8c01-0005YN-SN for qemu-devel@nongnu.org; Fri, 03 Apr 2026 06:43:39 -0400 Received: from tsrv.corpit.ru (tsrv.tls.msk.ru [192.168.177.2]) by isrv.corpit.ru (Postfix) with ESMTP id 0CD2119A63C; Fri, 03 Apr 2026 13:42:51 +0300 (MSK) Received: from think4mjt.tls.msk.ru (mjtthink.wg.tls.msk.ru [192.168.177.146]) by tsrv.corpit.ru (Postfix) with ESMTP id BF64B38DB6C; Fri, 03 Apr 2026 13:43:28 +0300 (MSK) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=tls.msk.ru; s=202602; t=1775212971; bh=sxYYGzxX13JLYTURZXmXs1BXBksyTpPz/55bI456ahI=; h=From:To:Cc:Subject:Date:In-Reply-To:References; b=pYkecZT+t+EzK+2uNSv2aGwNevLhB7vxO3KgyjSCjI50c8yNU67LSde9SZ0Akv9+Q 1q9fljJVSbkFRt98pP6nL9P7C7C7ZqLIJDq7EAy90bJhyhnJT3GfV3NEBFSNSLB7Hb mpTGOnrUbTsqyAWPzEJCUZd6K/3h4HTUIuZQ99VJsq8TgVWfa6fmy0s22dP1qimYNO x52pNSLM95dxhgW602f5RiUsA6yggO1AIYwxxNSYdopcG+J/VCHoszHBmZqDHDr82P 7d37SMHeflT1gZXRJx3YS9cob9SN0pvQW7npN03z/7L4GTeDQBOR7Pp3qk22sA41ls vbiANOzvKKeOQ== From: Michael Tokarev To: qemu-devel@nongnu.org Cc: =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= , Michael Tokarev Subject: [PATCH for-11.0 2/6] hw/core: Move compat_props_add() to 'hw/core/boards.h' Date: Fri, 3 Apr 2026 13:43:22 +0300 Message-ID: <20260403104327.1163942-3-mjt@tls.msk.ru> X-Mailer: git-send-email 2.47.3 In-Reply-To: <20260403104327.1163942-1-mjt@tls.msk.ru> References: <20260403104327.1163942-1-mjt@tls.msk.ru> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Received-SPF: pass (zohomail.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; Received-SPF: pass client-ip=212.248.84.144; envelope-from=mjt@tls.msk.ru; helo=isrv.corpit.ru X-Spam_score_int: -19 X-Spam_score: -2.0 X-Spam_bar: -- X-Spam_report: (-2.0 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, RCVD_IN_VALIDITY_CERTIFIED_BLOCKED=0.001, RCVD_IN_VALIDITY_RPBL_BLOCKED=0.001, 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: qemu development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @tls.msk.ru) X-ZM-MESSAGEID: 1775213083849154100 From: Philippe Mathieu-Daud=C3=A9 compat_props_add() is only used by board models, no need to expose it to any device model. Restrict by defining it only in "hw/core/boards.h". Signed-off-by: Philippe Mathieu-Daud=C3=A9 Reviewed-by: Michael Tokarev Reviewed-by: Richard Henderson --- include/hw/core/boards.h | 10 ++++++++++ include/hw/core/qdev.h | 10 ---------- 2 files changed, 10 insertions(+), 10 deletions(-) diff --git a/include/hw/core/boards.h b/include/hw/core/boards.h index b8dad0a107..0ac7e17ef7 100644 --- a/include/hw/core/boards.h +++ b/include/hw/core/boards.h @@ -798,6 +798,16 @@ struct MachineState { } \ } while (0) =20 +static inline void +compat_props_add(GPtrArray *arr, + GlobalProperty props[], size_t nelem) +{ + int i; + for (i =3D 0; i < nelem; i++) { + g_ptr_array_add(arr, (void *)&props[i]); + } +} + extern GlobalProperty hw_compat_10_2[]; extern const size_t hw_compat_10_2_len; =20 diff --git a/include/hw/core/qdev.h b/include/hw/core/qdev.h index f99a8979cc..778617787c 100644 --- a/include/hw/core/qdev.h +++ b/include/hw/core/qdev.h @@ -421,16 +421,6 @@ typedef struct GlobalProperty { bool optional; } GlobalProperty; =20 -static inline void -compat_props_add(GPtrArray *arr, - GlobalProperty props[], size_t nelem) -{ - int i; - for (i =3D 0; i < nelem; i++) { - g_ptr_array_add(arr, (void *)&props[i]); - } -} - /*** Board API. This should go away once we have a machine config file. = ***/ =20 /** --=20 2.47.3 From nobody Sat Apr 11 18:39:15 2026 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org ARC-Seal: i=1; a=rsa-sha256; t=1775213082; cv=none; d=zohomail.com; s=zohoarc; b=DtmP5saYeqxULAwjcWpfUe0jTuVEbEBmm+1RJPAwIe0KVCmW/4oiqi728oCC/Le2LYhBBQt9DIi26e2fgp560SHwKNc53+TlEbJ235PiPxg7GUf77FQBcJiCSjiVJ+Tw9Xm42Cs3f3xez0fOQOXbk5heH6PEw+5Vgb/nLYEUZdk= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1775213082; h=Content-Type:Content-Transfer-Encoding:Cc:Cc:Date:Date:From:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:Subject:To:To:Message-Id:Reply-To; bh=LJcKCvKnACkNof/EHL0OzatJYaNhJClr/Q8Cx66CLjI=; b=hqiluNct6TDtX9ADSB8AaGyaQJ2ogZZmr2BeN1NuAvKacMTmJkXXHvVN7J7/ok6/Urqk+jShZDGIEJudbyzJfUYaBuPpxt9LbJhhWsGtpDtbCWsGLcB9MYfveWbUJuhQbk8s8ZO3fa6/q9rNukNeGJIhL7omRCGxMVqaRI0Aklo= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1775213081453630.3173898070909; Fri, 3 Apr 2026 03:44:41 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1w8c06-0003zW-CA; Fri, 03 Apr 2026 06:43:42 -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 1w8c03-0003yr-LM for qemu-devel@nongnu.org; Fri, 03 Apr 2026 06:43:39 -0400 Received: from isrv.corpit.ru ([212.248.84.144]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1w8c01-0005YO-SL for qemu-devel@nongnu.org; Fri, 03 Apr 2026 06:43:39 -0400 Received: from tsrv.corpit.ru (tsrv.tls.msk.ru [192.168.177.2]) by isrv.corpit.ru (Postfix) with ESMTP id 19EFA19A63D; Fri, 03 Apr 2026 13:42:51 +0300 (MSK) Received: from think4mjt.tls.msk.ru (mjtthink.wg.tls.msk.ru [192.168.177.146]) by tsrv.corpit.ru (Postfix) with ESMTP id CC8DF38DB6D; Fri, 03 Apr 2026 13:43:28 +0300 (MSK) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=tls.msk.ru; s=202602; t=1775212971; bh=RrlxCV4E2YhfW6wkGShBvS/UZsM8Fiy1F7kyYksAPqg=; h=From:To:Cc:Subject:Date:In-Reply-To:References; b=rl78ktypZxSR3JDdugwp6mXIRAk327+aYk5tHyxCepYQGaH3yGIsmgGmcpF7stZwe ehki3rLw9Dtp7vcDzo3KpI4d5w9V6ZhYcqlgshZuyXiPBFlWrRpJFUQ1CnUtOuiD4H VARGge8yfKRTU2nv/Nnq2+btIaCel290GhjmvWSfRUVO4C7EhezKyZ61MSnHcdXjJb plhwepmIKY3u9fj4dKqH0FKRn34QAUUgMa7MooGtoZt0c8iuaxqhg6ytnhME3Bp4pw T95VJySSK1yLsHfOihjAvnsxck4feI1LMGiRYEoTzB7425C3g1AEC7IBKGx8/Cfo49 hF1ojy5RjHQ3A== From: Michael Tokarev To: qemu-devel@nongnu.org Cc: =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= , Michael Tokarev Subject: [PATCH for-11.0 3/6] qom: Declare GlobalProperty structure in 'qom/compat-properties.h' Date: Fri, 3 Apr 2026 13:43:23 +0300 Message-ID: <20260403104327.1163942-4-mjt@tls.msk.ru> X-Mailer: git-send-email 2.47.3 In-Reply-To: <20260403104327.1163942-1-mjt@tls.msk.ru> References: <20260403104327.1163942-1-mjt@tls.msk.ru> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Received-SPF: pass (zohomail.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; Received-SPF: pass client-ip=212.248.84.144; envelope-from=mjt@tls.msk.ru; helo=isrv.corpit.ru X-Spam_score_int: -19 X-Spam_score: -2.0 X-Spam_bar: -- X-Spam_report: (-2.0 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, RCVD_IN_VALIDITY_CERTIFIED_BLOCKED=0.001, RCVD_IN_VALIDITY_RPBL_BLOCKED=0.001, 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: qemu development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @tls.msk.ru) X-ZM-MESSAGEID: 1775213082822158500 From: Philippe Mathieu-Daud=C3=A9 While GlobalProperty is expected to only be used by QDev board layer, it is used by the lower QOM API, so define it in the qom/ namespace. This helps to build binary which use QOM but don't need the QDev layer. Signed-off-by: Philippe Mathieu-Daud=C3=A9 Reviewed-by: Michael Tokarev Reviewed-by: Richard Henderson --- include/hw/core/boards.h | 1 + include/hw/core/qdev-properties.h | 1 + include/hw/core/qdev.h | 17 ---------------- include/qom/compat-properties.h | 32 +++++++++++++++++++++++++++++++ qom/object.c | 2 +- 5 files changed, 35 insertions(+), 18 deletions(-) create mode 100644 include/qom/compat-properties.h diff --git a/include/hw/core/boards.h b/include/hw/core/boards.h index 0ac7e17ef7..3f9a7127ad 100644 --- a/include/hw/core/boards.h +++ b/include/hw/core/boards.h @@ -8,6 +8,7 @@ #include "system/blockdev.h" #include "qapi/qapi-types-machine.h" #include "qemu/module.h" +#include "qom/compat-properties.h" #include "qom/object.h" #include "hw/core/cpu.h" #include "hw/core/resettable.h" diff --git a/include/hw/core/qdev-properties.h b/include/hw/core/qdev-prope= rties.h index d8745d4c65..17543957a6 100644 --- a/include/hw/core/qdev-properties.h +++ b/include/hw/core/qdev-properties.h @@ -1,6 +1,7 @@ #ifndef QEMU_QDEV_PROPERTIES_H #define QEMU_QDEV_PROPERTIES_H =20 +#include "qom/compat-properties.h" #include "hw/core/qdev.h" =20 /** diff --git a/include/hw/core/qdev.h b/include/hw/core/qdev.h index 778617787c..337d69ea2c 100644 --- a/include/hw/core/qdev.h +++ b/include/hw/core/qdev.h @@ -404,23 +404,6 @@ struct BusState { ResettableState reset; }; =20 -/** - * typedef GlobalProperty - a global property type - * - * @used: Set to true if property was used when initializing a device. - * @optional: If set to true, GlobalProperty will be skipped without errors - * if the property doesn't exist. - * - * An error is fatal for non-hotplugged devices, when the global is applie= d. - */ -typedef struct GlobalProperty { - const char *driver; - const char *property; - const char *value; - bool used; - bool optional; -} GlobalProperty; - /*** Board API. This should go away once we have a machine config file. = ***/ =20 /** diff --git a/include/qom/compat-properties.h b/include/qom/compat-propertie= s.h new file mode 100644 index 0000000000..6e44aabc26 --- /dev/null +++ b/include/qom/compat-properties.h @@ -0,0 +1,32 @@ +/* + * QEMU Object Model + * + * Copyright IBM, Corp. 2011 + * + * Authors: + * Anthony Liguori + * + * SPDX-License-Identifier: GPL-2.0-or-later + */ + +#ifndef QEMU_COMPAT_PROPERTIES_H +#define QEMU_COMPAT_PROPERTIES_H + +/** + * typedef GlobalProperty - a global property type + * + * @used: Set to true if property was used when initializing a device. + * @optional: If set to true, GlobalProperty will be skipped without errors + * if the property doesn't exist. + * + * An error is fatal for non-hotplugged devices, when the global is applie= d. + */ +typedef struct GlobalProperty { + const char *driver; + const char *property; + const char *value; + bool used; + bool optional; +} GlobalProperty; + +#endif diff --git a/qom/object.c b/qom/object.c index ff8ede8a32..838b1d2b22 100644 --- a/qom/object.c +++ b/qom/object.c @@ -11,8 +11,8 @@ */ =20 #include "qemu/osdep.h" -#include "hw/core/qdev.h" #include "qapi/error.h" +#include "qom/compat-properties.h" #include "qom/object.h" #include "qom/object_interfaces.h" #include "qemu/cutils.h" --=20 2.47.3 From nobody Sat Apr 11 18:39:15 2026 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org ARC-Seal: i=1; a=rsa-sha256; t=1775213055; cv=none; d=zohomail.com; s=zohoarc; b=aSu689tdLrwYSb0WcgVak6nV1nNuCDVRXDISTdNt8c/6rlfqTHIPCHaywphQuTX/6x8LzPS3ayKyU3ZbgJwG+PADeb80hhVuWPaQaBp98HPIrRvcLczn1XMDtCb0NZFyhYFNorPaHO4IN6UgJHnVIe+vztdtamvshcrRuWiPJHY= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1775213055; h=Content-Type:Content-Transfer-Encoding:Cc:Cc:Date:Date:From:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:Subject:To:To:Message-Id:Reply-To; bh=+CftUq7KHHtStHF6PLxxvg+UynZwqMk/tTyV9bcAmPw=; b=Hw5Bp1loJjNx0yW/VWTANTPsxvB5xVswZ5dIt7zXgsn6VBnUn6IRTY/vzFO+HMVxpoGwexOIxQi7Vlpalk/Yf7PbrcaRbBMo3GIM4pnW9E6Ru9vpp2LTo060voUUVFWSKiIDk+xtHz1cR+i+agjg/OZHIcpDe3uJEZenkOA4sjs= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1775213053338449.5403004914998; Fri, 3 Apr 2026 03:44:13 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1w8c09-00040W-Sc; Fri, 03 Apr 2026 06:43:46 -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 1w8c06-0003ze-Qx for qemu-devel@nongnu.org; Fri, 03 Apr 2026 06:43:43 -0400 Received: from isrv.corpit.ru ([212.248.84.144]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1w8c04-0005Zm-Oc for qemu-devel@nongnu.org; Fri, 03 Apr 2026 06:43:42 -0400 Received: from tsrv.corpit.ru (tsrv.tls.msk.ru [192.168.177.2]) by isrv.corpit.ru (Postfix) with ESMTP id 25B2119A63E; Fri, 03 Apr 2026 13:42:51 +0300 (MSK) Received: from think4mjt.tls.msk.ru (mjtthink.wg.tls.msk.ru [192.168.177.146]) by tsrv.corpit.ru (Postfix) with ESMTP id D8C7738DB6E; Fri, 03 Apr 2026 13:43:28 +0300 (MSK) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=tls.msk.ru; s=202602; t=1775212971; bh=gq60/YFiZnFG3mBQOq32B3RaPpFjLtZ3CVqIC3UfUdg=; h=From:To:Cc:Subject:Date:In-Reply-To:References; b=rqdgxJPyRAEr3wE0PfNtvcFiDQu3Fu7RsALFptLWK9STdfZEWyD3p1q0BysEQFrgW iZ57Ui0KaCd0Jae/M1qmlGOe5g1XjmoN0DGDTlRe1GkHFA/jU85o7M8blwm3ZbOmYW xRxhcciWjToW2hNEx64KfvlhZldu4tHrhszJpMwQjp+dix5uA7AnVxyQfG3LP6YsDT IFld1hqr7p0j1iJk9u+myizY1KpTk1z1dcxy7dl0WruGvzsge2jt9sCeu0x85hfbwT POcuF/F+TOae9fYVnj9jODTmMEJu8tiEYreWyZH/cXQsr+cmIQvmzPDDqoiCcB1h8v 74QlvM6hTcXKQ== From: Michael Tokarev To: qemu-devel@nongnu.org Cc: =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= , Michael Tokarev Subject: [PATCH for-11.0 4/6] qom: Declare compat properties API in 'qom/compat-properties.h' Date: Fri, 3 Apr 2026 13:43:24 +0300 Message-ID: <20260403104327.1163942-5-mjt@tls.msk.ru> X-Mailer: git-send-email 2.47.3 In-Reply-To: <20260403104327.1163942-1-mjt@tls.msk.ru> References: <20260403104327.1163942-1-mjt@tls.msk.ru> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Received-SPF: pass (zohomail.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; Received-SPF: pass client-ip=212.248.84.144; envelope-from=mjt@tls.msk.ru; helo=isrv.corpit.ru X-Spam_score_int: -19 X-Spam_score: -2.0 X-Spam_bar: -- X-Spam_report: (-2.0 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, RCVD_IN_VALIDITY_CERTIFIED_BLOCKED=0.001, RCVD_IN_VALIDITY_RPBL_BLOCKED=0.001, 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: qemu development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @tls.msk.ru) X-ZM-MESSAGEID: 1775213058637158500 From: Philippe Mathieu-Daud=C3=A9 While most of QEMU files use the QOM concept, few of them use the compatibility properties API (mostly use in system emulation). Move its prototype to a new "qom/compat-properties.h" header, keeping "qom/object.h" for generic QOM. Signed-off-by: Philippe Mathieu-Daud=C3=A9 Reviewed-by: Michael Tokarev Reviewed-by: Richard Henderson --- accel/accel-system.c | 1 + backends/hostmem.c | 1 + hw/core/machine.c | 1 + hw/core/qdev-properties.c | 1 + hw/core/qdev.c | 1 + hw/i386/pc_q35.c | 1 + include/qom/compat-properties.h | 8 ++++++++ include/qom/object.h | 8 -------- system/rtc.c | 1 + system/vl.c | 1 + target/i386/sev.c | 1 + ui/vdagent.c | 1 + 12 files changed, 18 insertions(+), 8 deletions(-) diff --git a/accel/accel-system.c b/accel/accel-system.c index 150af05bf5..9176665202 100644 --- a/accel/accel-system.c +++ b/accel/accel-system.c @@ -25,6 +25,7 @@ =20 #include "qemu/osdep.h" #include "qemu/accel.h" +#include "qom/compat-properties.h" #include "qapi/qapi-commands-accelerator.h" #include "monitor/monitor.h" #include "hw/core/boards.h" diff --git a/backends/hostmem.c b/backends/hostmem.c index 15d4365b69..cd2085fb3c 100644 --- a/backends/hostmem.c +++ b/backends/hostmem.c @@ -18,6 +18,7 @@ #include "qapi/qapi-builtin-visit.h" #include "qapi/visitor.h" #include "qemu/config-file.h" +#include "qom/compat-properties.h" #include "qom/object_interfaces.h" #include "qemu/mmap-alloc.h" #include "qemu/madvise.h" diff --git a/hw/core/machine.c b/hw/core/machine.c index 0aa77a57e9..cba5031094 100644 --- a/hw/core/machine.c +++ b/hw/core/machine.c @@ -21,6 +21,7 @@ #include "qapi/qapi-visit-machine.h" #include "qapi/qapi-commands-machine.h" #include "qemu/madvise.h" +#include "qom/compat-properties.h" #include "qom/object_interfaces.h" #include "system/cpus.h" #include "system/system.h" diff --git a/hw/core/qdev-properties.c b/hw/core/qdev-properties.c index ba8461e9a4..73539c727b 100644 --- a/hw/core/qdev-properties.c +++ b/hw/core/qdev-properties.c @@ -10,6 +10,7 @@ #include "qemu/units.h" #include "qemu/cutils.h" #include "qdev-prop-internal.h" +#include "qom/compat-properties.h" #include "qom/qom-qobject.h" =20 void qdev_prop_set_after_realize(DeviceState *dev, const char *name, diff --git a/hw/core/qdev.c b/hw/core/qdev.c index e48616b2c6..b36101f3a7 100644 --- a/hw/core/qdev.c +++ b/hw/core/qdev.c @@ -32,6 +32,7 @@ #include "qapi/visitor.h" #include "qemu/error-report.h" #include "qemu/option.h" +#include "qom/compat-properties.h" #include "hw/core/irq.h" #include "hw/core/qdev-properties.h" #include "hw/core/boards.h" diff --git a/hw/i386/pc_q35.c b/hw/i386/pc_q35.c index cb23322f5a..6a0967ecd1 100644 --- a/hw/i386/pc_q35.c +++ b/hw/i386/pc_q35.c @@ -56,6 +56,7 @@ #include "hw/usb/hcd-uhci.h" #include "qapi/error.h" #include "qemu/error-report.h" +#include "qom/compat-properties.h" #include "system/numa.h" #include "hw/hyperv/vmbus-bridge.h" #include "hw/mem/nvdimm.h" diff --git a/include/qom/compat-properties.h b/include/qom/compat-propertie= s.h index 6e44aabc26..90f8320adf 100644 --- a/include/qom/compat-properties.h +++ b/include/qom/compat-properties.h @@ -29,4 +29,12 @@ typedef struct GlobalProperty { bool optional; } GlobalProperty; =20 +void object_set_machine_compat_props(GPtrArray *compat_props); +void object_set_accelerator_compat_props(GPtrArray *compat_props); +void object_register_sugar_prop(const char *driver, const char *prop, + const char *value, bool optional); +void object_apply_compat_props(Object *obj); +bool object_apply_global_props(Object *obj, const GPtrArray *props, + Error **errp); + #endif diff --git a/include/qom/object.h b/include/qom/object.h index 26df6137b9..510885218b 100644 --- a/include/qom/object.h +++ b/include/qom/object.h @@ -700,14 +700,6 @@ Object *object_new_with_propv(const char *typename, Error **errp, va_list vargs); =20 -bool object_apply_global_props(Object *obj, const GPtrArray *props, - Error **errp); -void object_set_machine_compat_props(GPtrArray *compat_props); -void object_set_accelerator_compat_props(GPtrArray *compat_props); -void object_register_sugar_prop(const char *driver, const char *prop, - const char *value, bool optional); -void object_apply_compat_props(Object *obj); - /** * object_set_props: * @obj: the object instance to set properties on diff --git a/system/rtc.c b/system/rtc.c index 56951288c4..f13dd392a7 100644 --- a/system/rtc.c +++ b/system/rtc.c @@ -28,6 +28,7 @@ #include "qemu/error-report.h" #include "qemu/option.h" #include "qemu/timer.h" +#include "qom/compat-properties.h" #include "qom/object.h" #include "system/replay.h" #include "system/system.h" diff --git a/system/vl.c b/system/vl.c index 246623b319..0e1fc217b4 100644 --- a/system/vl.c +++ b/system/vl.c @@ -119,6 +119,7 @@ #include "qapi/string-input-visitor.h" #include "qapi/opts-visitor.h" #include "qapi/clone-visitor.h" +#include "qom/compat-properties.h" #include "qom/object_interfaces.h" #include "semihosting/semihost.h" #include "crypto/init.h" diff --git a/target/i386/sev.c b/target/i386/sev.c index 9dde972c11..261b6aaa37 100644 --- a/target/i386/sev.c +++ b/target/i386/sev.c @@ -36,6 +36,7 @@ #include "system/reset.h" #include "trace.h" #include "migration/blocker.h" +#include "qom/compat-properties.h" #include "qom/object.h" #include "monitor/monitor.h" #include "monitor/hmp.h" diff --git a/ui/vdagent.c b/ui/vdagent.c index bb0c4aa14c..bb55cbefc9 100644 --- a/ui/vdagent.c +++ b/ui/vdagent.c @@ -5,6 +5,7 @@ #include "qemu/error-report.h" #include "qemu/option.h" #include "qemu/units.h" +#include "qom/compat-properties.h" #include "hw/core/qdev.h" #include "hw/core/qdev-properties.h" #include "migration/blocker.h" --=20 2.47.3 From nobody Sat Apr 11 18:39:15 2026 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org ARC-Seal: i=1; a=rsa-sha256; t=1775213074; cv=none; d=zohomail.com; s=zohoarc; b=AbfmmtpJsP7wElXB1/uBcp4qX5A7+zacKFHHOPKsED3UOdJJ+kZ4FfXz39+BLZ1EC+VQMUgHt0DG7fS7NN7SSoDRkGquFxAoV662881479ZPCWeTyG2MjhumAajRpoJZKDDTMu3Ja1Eiu6NFep6PICwYthJWlljzRcJ//GFjiyI= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1775213074; h=Content-Type:Content-Transfer-Encoding:Cc:Cc:Date:Date:From:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:Subject:To:To:Message-Id:Reply-To; bh=ACG+4eTy+iU4VfkBtybDg7uYvcAV+f1mdj9KJTJcc9I=; b=Uchig9baEmxT0G0VMPDrbCBVDHkb9oir2+AFFMMu4gAN3oVWma2zDWSrUJpauSv4x5uKTQtVlt93/H8kUzY0gn+D+WS42XTac3Fp5YbSphT7Bdh7Kaas6wdGja2XortWtGsr5fKyBju/KP9V1E4IokoxBaNMiqc7aMIrpv+zanM= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1775213074420503.29643737096455; Fri, 3 Apr 2026 03:44:34 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1w8c08-00040B-Hc; Fri, 03 Apr 2026 06:43:44 -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 1w8c06-0003zc-PW for qemu-devel@nongnu.org; Fri, 03 Apr 2026 06:43:43 -0400 Received: from isrv.corpit.ru ([212.248.84.144]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1w8c04-0005Zs-RM for qemu-devel@nongnu.org; Fri, 03 Apr 2026 06:43:42 -0400 Received: from tsrv.corpit.ru (tsrv.tls.msk.ru [192.168.177.2]) by isrv.corpit.ru (Postfix) with ESMTP id 3238119A63F; Fri, 03 Apr 2026 13:42:51 +0300 (MSK) Received: from think4mjt.tls.msk.ru (mjtthink.wg.tls.msk.ru [192.168.177.146]) by tsrv.corpit.ru (Postfix) with ESMTP id E4A8638DB6F; Fri, 03 Apr 2026 13:43:28 +0300 (MSK) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=tls.msk.ru; s=202602; t=1775212971; bh=TtuDL2Etv4LGoH/eh3G6KM/jsLfmjseHryGBapyUNqw=; h=From:To:Cc:Subject:Date:In-Reply-To:References; b=s78AUX8TQ/4tOF3a/T8OlkpugjcKgdt/JB3tI6P8CX2p/5RCVjFNZfz+JCJWFPzzC 8ZhAyMbOac6vrH0QPdNN6PLO7p2RMXaIbzzJjFUiM1kCtNzmorlHr6LGD3aY+Dflk5 dcBpeKHpOTDiEifSP02z5R228PM0mYCu5TKjhsyv41652VrCophLnss+EGN/lQb1pU ZqIgqp1itP9CSUvtFJs5KGEnftRV2KQwx7V1Oagf/AdzhQq4tBrTYN3g3ZcQXFgr8b g5nwn1l134YnTVcvLZQh8Tp09EyGeIYD2KSmLnblhpMY/GanrZWeY2hCwrgmtyFNUa He7VD9LFARBpQ== From: Michael Tokarev To: qemu-devel@nongnu.org Cc: =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= , Michael Tokarev Subject: [PATCH for-11.0 5/6] qom: Restrict compat properties API to system emulation Date: Fri, 3 Apr 2026 13:43:25 +0300 Message-ID: <20260403104327.1163942-6-mjt@tls.msk.ru> X-Mailer: git-send-email 2.47.3 In-Reply-To: <20260403104327.1163942-1-mjt@tls.msk.ru> References: <20260403104327.1163942-1-mjt@tls.msk.ru> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Received-SPF: pass (zohomail.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; Received-SPF: pass client-ip=212.248.84.144; envelope-from=mjt@tls.msk.ru; helo=isrv.corpit.ru X-Spam_score_int: -19 X-Spam_score: -2.0 X-Spam_bar: -- X-Spam_report: (-2.0 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, RCVD_IN_VALIDITY_CERTIFIED_BLOCKED=0.001, RCVD_IN_VALIDITY_RPBL_BLOCKED=0.001, 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: qemu development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @tls.msk.ru) X-ZM-MESSAGEID: 1775213077108158500 From: Philippe Mathieu-Daud=C3=A9 Move compat properties API definitions to their own file unit, compile it only when system emulation is configured. Signed-off-by: Philippe Mathieu-Daud=C3=A9 Reviewed-by: Michael Tokarev --- qom/compat-properties.c | 116 ++++++++++++++++++++++++++++++++++++++++ qom/meson.build | 3 ++ qom/object.c | 100 ---------------------------------- 3 files changed, 119 insertions(+), 100 deletions(-) create mode 100644 qom/compat-properties.c diff --git a/qom/compat-properties.c b/qom/compat-properties.c new file mode 100644 index 0000000000..f8d9b0036a --- /dev/null +++ b/qom/compat-properties.c @@ -0,0 +1,116 @@ +/* + * QEMU Object Model + * + * Copyright IBM, Corp. 2011 + * + * Authors: + * Anthony Liguori + * + * SPDX-License-Identifier: GPL-2.0-or-later + */ + +#include "qemu/osdep.h" +#include "qapi/error.h" +#include "qom/compat-properties.h" +#include "qom/qom-qobject.h" +#include "hw/core/qdev.h" + +bool object_apply_global_props(Object *obj, const GPtrArray *props, + Error **errp) +{ + int i; + + if (!props) { + return true; + } + + for (i =3D 0; i < props->len; i++) { + GlobalProperty *p =3D g_ptr_array_index(props, i); + Error *err =3D NULL; + + if (object_dynamic_cast(obj, p->driver) =3D=3D NULL) { + continue; + } + if (p->optional && !object_property_find(obj, p->property)) { + continue; + } + p->used =3D true; + if (!object_property_parse(obj, p->property, p->value, &err)) { + error_prepend(&err, "can't apply global %s.%s=3D%s: ", + p->driver, p->property, p->value); + /* + * If errp !=3D NULL, propagate error and return. + * If errp =3D=3D NULL, report a warning, but keep going + * with the remaining globals. + */ + if (errp) { + error_propagate(errp, err); + return false; + } else { + warn_report_err(err); + } + } + } + + return true; +} + +/* + * Global property defaults + * Slot 0: accelerator's global property defaults + * Slot 1: machine's global property defaults + * Slot 2: global properties from legacy command line option + * Each is a GPtrArray of GlobalProperty. + * Applied in order, later entries override earlier ones. + */ +static GPtrArray *object_compat_props[3]; + +/* + * Retrieve @GPtrArray for global property defined with options + * other than "-global". These are generally used for syntactic + * sugar and legacy command line options. + */ +void object_register_sugar_prop(const char *driver, const char *prop, + const char *value, bool optional) +{ + GlobalProperty *g; + if (!object_compat_props[2]) { + object_compat_props[2] =3D g_ptr_array_new(); + } + g =3D g_new0(GlobalProperty, 1); + g->driver =3D g_strdup(driver); + g->property =3D g_strdup(prop); + g->value =3D g_strdup(value); + g->optional =3D optional; + g_ptr_array_add(object_compat_props[2], g); +} + +/* + * Set machine's global property defaults to @compat_props. + * May be called at most once. + */ +void object_set_machine_compat_props(GPtrArray *compat_props) +{ + assert(!object_compat_props[1]); + object_compat_props[1] =3D compat_props; +} + +/* + * Set accelerator's global property defaults to @compat_props. + * May be called at most once. + */ +void object_set_accelerator_compat_props(GPtrArray *compat_props) +{ + assert(!object_compat_props[0]); + object_compat_props[0] =3D compat_props; +} + +void object_apply_compat_props(Object *obj) +{ + int i; + + for (i =3D 0; i < ARRAY_SIZE(object_compat_props); i++) { + object_apply_global_props(obj, object_compat_props[i], + i =3D=3D 2 ? &error_fatal : &error_abort= ); + } +} diff --git a/qom/meson.build b/qom/meson.build index 8192243430..bd6f4aadd7 100644 --- a/qom/meson.build +++ b/qom/meson.build @@ -5,6 +5,9 @@ qom_ss.add(files( 'object_interfaces.c', 'qom-qobject.c', )) +if have_system + qom_ss.add(files('compat-properties.c')) +endif =20 qmp_ss.add(files('qom-qmp-cmds.c')) system_ss.add(files('qom-hmp-cmds.c')) diff --git a/qom/object.c b/qom/object.c index 838b1d2b22..f00d659ef0 100644 --- a/qom/object.c +++ b/qom/object.c @@ -440,106 +440,6 @@ static void object_post_init_with_type(Object *obj, T= ypeImpl *ti) } } =20 -bool object_apply_global_props(Object *obj, const GPtrArray *props, - Error **errp) -{ - int i; - - if (!props) { - return true; - } - - for (i =3D 0; i < props->len; i++) { - GlobalProperty *p =3D g_ptr_array_index(props, i); - Error *err =3D NULL; - - if (object_dynamic_cast(obj, p->driver) =3D=3D NULL) { - continue; - } - if (p->optional && !object_property_find(obj, p->property)) { - continue; - } - p->used =3D true; - if (!object_property_parse(obj, p->property, p->value, &err)) { - error_prepend(&err, "can't apply global %s.%s=3D%s: ", - p->driver, p->property, p->value); - /* - * If errp !=3D NULL, propagate error and return. - * If errp =3D=3D NULL, report a warning, but keep going - * with the remaining globals. - */ - if (errp) { - error_propagate(errp, err); - return false; - } else { - warn_report_err(err); - } - } - } - - return true; -} - -/* - * Global property defaults - * Slot 0: accelerator's global property defaults - * Slot 1: machine's global property defaults - * Slot 2: global properties from legacy command line option - * Each is a GPtrArray of GlobalProperty. - * Applied in order, later entries override earlier ones. - */ -static GPtrArray *object_compat_props[3]; - -/* - * Retrieve @GPtrArray for global property defined with options - * other than "-global". These are generally used for syntactic - * sugar and legacy command line options. - */ -void object_register_sugar_prop(const char *driver, const char *prop, - const char *value, bool optional) -{ - GlobalProperty *g; - if (!object_compat_props[2]) { - object_compat_props[2] =3D g_ptr_array_new(); - } - g =3D g_new0(GlobalProperty, 1); - g->driver =3D g_strdup(driver); - g->property =3D g_strdup(prop); - g->value =3D g_strdup(value); - g->optional =3D optional; - g_ptr_array_add(object_compat_props[2], g); -} - -/* - * Set machine's global property defaults to @compat_props. - * May be called at most once. - */ -void object_set_machine_compat_props(GPtrArray *compat_props) -{ - assert(!object_compat_props[1]); - object_compat_props[1] =3D compat_props; -} - -/* - * Set accelerator's global property defaults to @compat_props. - * May be called at most once. - */ -void object_set_accelerator_compat_props(GPtrArray *compat_props) -{ - assert(!object_compat_props[0]); - object_compat_props[0] =3D compat_props; -} - -void object_apply_compat_props(Object *obj) -{ - int i; - - for (i =3D 0; i < ARRAY_SIZE(object_compat_props); i++) { - object_apply_global_props(obj, object_compat_props[i], - i =3D=3D 2 ? &error_fatal : &error_abort= ); - } -} - static void object_class_property_init_all(Object *obj) { ObjectPropertyIterator iter; --=20 2.47.3 From nobody Sat Apr 11 18:39:15 2026 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org ARC-Seal: i=1; a=rsa-sha256; t=1775213055; cv=none; d=zohomail.com; s=zohoarc; b=MjsGx2KlKIheUV3Jid2uQdsjNZ+HFXGMsCu2elnSyS8xv1rCYQVx84WjNKr5B2DthGI04IF+qYkdJL7p3GzgDYQxT12Ve86S2MzFh38UMeodrn1eruERGEecXxJgLtlu0G8eX+BK/4zXK+zZ71Kwyghwsey6okEzQf6XbPnAMOU= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1775213055; h=Content-Transfer-Encoding:Cc:Cc:Date:Date:From:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:Subject:To:To:Message-Id:Reply-To; bh=BjZwUNB0BK9mtv3PJKfByxFlNm/0mrK+trwXk107I+U=; b=B71HJHPVK6D+XTPq3n+BQ5peaJJbj5kGLQxQxxxLCPzTjW2bMFOP55fc60KCtKdLRtZryuC1gWoRpf3SwcjtqNDd3UO/+vHXeGYJhjvpRfEI2gjUNjxESM7/Q1vATqww9Ug+FFxNCjW4bhN3qfLGftvBpdts21I/2uLL4zn9OxM= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1775213054555104.97363320110276; Fri, 3 Apr 2026 03:44:14 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1w8c0C-000418-1v; Fri, 03 Apr 2026 06:43:48 -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 1w8c09-00040X-S7 for qemu-devel@nongnu.org; Fri, 03 Apr 2026 06:43:45 -0400 Received: from isrv.corpit.ru ([212.248.84.144]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1w8c07-0005by-WD for qemu-devel@nongnu.org; Fri, 03 Apr 2026 06:43:45 -0400 Received: from tsrv.corpit.ru (tsrv.tls.msk.ru [192.168.177.2]) by isrv.corpit.ru (Postfix) with ESMTP id 3EA5119A640; Fri, 03 Apr 2026 13:42:51 +0300 (MSK) Received: from think4mjt.tls.msk.ru (mjtthink.wg.tls.msk.ru [192.168.177.146]) by tsrv.corpit.ru (Postfix) with ESMTP id F1AD338DB70; Fri, 03 Apr 2026 13:43:28 +0300 (MSK) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=tls.msk.ru; s=202602; t=1775212971; bh=PZxZax746ngAAU2XKXJByYV5R66SacE2lzw99jqs69c=; h=From:To:Cc:Subject:Date:In-Reply-To:References; b=jQO3+9dBPiEJWCzr5ss3TRpMTXbOKxZ2AjAzr98242ofnrogLRLz9g60UiFEcm3Ni OEPPX4eJQSD+97FOGTYIZQGpurcye30kASbLyIQjFa2ObGT4AmUFjE+TWv/DMCz9kt Zx2NqIigEcmoiG3m8p857evcdtkgiCjNB6VxHbU/OAfVAv5a1xhq7evtD1nA0r65ri DqDC87Y5njxbM8a8yAhox90I2cxVls9sYr+1hLX5q7hbF4KljRIuZtib/DzCqdUBnX MvkZnsh8JsgKlweOcu2AXQIGQls20uLimMFuxin8B7eNUoztFEzCJu1/pzcS4QGB7h vr3/uYpdFojMQ== From: Michael Tokarev To: qemu-devel@nongnu.org Cc: Helge Deller , Michael Tokarev Subject: [PATCH for-11.0 6/6] RFC: Allow building qemu tools on 32-bit hosts Date: Fri, 3 Apr 2026 13:43:26 +0300 Message-ID: <20260403104327.1163942-7-mjt@tls.msk.ru> X-Mailer: git-send-email 2.47.3 In-Reply-To: <20260403104327.1163942-1-mjt@tls.msk.ru> References: <20260403104327.1163942-1-mjt@tls.msk.ru> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Received-SPF: pass (zohomail.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; Received-SPF: pass client-ip=212.248.84.144; envelope-from=mjt@tls.msk.ru; helo=isrv.corpit.ru X-Spam_score_int: -19 X-Spam_score: -2.0 X-Spam_bar: -- X-Spam_report: (-2.0 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, RCVD_IN_VALIDITY_CERTIFIED_BLOCKED=0.001, RCVD_IN_VALIDITY_RPBL_BLOCKED=0.001, 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: qemu development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @tls.msk.ru) X-ZM-MESSAGEID: 1775213060616154100 Content-Type: text/plain; charset="utf-8" From: Helge Deller Qemu's tools like qemu-img are often needed on 32-bit platforms, although the actual qemu emulators have been discontinued on 32-bit. To allow building the tools on 32-bit this patch implements two small changes: a) The check in meson.build is changed to still error out if the user tries to build qemu-system or qemu-user on a 32-bit platform, but allows building tools (e.g. by "--enable-tools") alone. b) Remove the compile time checks in atomic.h because: - for the qemu-system and qemu-user emulators this check is redundant since we only allow 64-bit platforms anyway (see a) - it breaks those 32-bit platforms, which do provide (slower) 64-bit atomics - 32-bit platforms without 64-bit atomics will fail instead with linker err= ors - the runtime speed of the qemu tools aren't actually that important. I've sucessfully tested building qemu tools on 32-bit hppa. Signed-off-by: Helge Deller Reviewed-by: Michael Tokarev --- include/qemu/atomic.h | 16 ---------------- meson.build | 4 ++-- 2 files changed, 2 insertions(+), 18 deletions(-) diff --git a/include/qemu/atomic.h b/include/qemu/atomic.h index dc9290084b..f05dce36eb 100644 --- a/include/qemu/atomic.h +++ b/include/qemu/atomic.h @@ -56,14 +56,6 @@ */ #define signal_barrier() __atomic_signal_fence(__ATOMIC_SEQ_CST) =20 -/* - * Sanity check that the size of an atomic operation isn't "overly large". - * Despite the fact that e.g. i686 has 64-bit atomic operations, we do not - * want to use them because we ought not need them, and this lets us do a - * bit of sanity checking that other 32-bit hosts might build. - */ -#define ATOMIC_REG_SIZE sizeof(void *) - /* Weak atomic operations prevent the compiler moving other * loads/stores past the atomic operation load/store. However there is * no explicit memory barrier for the processor. @@ -79,7 +71,6 @@ =20 #define qatomic_read(ptr) \ ({ \ - qemu_build_assert(sizeof(*ptr) <=3D ATOMIC_REG_SIZE); \ qatomic_read__nocheck(ptr); \ }) =20 @@ -87,7 +78,6 @@ __atomic_store_n(ptr, i, __ATOMIC_RELAXED) =20 #define qatomic_set(ptr, i) do { \ - qemu_build_assert(sizeof(*ptr) <=3D ATOMIC_REG_SIZE); \ qatomic_set__nocheck(ptr, i); \ } while(0) =20 @@ -110,7 +100,6 @@ */ #define qatomic_rcu_read_internal(ptr, _val) \ ({ \ - qemu_build_assert(sizeof(*ptr) <=3D ATOMIC_REG_SIZE); \ typeof_strip_qual(*ptr) _val; \ qatomic_rcu_read__nocheck(ptr, &_val); \ _val; \ @@ -119,20 +108,17 @@ qatomic_rcu_read_internal((ptr), MAKE_IDENTIFIER(_val)) =20 #define qatomic_rcu_set(ptr, i) do { \ - qemu_build_assert(sizeof(*ptr) <=3D ATOMIC_REG_SIZE); \ __atomic_store_n(ptr, i, __ATOMIC_RELEASE); \ } while(0) =20 #define qatomic_load_acquire(ptr) \ ({ \ - qemu_build_assert(sizeof(*ptr) <=3D ATOMIC_REG_SIZE); \ typeof_strip_qual(*ptr) _val; \ __atomic_load(ptr, &_val, __ATOMIC_ACQUIRE); \ _val; \ }) =20 #define qatomic_store_release(ptr, i) do { \ - qemu_build_assert(sizeof(*ptr) <=3D ATOMIC_REG_SIZE); \ __atomic_store_n(ptr, i, __ATOMIC_RELEASE); \ } while(0) =20 @@ -144,7 +130,6 @@ }) =20 #define qatomic_xchg(ptr, i) ({ \ - qemu_build_assert(sizeof(*ptr) <=3D ATOMIC_REG_SIZE); \ qatomic_xchg__nocheck(ptr, i); \ }) =20 @@ -157,7 +142,6 @@ }) =20 #define qatomic_cmpxchg(ptr, old, new) ({ \ - qemu_build_assert(sizeof(*ptr) <=3D ATOMIC_REG_SIZE); \ qatomic_cmpxchg__nocheck(ptr, old, new); \ }) =20 diff --git a/meson.build b/meson.build index daa58e46a3..98a708372b 100644 --- a/meson.build +++ b/meson.build @@ -323,8 +323,8 @@ endif # Compiler flags # ################## =20 -if cc.sizeof('void *') < 8 - error('QEMU requires a 64-bit CPU host architecture') +if (cc.sizeof('void *') < 8) and (have_system or have_user) + error('QEMU emulator requires a 64-bit CPU host architecture. Only tools= may be built for 32-bit.') endif =20 foreach lang : all_languages --=20 2.47.3