From nobody Sun Sep 28 16:36:33 2025 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass header.i=@intel.com; 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; dmarc=pass(p=none dis=none) header.from=intel.com ARC-Seal: i=1; a=rsa-sha256; t=1758011702; cv=none; d=zohomail.com; s=zohoarc; b=CRmXqIQ8NSvCtyCqf3Vc/Cqv9nfUDUlJ+Iv4UI8FZzPjzZqPj4exjsOTBYEwhoouVxGDoYvxLwnYNshFQYTdAFqSBOVAaBNzx/WVnhJnqid3ElJCJn5h/2w3bhPr+vFw8XNBMQ0006wNDuj+VorahhdW+zPgR/OGObheDfLn730= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1758011702; 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=7LzxmcCVSrrm8ttNSnAKe4qd9zE3ox9NBjTH/qqNOng=; b=bpT/9I8iBgQxkz7oFI3wtarSNIQjY3veW1mCj0xGtEnrqKJGpCRa2kTZ7OY2UioyPndksWhFwALCR3o4j9wYiIjNvMUS5adj5mm1rk5R0/lC4NL84+kTRW+Xh5W9MR6xMH9vuoQHtSdEIwwxpFprY/l+v6UILg/B8Nto/3hUuac= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass header.i=@intel.com; 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; dmarc=pass header.from= (p=none dis=none) Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1758011702239592.5260994437433; Tue, 16 Sep 2025 01:35:02 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1uyR8z-0006aa-GN; Tue, 16 Sep 2025 04:34:35 -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 1uyR8q-0006RR-7f; Tue, 16 Sep 2025 04:34:25 -0400 Received: from mgamail.intel.com ([198.175.65.10]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1uyR8l-0005zx-Bp; Tue, 16 Sep 2025 04:34:23 -0400 Received: from orviesa007.jf.intel.com ([10.64.159.147]) by orvoesa102.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 16 Sep 2025 01:34:12 -0700 Received: from liuzhao-optiplex-7080.sh.intel.com ([10.239.160.39]) by orviesa007.jf.intel.com with ESMTP; 16 Sep 2025 01:34:10 -0700 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1758011659; x=1789547659; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=fFiQva2H+sKhH01fGDe/OdD0HBnTFMbT9bzsKhKkEaA=; b=ktc6c8ojwu734IYAfmZZZLGp10nU3H5YEUh1rsE2q1nWk2LAnqIfJNj8 SeIEdPZP9MGQgsAYWXu+H0OyTiQrlb/MFG/R5nq4uccvMEOmr6ywUUqLs 786MwsEZqHkGFd8WOE7/i/yErxj2QjVm1iTjzuRmoSSwha58K0yraxFjN b/K/3Sx+UfWJ0HKm+NiOHDbgHTYP0Jc0BOiVMJ7rv9TknMXoZsIGhjnAc iO49d7AB3z8GHaU3/+tilBihKtOzjgGPSY8QLokYEZyAfKw2RQq6R60o0 IA4I80YPFIMUJvY8fOvrSINoKErvuOjWNyX9yVfddN/wJGjbWSj0xzaZQ Q==; X-CSE-ConnectionGUID: cbMZ6IQ/Qza3z1EeNud1ww== X-CSE-MsgGUID: 5gcz3rPlTGu103vJBPShtQ== X-IronPort-AV: E=McAfee;i="6800,10657,11554"; a="77725132" X-IronPort-AV: E=Sophos;i="6.18,268,1751266800"; d="scan'208";a="77725132" X-CSE-ConnectionGUID: Fco1SyDoQJy6oYrDFwSO7g== X-CSE-MsgGUID: vHVACnGCT5qrXkKlUZr7IA== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="6.18,268,1751266800"; d="scan'208";a="174691003" From: Zhao Liu To: Paolo Bonzini , Manos Pitsidianakis Cc: qemu-devel@nongnu.org, qemu-rust@nongnu.org, Zhao Liu Subject: [PATCH 01/12] subprojects: Update .gitignore for proc-macro2 and syn Date: Tue, 16 Sep 2025 16:55:46 +0800 Message-Id: <20250916085557.2008344-2-zhao1.liu@intel.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20250916085557.2008344-1-zhao1.liu@intel.com> References: <20250916085557.2008344-1-zhao1.liu@intel.com> 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=198.175.65.10; envelope-from=zhao1.liu@intel.com; helo=mgamail.intel.com X-Spam_score_int: -43 X-Spam_score: -4.4 X-Spam_bar: ---- X-Spam_report: (-4.4 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-0.035, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_MED=-2.3, 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: 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 @intel.com) X-ZM-MESSAGEID: 1758011703530116600 Content-Type: text/plain; charset="utf-8" Signed-off-by: Zhao Liu Reviewed-by: Manos Pitsidianakis --- subprojects/.gitignore | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/subprojects/.gitignore b/subprojects/.gitignore index f4281934ce11..9d579f72d121 100644 --- a/subprojects/.gitignore +++ b/subprojects/.gitignore @@ -16,7 +16,7 @@ /libc-0.2.162 /proc-macro-error-1.0.4 /proc-macro-error-attr-1.0.4 -/proc-macro2-1.0.84 +/proc-macro2-1.0.95 /quote-1.0.36 -/syn-2.0.66 +/syn-2.0.104 /unicode-ident-1.0.12 --=20 2.34.1 From nobody Sun Sep 28 16:36:33 2025 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass header.i=@intel.com; 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; dmarc=pass(p=none dis=none) header.from=intel.com ARC-Seal: i=1; a=rsa-sha256; t=1758011701; cv=none; d=zohomail.com; s=zohoarc; b=H7P/IFqyHVQXNX39RnieqxugHv3VGW1MMhfgC3/u9a/xZKhJ7w7bwYTUF/zIF/V0RR9iazCIcPj9GTHP7mU3xcqBt3H8Q0vY9rkMj3JiSfR4iA8covTpBFAv+be0zxpMG7cxgP1xo3kVEg3mk7cfPJ8/E5QIKnmFjsmKkDpae7Q= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1758011701; 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=EoML3mEFPzJJdncS2oY39S/0gpl3/Bvcwfn4d4dlSK4=; b=hk9vBl2z4rct7Q2lGhYrxQ/uBPraE3spAn8YH1nNZDjZNMhPr0QB3r6cVfF2kQ3OgjN1Kt4MBO2Wx2loLuXo5dO1/NjqhlrQnrtn4ElXk1W+9NhJEbqPIsth0GIjGGPsYDPRALaUBkmrsrOWj6Nx7K4uAqGni8pTnCGpej+KbUY= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass header.i=@intel.com; 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; dmarc=pass header.from= (p=none dis=none) Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1758011701711127.27874832226337; Tue, 16 Sep 2025 01:35:01 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1uyR93-0006cN-D3; Tue, 16 Sep 2025 04:34: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 1uyR8s-0006ST-1h; Tue, 16 Sep 2025 04:34:27 -0400 Received: from mgamail.intel.com ([198.175.65.10]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1uyR8l-000603-9X; Tue, 16 Sep 2025 04:34:25 -0400 Received: from orviesa007.jf.intel.com ([10.64.159.147]) by orvoesa102.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 16 Sep 2025 01:34:13 -0700 Received: from liuzhao-optiplex-7080.sh.intel.com ([10.239.160.39]) by orviesa007.jf.intel.com with ESMTP; 16 Sep 2025 01:34:12 -0700 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1758011659; x=1789547659; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=ORWXerD37jFqYsN6f97Qk86vYctMV0Q2WHFX8EqP/Gs=; b=fj5WHSHNvuzqXc0KeDKKu0UUnYsTNrwtnHmFgfVxY5IxgiHb0XNjFoMt VO8RWF11ZviVifLYbBbBicL/l4rCQbNOlppc8Rw49RyesVtT4WYb8de2Z pcd+l10FM79ULGl5sUb+1xMxMLzkN/XdqD6eXH/R3GN+DXr6UAYGUsMGJ q20AEqVOhE7D8v9b8WWKtNKEPMgjwb6wj+UVPCkz+NatnsHseNvzuJkE9 gdxJieVnOU8YP7wqyfw4VJIUvogSXLZwAB2r2OBXZK0MjtCnqYG/nMrkz Ly3zk7hDs/ve7usrXbJ+S9yzMkJJv5DMYuLrCfYAxg/c9KBn16it6oUFE g==; X-CSE-ConnectionGUID: qNKFeQrISwiBOaH5f1PoPw== X-CSE-MsgGUID: Hg+kcjHOR32yP0LLgbklJw== X-IronPort-AV: E=McAfee;i="6800,10657,11554"; a="77725140" X-IronPort-AV: E=Sophos;i="6.18,268,1751266800"; d="scan'208";a="77725140" X-CSE-ConnectionGUID: 5VofO/RAS5+rV8En3ABZUw== X-CSE-MsgGUID: 2hUy7naGQhq70pEwuAexcQ== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="6.18,268,1751266800"; d="scan'208";a="174691012" From: Zhao Liu To: Paolo Bonzini , Manos Pitsidianakis Cc: qemu-devel@nongnu.org, qemu-rust@nongnu.org, Zhao Liu Subject: [PATCH 02/12] subprojects: Ignore .wraplock file generated by meson v1.9.0 Date: Tue, 16 Sep 2025 16:55:47 +0800 Message-Id: <20250916085557.2008344-3-zhao1.liu@intel.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20250916085557.2008344-1-zhao1.liu@intel.com> References: <20250916085557.2008344-1-zhao1.liu@intel.com> 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=198.175.65.10; envelope-from=zhao1.liu@intel.com; helo=mgamail.intel.com X-Spam_score_int: -43 X-Spam_score: -4.4 X-Spam_bar: ---- X-Spam_report: (-4.4 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-0.035, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_MED=-2.3, 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: 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 @intel.com) X-ZM-MESSAGEID: 1758011703551116600 Content-Type: text/plain; charset="utf-8" The .wraplock file is automatically generated by meson v1.9.0 (the related issue: https://github.com/mesonbuild/meson/issues/14948). Ignore it for now. Signed-off-by: Zhao Liu Reviewed-by: Manos Pitsidianakis --- subprojects/.gitignore | 3 +++ 1 file changed, 3 insertions(+) diff --git a/subprojects/.gitignore b/subprojects/.gitignore index 9d579f72d121..20b25845760f 100644 --- a/subprojects/.gitignore +++ b/subprojects/.gitignore @@ -20,3 +20,6 @@ /quote-1.0.36 /syn-2.0.104 /unicode-ident-1.0.12 + +# Workaround for Meson v1.9.0 https://github.com/mesonbuild/meson/issues/1= 4948 +/.wraplock --=20 2.34.1 From nobody Sun Sep 28 16:36:33 2025 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass header.i=@intel.com; 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; dmarc=pass(p=none dis=none) header.from=intel.com ARC-Seal: i=1; a=rsa-sha256; t=1758011742; cv=none; d=zohomail.com; s=zohoarc; b=jL2E2qYQN9JUgoDq0QsXQOVb8KTilKWbt40sKxyM/aed1UCBcN+XOQyY45Do/DySjE4uzBA0TVVluzGU8vQv+lF+Qm75Uo9S1ezTbctX3XSvpbswyLHnWSzD1dSg3QIfHBLcYMJrRx0maNb5vgPlZr/GluNGhrbKwSNW8cIrspw= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1758011742; 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=3CmUg2b183E1WsxGMcAYf+MJprOiiwq/0FTA9rqLTtw=; b=HMwoBc8Q86pmhEYyEAYaNCh/frpf5BNvXnMKFbSqNKVYecaxYiFGTpr2rQjZtu7Pj9Z5+g0V/QgYE0swF3uc9gKnj2W2EFVOwqn3BzjNqfGdHhtNR/WxDS1u1jiPoqUyiFHRZEpT6UVuabJtXm1MOppryfPfBRfPk1mBTSK5yfw= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass header.i=@intel.com; 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; dmarc=pass header.from= (p=none dis=none) Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 17580117427981017.7215024181235; Tue, 16 Sep 2025 01:35:42 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1uyR99-0006lA-54; Tue, 16 Sep 2025 04:34:43 -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 1uyR8z-0006bh-Q1; Tue, 16 Sep 2025 04:34:35 -0400 Received: from mgamail.intel.com ([198.175.65.10]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1uyR8r-0005zs-JF; Tue, 16 Sep 2025 04:34:33 -0400 Received: from orviesa007.jf.intel.com ([10.64.159.147]) by orvoesa102.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 16 Sep 2025 01:34:16 -0700 Received: from liuzhao-optiplex-7080.sh.intel.com ([10.239.160.39]) by orviesa007.jf.intel.com with ESMTP; 16 Sep 2025 01:34:13 -0700 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1758011666; x=1789547666; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=GuzeBHtL/53MAiPhgK+s+BNAuq5u5mNGV7VJ0Ymk0BQ=; b=b1pXEs7rEfKI7ro7vHKZ3spBVTI2RuaEeKRPlZcY2LebBlBPGaGLRyh/ z5EiYlUOcwzIRTYE3uiFJ3cRZObKtPy2GZEAwqU1U0y5q+w2aJ4cFOS5U 0M3BwxLSZs7loXmMoynxgoeZL0vRP/fLE55N7cUhLgoO61NYKPkGRT1vE 1njR9kl2tDxGflDa5p4ZMYw4+zlaXeTD14i+Y2EftDmj1VdsIIVikENvu wrDzLaJKZjP4geeTwj/XRvSgKb7sC2Cm1swB+IjOFd7vpd/Oy1DkHkndA td5sosHUDO7CkFECKsqO1qSWcieA9XT+IfMsHamOMm+ye55fhfb638nw8 w==; X-CSE-ConnectionGUID: j7ouXmT0QaS/53AIXtgkKA== X-CSE-MsgGUID: Odwg114mRVeJue2z7UAm1A== X-IronPort-AV: E=McAfee;i="6800,10657,11554"; a="77725147" X-IronPort-AV: E=Sophos;i="6.18,268,1751266800"; d="scan'208";a="77725147" X-CSE-ConnectionGUID: Oy3GDtaSQ5CHkw+dK+LgMA== X-CSE-MsgGUID: ik8W7+iQToi/4jB30uGitw== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="6.18,268,1751266800"; d="scan'208";a="174691025" From: Zhao Liu To: Paolo Bonzini , Manos Pitsidianakis Cc: qemu-devel@nongnu.org, qemu-rust@nongnu.org, Zhao Liu Subject: [PATCH 03/12] rust/qemu-macros: Fix Clippy's complaints about lambda parameter naming Date: Tue, 16 Sep 2025 16:55:48 +0800 Message-Id: <20250916085557.2008344-4-zhao1.liu@intel.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20250916085557.2008344-1-zhao1.liu@intel.com> References: <20250916085557.2008344-1-zhao1.liu@intel.com> 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=198.175.65.10; envelope-from=zhao1.liu@intel.com; helo=mgamail.intel.com X-Spam_score_int: -43 X-Spam_score: -4.4 X-Spam_bar: ---- X-Spam_report: (-4.4 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-0.035, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_MED=-2.3, 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: 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 @intel.com) X-ZM-MESSAGEID: 1758011743673116600 Content-Type: text/plain; charset="utf-8" error: `rename` shadows a previous, unrelated binding --> qemu-macros/src/lib.rs:265:14 | 265 | |rename| -> Result { | ^^^^^^ | note: previous binding is here --> qemu-macros/src/lib.rs:245:30 | 245 | let DeviceProperty { rename, defval } =3D prop; | ^^^^^^ =3D help: for further information visit https://rust-lang.github.io/rus= t-clippy/master/index.html#shadow_unrelated =3D note: requested on the command line with `-D clippy::shadow-unrelat= ed` Rename the lambda parameter to "prop_rename" to fix the above clippy error. Signed-off-by: Zhao Liu Reviewed-by: Manos Pitsidianakis --- rust/qemu-macros/src/lib.rs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/rust/qemu-macros/src/lib.rs b/rust/qemu-macros/src/lib.rs index 830b4326985b..ed4064d6e110 100644 --- a/rust/qemu-macros/src/lib.rs +++ b/rust/qemu-macros/src/lib.rs @@ -262,8 +262,8 @@ macro_rules! str_to_c_str { =20 let prop_name =3D rename.map_or_else( || str_to_c_str!(field_name.to_string(), field_name.span()), - |rename| -> Result { - match rename { + |prop_rename| -> Result { + match prop_rename { DevicePropertyName::CStr(cstr_lit) =3D> Ok(quote! { #c= str_lit }), DevicePropertyName::Str(str_lit) =3D> { str_to_c_str!(str_lit.value(), str_lit.span()) --=20 2.34.1 From nobody Sun Sep 28 16:36:33 2025 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass header.i=@intel.com; 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; dmarc=pass(p=none dis=none) header.from=intel.com ARC-Seal: i=1; a=rsa-sha256; t=1758011804; cv=none; d=zohomail.com; s=zohoarc; b=dOg1zwGJCCX0/ctZA3yvadq+3jlJxZPtCDmI9PfrZ6ZLdcmZpoD/sLn8dgPmv2xvnkBBOfC+LX4Pc9GM8tX2r8qRZK/T9T4a8mNWEUI9mxdVnvXEahYH1r7IWzqj9btqtCaHvjmyw4CzQNidMpJY6crZmu5Q8mcf4TzUvDKQrvc= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1758011804; 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=/yAx7Ux7vgjTpTG7TuSTOQUCimjinQXyk8owx3PWUSs=; b=k5VPHcQwj70F0aRUOpVdZkjJVU957vjE7Son0gpfThKCH/8rDvcuMjVAoZnPgetFtIy3XCfAHhPTcVgSdrBM8q7IIaqAGqxQM3aLhAxrmlZYMnEsAElVWWmE1QcKgJEO23nnxVo6jOBSbbyvaN7IzNJOmEijLbfCXhi/M3tBI+0= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass header.i=@intel.com; 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; dmarc=pass header.from= (p=none dis=none) Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 175801180475741.3926950997801; Tue, 16 Sep 2025 01:36:44 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1uyR9C-0006ui-29; Tue, 16 Sep 2025 04:34: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 1uyR8y-0006b0-3v; Tue, 16 Sep 2025 04:34:33 -0400 Received: from mgamail.intel.com ([198.175.65.10]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1uyR8r-0005zx-J8; Tue, 16 Sep 2025 04:34:31 -0400 Received: from orviesa007.jf.intel.com ([10.64.159.147]) by orvoesa102.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 16 Sep 2025 01:34:17 -0700 Received: from liuzhao-optiplex-7080.sh.intel.com ([10.239.160.39]) by orviesa007.jf.intel.com with ESMTP; 16 Sep 2025 01:34:15 -0700 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1758011666; x=1789547666; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=QhXn4b+aoCS1lHYLjiS4gbHnpewKQmdQNLfqddQ4+oA=; b=XBY/1tDAd7iFfVMsjvvrid9FmeB8k6TziwiFexrfCwmVvcth0noQ96xG +UuPt29UrnqUu86uZWuRlte3GuASovJgnNHbwqAzHCv1YFsx6rwSn9a1a 8W1HyQOU1QwaHlbPXQoqfN5l5eZS484NVsgK62NcVPi0+DCnBRKDFBzow BTlJ3ui8dVHJdZmvLZYqqH5QK2zyG6N39RoR/Dxv59UJkKs316IWrV4Ya uPfhaeiKO5YlUrCMD+XIUqTIJ093ESkCkB8ujIvx89V+mkIWo/ozhhToA sFSScFkAwdjw1ZFYP4IjXc+D318K5yOkIvgcskSRBVAmhDIFY55pL2haz Q==; X-CSE-ConnectionGUID: 63bpz2jcTQWSH6KqADCkQA== X-CSE-MsgGUID: 5iFKl4t3RRmS3GfpL7Edsw== X-IronPort-AV: E=McAfee;i="6800,10657,11554"; a="77725154" X-IronPort-AV: E=Sophos;i="6.18,268,1751266800"; d="scan'208";a="77725154" X-CSE-ConnectionGUID: cJCjiq65TgO2funTpBcsPQ== X-CSE-MsgGUID: uS2wbcb0QOa2PfeEeP6tLQ== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="6.18,268,1751266800"; d="scan'208";a="174691037" From: Zhao Liu To: Paolo Bonzini , Manos Pitsidianakis Cc: qemu-devel@nongnu.org, qemu-rust@nongnu.org, Zhao Liu Subject: [PATCH 04/12] rust/common/uninit: Fix Clippy's complaints about lifetime Date: Tue, 16 Sep 2025 16:55:49 +0800 Message-Id: <20250916085557.2008344-5-zhao1.liu@intel.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20250916085557.2008344-1-zhao1.liu@intel.com> References: <20250916085557.2008344-1-zhao1.liu@intel.com> 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=198.175.65.10; envelope-from=zhao1.liu@intel.com; helo=mgamail.intel.com X-Spam_score_int: -43 X-Spam_score: -4.4 X-Spam_bar: ---- X-Spam_report: (-4.4 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-0.035, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_MED=-2.3, RCVD_IN_VALIDITY_CERTIFIED_BLOCKED=0.001, RCVD_IN_VALIDITY_RPBL_BLOCKED=0.001, SPF_HELO_NONE=0.001, T_SPF_TEMPERROR=0.01 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+importer=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @intel.com) X-ZM-MESSAGEID: 1758011806354116600 Content-Type: text/plain; charset="utf-8" Clippy complains about the following cases and following its suggestion to fix these warnings. warning: the following explicit lifetimes could be elided: 'a --> common/src/uninit.rs:38:6 | 38 | impl<'a, T, U> Deref for MaybeUninitField<'a, T, U> { | ^^ ^^ | =3D help: for further information visit https://rust-lang.github.io/rust= -clippy/master/index.html#needless_lifetimes =3D note: `#[warn(clippy::needless_lifetimes)]` on by default help: elide the lifetimes | 38 - impl<'a, T, U> Deref for MaybeUninitField<'a, T, U> { 38 + impl Deref for MaybeUninitField<'_, T, U> { | warning: the following explicit lifetimes could be elided: 'a --> common/src/uninit.rs:49:6 | 49 | impl<'a, T, U> DerefMut for MaybeUninitField<'a, T, U> { | ^^ ^^ | =3D help: for further information visit https://rust-lang.github.io/rust= -clippy/master/index.html#needless_lifetimes help: elide the lifetimes | 49 - impl<'a, T, U> DerefMut for MaybeUninitField<'a, T, U> { 49 + impl DerefMut for MaybeUninitField<'_, T, U> { | warning: `common` (lib) generated 2 warnings (run `cargo clippy --fix --lib= -p common` to apply 2 suggestions) Signed-off-by: Zhao Liu Reviewed-by: Manos Pitsidianakis --- rust/common/src/uninit.rs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/rust/common/src/uninit.rs b/rust/common/src/uninit.rs index e7f9fcd2e3fb..8d021b1dfc6e 100644 --- a/rust/common/src/uninit.rs +++ b/rust/common/src/uninit.rs @@ -35,7 +35,7 @@ pub const fn parent_mut(f: &mut Self) -> *mut T { } } =20 -impl<'a, T, U> Deref for MaybeUninitField<'a, T, U> { +impl Deref for MaybeUninitField<'_, T, U> { type Target =3D MaybeUninit; =20 fn deref(&self) -> &MaybeUninit { @@ -46,7 +46,7 @@ fn deref(&self) -> &MaybeUninit { } } =20 -impl<'a, T, U> DerefMut for MaybeUninitField<'a, T, U> { +impl DerefMut for MaybeUninitField<'_, T, U> { fn deref_mut(&mut self) -> &mut MaybeUninit { // SAFETY: self.child was obtained by dereferencing a valid mutable // reference; the content of the memory may be invalid or uninitia= lized --=20 2.34.1 From nobody Sun Sep 28 16:36:33 2025 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass header.i=@intel.com; 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; dmarc=pass(p=none dis=none) header.from=intel.com ARC-Seal: i=1; a=rsa-sha256; t=1758011740; cv=none; d=zohomail.com; s=zohoarc; b=RPAZMSwWJrUTzido5PgnInXaxwZkj+/1bYxIKQqJCCMTqL+yAbS8/qEQVkfh90NC1Hkt20c5vhcs7RXAkKpKRFO9ImCBIbZfgy4wM6q9JS9IHvWFzYwPE+RKUtd/sYuzfI49A3ts9/oNEnBYCKs3mCVahYTIjsUAinMPvNeKLxk= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1758011740; 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=69rVI9/7pa38fWQGYW0XwAcwjEB83IIqitcgZyEd7K0=; b=iOoWeQ6h5NcwyjsssoecUjeDUAPXkfIwApuUmOvqdmTH7sLInL7t6GVCks6xhALBlthyYFjjl1wa34RLzPL0FmAl5+ey76uC5L3fRUt86tDYSQeR/9jB/3JW27ARpdY7TFMPm5ePzn50K7F5tUrlQpmH2R+IYOZmFylTl7ESu9A= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass header.i=@intel.com; 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; dmarc=pass header.from= (p=none dis=none) Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1758011740653289.14289046019826; Tue, 16 Sep 2025 01:35:40 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1uyR9A-0006qm-Hs; Tue, 16 Sep 2025 04:34: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 1uyR8z-0006bG-Cn; Tue, 16 Sep 2025 04:34:33 -0400 Received: from mgamail.intel.com ([198.175.65.10]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1uyR8u-000603-BK; Tue, 16 Sep 2025 04:34:33 -0400 Received: from orviesa007.jf.intel.com ([10.64.159.147]) by orvoesa102.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 16 Sep 2025 01:34:19 -0700 Received: from liuzhao-optiplex-7080.sh.intel.com ([10.239.160.39]) by orviesa007.jf.intel.com with ESMTP; 16 Sep 2025 01:34:17 -0700 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1758011668; x=1789547668; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=t3omqHEsRg+fRPfTqu4MF2QVT2GB6AIlVz871hzEnu4=; b=GK4evcO8srX2XtSO9paV8I605Cf6oqcHRjmHE2Xpu7C9FQhdBikFwnBg Ilb2IceuNUlXfxcv5vI/yZ6H2Lhp8OXsbLziR5cTCVOO5CxT0k3Yk8CsY KZMZ4qzjwlOXam6DL4GA/Ddjqfi2RSEUJt5Wpz3rnXPqo/fRulcFQKUqA MPkeNDFTfcZQPFzzyeZa2IzX1XDtmkeGrPvWMxpaA29X59rQ2IhOTFQVC 4dFNLR4k4XfHSQmUf82ryzaf40NC+0uOfeqQ/2Uzv9tzCFjnoDIAReQC8 ztPzk/F2qtRnW6sCVMQYABqr9vFWoPjav3HkoypQfiq9lIrzYKLapYvjx w==; X-CSE-ConnectionGUID: 5Zskk2gtSyuC1BcvgNHLxQ== X-CSE-MsgGUID: HsQEXiCeRIe0EjSHecUPiA== X-IronPort-AV: E=McAfee;i="6800,10657,11554"; a="77725163" X-IronPort-AV: E=Sophos;i="6.18,268,1751266800"; d="scan'208";a="77725163" X-CSE-ConnectionGUID: hAOW4vpKRxyMPdwEdnayrw== X-CSE-MsgGUID: 6ynezYD6Ri2EVLqfHLTaMg== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="6.18,268,1751266800"; d="scan'208";a="174691055" From: Zhao Liu To: Paolo Bonzini , Manos Pitsidianakis Cc: qemu-devel@nongnu.org, qemu-rust@nongnu.org, Zhao Liu Subject: [PATCH 05/12] rust/qdev: use addr_of! in QDevProp Date: Tue, 16 Sep 2025 16:55:50 +0800 Message-Id: <20250916085557.2008344-6-zhao1.liu@intel.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20250916085557.2008344-1-zhao1.liu@intel.com> References: <20250916085557.2008344-1-zhao1.liu@intel.com> 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=198.175.65.10; envelope-from=zhao1.liu@intel.com; helo=mgamail.intel.com X-Spam_score_int: -43 X-Spam_score: -4.4 X-Spam_bar: ---- X-Spam_report: (-4.4 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-0.035, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_MED=-2.3, 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: 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 @intel.com) X-ZM-MESSAGEID: 1758011741558116600 Content-Type: text/plain; charset="utf-8" From: Manos Pitsidianakis We want a &raw pointer, so unsafe { &_ } is not needed. Suggested-by: Zhao Liu Signed-off-by: Manos Pitsidianakis Signed-off-by: Zhao Liu --- rust/hw/core/src/qdev.rs | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/rust/hw/core/src/qdev.rs b/rust/hw/core/src/qdev.rs index 71b9ef141c3a..3ee5b242622d 100644 --- a/rust/hw/core/src/qdev.rs +++ b/rust/hw/core/src/qdev.rs @@ -6,7 +6,7 @@ =20 use std::{ ffi::{c_int, c_void, CStr, CString}, - ptr::NonNull, + ptr::{addr_of, NonNull}, }; =20 use chardev::Chardev; @@ -129,17 +129,17 @@ pub unsafe trait QDevProp { =20 /// Use [`bindings::qdev_prop_bool`] for `bool`. unsafe impl QDevProp for bool { - const VALUE: *const bindings::PropertyInfo =3D unsafe { &bindings::qde= v_prop_bool }; + const VALUE: *const bindings::PropertyInfo =3D addr_of!(bindings::qdev= _prop_bool); } =20 /// Use [`bindings::qdev_prop_uint64`] for `u64`. unsafe impl QDevProp for u64 { - const VALUE: *const bindings::PropertyInfo =3D unsafe { &bindings::qde= v_prop_uint64 }; + const VALUE: *const bindings::PropertyInfo =3D addr_of!(bindings::qdev= _prop_uint64); } =20 /// Use [`bindings::qdev_prop_chr`] for [`chardev::CharBackend`]. unsafe impl QDevProp for chardev::CharBackend { - const VALUE: *const bindings::PropertyInfo =3D unsafe { &bindings::qde= v_prop_chr }; + const VALUE: *const bindings::PropertyInfo =3D addr_of!(bindings::qdev= _prop_chr); } =20 /// Trait to define device properties. --=20 2.34.1 From nobody Sun Sep 28 16:36:33 2025 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass header.i=@intel.com; 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; dmarc=pass(p=none dis=none) header.from=intel.com ARC-Seal: i=1; a=rsa-sha256; t=1758011854; cv=none; d=zohomail.com; s=zohoarc; b=e/XkBkzWUSLXEDwKrCQ7y+M0KD7/rTO8rHR8TCz0qHKQNdqkSvy3/Ik3KFhn9hj5g3u/v7vx8eoekWTwqZP8UfAjY2tEjHNgzW0iW3748/DBBvbXQ2PHFEGSLIX1Bj5Sq6cUbpN1kD9KCLscK7uLN6XFAzKcm7JAx2DvmpWhiAs= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1758011854; 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=nY0C5YxHXBfoTLqHmo4z0jn55vjizXQUcs9oYe5JNhk=; b=jWrX//Wnau46T91YGuMECQ/Fl8VY/HvSQG9FibrooD5s06hiZoxiQDX6GNjOxBhIW5sRtpNU99GDCZg0HfLCtdFXXKJ4EJzIIE674z43z/l0K2iZCirotO94m3TQdvv/tZHvrhjfVRMKFxJAPPPS41wopsKFi7be61JOgsmDIZ8= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass header.i=@intel.com; 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; dmarc=pass header.from= (p=none dis=none) Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1758011854533472.63146931893743; Tue, 16 Sep 2025 01:37:34 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1uyR9A-0006qk-JC; Tue, 16 Sep 2025 04:34: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 1uyR93-0006eC-Gn; Tue, 16 Sep 2025 04:34:38 -0400 Received: from mgamail.intel.com ([198.175.65.10]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1uyR8z-0005zx-GW; Tue, 16 Sep 2025 04:34:37 -0400 Received: from orviesa007.jf.intel.com ([10.64.159.147]) by orvoesa102.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 16 Sep 2025 01:34:20 -0700 Received: from liuzhao-optiplex-7080.sh.intel.com ([10.239.160.39]) by orviesa007.jf.intel.com with ESMTP; 16 Sep 2025 01:34:18 -0700 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1758011674; x=1789547674; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=5dOlQu9/LWVuyBR+Q9SafLwxJOv00jbSW+EcvT80qeI=; b=IzIiNn2Hu6kwT7jBTwTPUq7pHAu4IF3d/QF5FWUvjG4dZ07MZl2M4pe2 vdC3XPXHUEfyoWomLJL9uJ5WKp9LtsUqi94HwzrsWuzCLCXt6osI2vBj8 LBCKLAGrktpA3daTyUKwWua3Mi0/r88Z9mhojzDQWXJ45NmdqiHtzJvZd FpDVSNUp3ALEubhBA5+gtjtAJYUelAiLf37zIDyAiwY1Yz2OBcNSdfMxk DAoK0DsEPlZrkeJ6+F6RKiNDUgziFmPyzAuKVSqW5E+jNMtLB3qNPXk2m +zZkvcd7VFzozKpXAOnfDhBTux1oFvZUgQRY39IyAhSVH5TqrpuUhkArm A==; X-CSE-ConnectionGUID: Pj/6j6k6Rny/J8r8B5xcwA== X-CSE-MsgGUID: T9vLZnyLRWKSJ7y+6knONA== X-IronPort-AV: E=McAfee;i="6800,10657,11554"; a="77725172" X-IronPort-AV: E=Sophos;i="6.18,268,1751266800"; d="scan'208";a="77725172" X-CSE-ConnectionGUID: bcrpCV3OSjuK9oUIyX0WZQ== X-CSE-MsgGUID: Jxg/NQnSQ3WgQwsTUo0XSQ== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="6.18,268,1751266800"; d="scan'208";a="174691062" From: Zhao Liu To: Paolo Bonzini , Manos Pitsidianakis Cc: qemu-devel@nongnu.org, qemu-rust@nongnu.org, Zhao Liu Subject: [PATCH 06/12] rust/qdev: Refine the documentation for QDevProp trait Date: Tue, 16 Sep 2025 16:55:51 +0800 Message-Id: <20250916085557.2008344-7-zhao1.liu@intel.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20250916085557.2008344-1-zhao1.liu@intel.com> References: <20250916085557.2008344-1-zhao1.liu@intel.com> 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=198.175.65.10; envelope-from=zhao1.liu@intel.com; helo=mgamail.intel.com X-Spam_score_int: -43 X-Spam_score: -4.4 X-Spam_bar: ---- X-Spam_report: (-4.4 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-0.035, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_MED=-2.3, 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: 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 @intel.com) X-ZM-MESSAGEID: 1758011855093116600 Content-Type: text/plain; charset="utf-8" From: Manos Pitsidianakis Refine the documentation to clarify: * `unsfae` requires that `VALUE` must be valid. * using `*const` instead of `&` because the latter will cause compiler error. Signed-off-by: Manos Pitsidianakis Signed-off-by: Zhao Liu --- rust/hw/core/src/qdev.rs | 15 +++++++++++---- 1 file changed, 11 insertions(+), 4 deletions(-) diff --git a/rust/hw/core/src/qdev.rs b/rust/hw/core/src/qdev.rs index 3ee5b242622d..2735e2b2c109 100644 --- a/rust/hw/core/src/qdev.rs +++ b/rust/hw/core/src/qdev.rs @@ -109,9 +109,16 @@ pub trait ResettablePhasesImpl { /// /// # Safety /// -/// This trait is marked as `unsafe` because currently having a `const` re= fer to -/// an `extern static` as a reference instead of a raw pointer results in = this -/// compiler error: +/// This trait is marked as `unsafe` because `VALUE` must be a valid raw +/// reference to a [`bindings::PropertyInfo`]. +/// +/// Note we could not use a regular reference: +/// +/// ```text +/// const VALUE: &bindings::PropertyInfo =3D ... +/// ``` +/// +/// because this results in the following compiler error: /// /// ```text /// constructing invalid value: encountered reference to `extern` static i= n `const` @@ -119,7 +126,7 @@ pub trait ResettablePhasesImpl { /// /// This is because the compiler generally might dereference a normal refe= rence /// during const evaluation, but not in this case (if it did, it'd need to -/// dereference the raw pointer so this would fail to compile). +/// dereference the raw pointer so using a `*const` would also fail to com= pile). /// /// It is the implementer's responsibility to provide a valid /// [`bindings::PropertyInfo`] pointer for the trait implementation to be = safe. --=20 2.34.1 From nobody Sun Sep 28 16:36:33 2025 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass header.i=@intel.com; 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; dmarc=pass(p=none dis=none) header.from=intel.com ARC-Seal: i=1; a=rsa-sha256; t=1758011801; cv=none; d=zohomail.com; s=zohoarc; b=J04zEMT5ftATsn6AXNrF2oAERtOVXExHVuKA4qJgQhtcEzDSTRo/LsZHEasW7NtILNOhZkmstfMLRyDl2OjYO1UUryv0Podk+79LU5wco/qnZL23l+pEZKVrZ41K2CIu/MfBJ/dvBWxP0119rsNP1w16Sp/Po6ABg4MSRy+Jhe4= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1758011801; 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=L2NIZpYPNvkwFF2x+pKlVE3aWBWzllrQ3vIp9JaQ5QA=; b=Wt325VQWVN3l2+oJp7AgctN/7JVjDe4c4mACtRaNiEYxQlFGNUtxxCA/2bQdigTfNyORqsUdqCgb7rT06YsuAhZghf58NOJ74YT/OQbM/6772Eg9HnFPtAxKlwewKQAtYenlYT2nbr2w++mp/BsCt++Dka7uDfqGgEtv7eayyCI= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass header.i=@intel.com; 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; dmarc=pass header.from= (p=none dis=none) Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 175801180165350.46057635793659; Tue, 16 Sep 2025 01:36:41 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1uyR9B-0006tQ-KE; Tue, 16 Sep 2025 04:34:45 -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 1uyR97-0006gn-Ki; Tue, 16 Sep 2025 04:34:41 -0400 Received: from mgamail.intel.com ([198.175.65.10]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1uyR91-000603-Uv; Tue, 16 Sep 2025 04:34:39 -0400 Received: from orviesa007.jf.intel.com ([10.64.159.147]) by orvoesa102.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 16 Sep 2025 01:34:22 -0700 Received: from liuzhao-optiplex-7080.sh.intel.com ([10.239.160.39]) by orviesa007.jf.intel.com with ESMTP; 16 Sep 2025 01:34:20 -0700 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1758011676; x=1789547676; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=VO7sI8EkKjiuIxmrP/H7OvNMu6oE7ELux2ybMT1pdIE=; b=RxZjw3nR/SrdA6FOpORankBlxmtxA4kjwJldj73z6992bur4z9pFy94D LjhrZE2PeuOdTUqwtJ9GQGTERSMx5Q41T8eWCP90fsOF41z3MXi6RRpz6 6rACCKSaWXVKt/Qwm4k4gEmWlut05KuBOt44H52d/ky+eT9/i9Arcyus9 eDqdzrp5poCZQA9dhFIWEI302dxuS2uSLjWZWLJRztvA7Py74A+AW1SlK muSXjAE/zziTxt4gbKEf1w7GkfB+xSDttq2UTU9kmattSdxJSrYG74jwi pRlJT/tnmo5om0XhZw0C/ulZtUs110tD0TPFvfR9JxvCGYWVRjOib24t+ w==; X-CSE-ConnectionGUID: uW9GqoXtQbm/VoxKE8JaJg== X-CSE-MsgGUID: w9wKpmMZSmKtwdMXhowwhw== X-IronPort-AV: E=McAfee;i="6800,10657,11554"; a="77725179" X-IronPort-AV: E=Sophos;i="6.18,268,1751266800"; d="scan'208";a="77725179" X-CSE-ConnectionGUID: GlwNrBC1T/qr+Tr/Pahf+A== X-CSE-MsgGUID: 5JSql50AQzOflj35Hn3NGQ== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="6.18,268,1751266800"; d="scan'208";a="174691082" From: Zhao Liu To: Paolo Bonzini , Manos Pitsidianakis Cc: qemu-devel@nongnu.org, qemu-rust@nongnu.org, Zhao Liu Subject: [PATCH 07/12] rust/qdev: Rename PropertyInfo field from VALUE to BASE_INFO Date: Tue, 16 Sep 2025 16:55:52 +0800 Message-Id: <20250916085557.2008344-8-zhao1.liu@intel.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20250916085557.2008344-1-zhao1.liu@intel.com> References: <20250916085557.2008344-1-zhao1.liu@intel.com> 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=198.175.65.10; envelope-from=zhao1.liu@intel.com; helo=mgamail.intel.com X-Spam_score_int: -43 X-Spam_score: -4.4 X-Spam_bar: ---- X-Spam_report: (-4.4 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-0.035, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_MED=-2.3, 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: 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 @intel.com) X-ZM-MESSAGEID: 1758011802386116600 Content-Type: text/plain; charset="utf-8" Bit property info will added next. To distinguish different info fields, rename `VALUE` to `BASE_INFO`, then it can better reflect that it represents the basic property info. Signed-off-by: Zhao Liu Reviewed-by: Manos Pitsidianakis --- rust/hw/core/src/qdev.rs | 12 ++++++------ rust/qemu-macros/src/lib.rs | 2 +- 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/rust/hw/core/src/qdev.rs b/rust/hw/core/src/qdev.rs index 2735e2b2c109..d887046d8de1 100644 --- a/rust/hw/core/src/qdev.rs +++ b/rust/hw/core/src/qdev.rs @@ -109,13 +109,13 @@ pub trait ResettablePhasesImpl { /// /// # Safety /// -/// This trait is marked as `unsafe` because `VALUE` must be a valid raw +/// This trait is marked as `unsafe` because `BASE_INFO` must be a valid r= aw /// reference to a [`bindings::PropertyInfo`]. /// /// Note we could not use a regular reference: /// /// ```text -/// const VALUE: &bindings::PropertyInfo =3D ... +/// const BASE_INFO: &bindings::PropertyInfo =3D ... /// ``` /// /// because this results in the following compiler error: @@ -131,22 +131,22 @@ pub trait ResettablePhasesImpl { /// It is the implementer's responsibility to provide a valid /// [`bindings::PropertyInfo`] pointer for the trait implementation to be = safe. pub unsafe trait QDevProp { - const VALUE: *const bindings::PropertyInfo; + const BASE_INFO: *const bindings::PropertyInfo; } =20 /// Use [`bindings::qdev_prop_bool`] for `bool`. unsafe impl QDevProp for bool { - const VALUE: *const bindings::PropertyInfo =3D addr_of!(bindings::qdev= _prop_bool); + const BASE_INFO: *const bindings::PropertyInfo =3D addr_of!(bindings::= qdev_prop_bool); } =20 /// Use [`bindings::qdev_prop_uint64`] for `u64`. unsafe impl QDevProp for u64 { - const VALUE: *const bindings::PropertyInfo =3D addr_of!(bindings::qdev= _prop_uint64); + const BASE_INFO: *const bindings::PropertyInfo =3D addr_of!(bindings::= qdev_prop_uint64); } =20 /// Use [`bindings::qdev_prop_chr`] for [`chardev::CharBackend`]. unsafe impl QDevProp for chardev::CharBackend { - const VALUE: *const bindings::PropertyInfo =3D addr_of!(bindings::qdev= _prop_chr); + const BASE_INFO: *const bindings::PropertyInfo =3D addr_of!(bindings::= qdev_prop_chr); } =20 /// Trait to define device properties. diff --git a/rust/qemu-macros/src/lib.rs b/rust/qemu-macros/src/lib.rs index ed4064d6e110..b43ca31bae30 100644 --- a/rust/qemu-macros/src/lib.rs +++ b/rust/qemu-macros/src/lib.rs @@ -272,7 +272,7 @@ macro_rules! str_to_c_str { }, )?; let field_ty =3D field.ty.clone(); - let qdev_prop =3D quote! { <#field_ty as ::hwcore::QDevProp>::VALU= E }; + let qdev_prop =3D quote! { <#field_ty as ::hwcore::QDevProp>::BASE= _INFO }; let set_default =3D defval.is_some(); let defval =3D defval.unwrap_or(syn::Expr::Verbatim(quote! { 0 })); properties_expanded.push(quote! { --=20 2.34.1 From nobody Sun Sep 28 16:36:33 2025 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass header.i=@intel.com; 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; dmarc=pass(p=none dis=none) header.from=intel.com ARC-Seal: i=1; a=rsa-sha256; t=1758011851; cv=none; d=zohomail.com; s=zohoarc; b=RoTJRfIPith/XNZyk+n74gICPZctoopl6PfIOTPe3eu5uXEkscbsXxFfZ5v7KKRZ5U9B2ynWuU8alfjtlL5FN7uSsALreP7XvxwmUsH1JV1D75kqGY7A4EFUrQx3ZPuab/Lbf1lLvMzNxn+UfRtyL2j27DppGFTMbc2lHzsDNWA= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1758011851; 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=UC925ETHj5lx+f0ed+RTtiAwKmGRX5uiRtxmy/WkUNY=; b=NlOf0F26+l171Frlp2WycTblS8xjkfEysmWtFC0DuP/FRHzhIX/xhz4ovPEoUeMVY88eLVkSZT5Fj3oEhPV4edz29us7kBf2sEIrvodU9J+4DuCnlHh072RUTeLoW2Z74lpP6PDTs5SqtDALrNjmCDXKTjQ+07Wv51wXEEAvrd0= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass header.i=@intel.com; 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; dmarc=pass header.from= (p=none dis=none) Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1758011851547354.52269204192794; Tue, 16 Sep 2025 01:37:31 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1uyR9D-0006wi-66; Tue, 16 Sep 2025 04:34:47 -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 1uyR97-0006gp-Lk; Tue, 16 Sep 2025 04:34:41 -0400 Received: from mgamail.intel.com ([198.175.65.10]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1uyR91-0005zs-Vh; Tue, 16 Sep 2025 04:34:40 -0400 Received: from orviesa007.jf.intel.com ([10.64.159.147]) by orvoesa102.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 16 Sep 2025 01:34:24 -0700 Received: from liuzhao-optiplex-7080.sh.intel.com ([10.239.160.39]) by orviesa007.jf.intel.com with ESMTP; 16 Sep 2025 01:34:22 -0700 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1758011676; x=1789547676; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=p9Y4FxxNCJO8k3rMn0WRG6+uJf08DdF+53l2IzwHTQo=; b=M8u8OdvVA+nJvyRsD79iFeNE1S5B8JtHMA3iWuykN7NPdM9XyU5fP9tN 6fi68lJq4/0pVZ0eILfzmsfgfbXoqc1BltQVw/NAQmQ2DWsjFtp8EO9iO oyAHZJFy1Fn87kTM5jF+DAHlFYfGOuYUA8kngJfD7u0qJeP51mXIhrxDR 5V+Or0RuadBNJufPf6wIgWUrRd8y3ZvhZOyfe07sF254mkRAveBkkc8i5 sFhlK+tfF2rrM6m7K2g2jMTv2Qy7jOuC4RSK0nFM125KUonj8sgKxCN3F WDD8PNHHCD4k/A5fKIpWsGw4Nu/haPQOpymmWqaPbBNGYbzqb/gdeo3FJ w==; X-CSE-ConnectionGUID: tuKjyQamSTe1HoaQo5EYZA== X-CSE-MsgGUID: bqyu53swR2a2NnygreaKEw== X-IronPort-AV: E=McAfee;i="6800,10657,11554"; a="77725189" X-IronPort-AV: E=Sophos;i="6.18,268,1751266800"; d="scan'208";a="77725189" X-CSE-ConnectionGUID: +C3BFFERSXmXLsW/u29JpQ== X-CSE-MsgGUID: R0kZ0Lb5QayhxG8CHs1r9Q== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="6.18,268,1751266800"; d="scan'208";a="174691098" From: Zhao Liu To: Paolo Bonzini , Manos Pitsidianakis Cc: qemu-devel@nongnu.org, qemu-rust@nongnu.org, Zhao Liu Subject: [PATCH 08/12] rust/qdev: Support property info for more common types Date: Tue, 16 Sep 2025 16:55:53 +0800 Message-Id: <20250916085557.2008344-9-zhao1.liu@intel.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20250916085557.2008344-1-zhao1.liu@intel.com> References: <20250916085557.2008344-1-zhao1.liu@intel.com> 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=198.175.65.10; envelope-from=zhao1.liu@intel.com; helo=mgamail.intel.com X-Spam_score_int: -43 X-Spam_score: -4.4 X-Spam_bar: ---- X-Spam_report: (-4.4 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-0.035, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_MED=-2.3, 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: 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 @intel.com) X-ZM-MESSAGEID: 1758011853291116600 Content-Type: text/plain; charset="utf-8" Add a helper macro to implement QDevProp trait for u8/u16/u32/usize/i32 /i64. Signed-off-by: Zhao Liu Reviewed-by: Manos Pitsidianakis --- rust/hw/core/src/qdev.rs | 28 ++++++++++++++++------------ 1 file changed, 16 insertions(+), 12 deletions(-) diff --git a/rust/hw/core/src/qdev.rs b/rust/hw/core/src/qdev.rs index d887046d8de1..b57dc05ebb0e 100644 --- a/rust/hw/core/src/qdev.rs +++ b/rust/hw/core/src/qdev.rs @@ -134,20 +134,24 @@ pub unsafe trait QDevProp { const BASE_INFO: *const bindings::PropertyInfo; } =20 -/// Use [`bindings::qdev_prop_bool`] for `bool`. -unsafe impl QDevProp for bool { - const BASE_INFO: *const bindings::PropertyInfo =3D addr_of!(bindings::= qdev_prop_bool); -} - -/// Use [`bindings::qdev_prop_uint64`] for `u64`. -unsafe impl QDevProp for u64 { - const BASE_INFO: *const bindings::PropertyInfo =3D addr_of!(bindings::= qdev_prop_uint64); +macro_rules! impl_qdev_prop { + ($type:ty,$info:ident) =3D> { + unsafe impl $crate::qdev::QDevProp for $type { + const BASE_INFO: *const $crate::bindings::PropertyInfo =3D + addr_of!($crate::bindings::$info); + } + }; } =20 -/// Use [`bindings::qdev_prop_chr`] for [`chardev::CharBackend`]. -unsafe impl QDevProp for chardev::CharBackend { - const BASE_INFO: *const bindings::PropertyInfo =3D addr_of!(bindings::= qdev_prop_chr); -} +impl_qdev_prop!(bool, qdev_prop_bool); +impl_qdev_prop!(u8, qdev_prop_uint8); +impl_qdev_prop!(u16, qdev_prop_uint16); +impl_qdev_prop!(u32, qdev_prop_uint32); +impl_qdev_prop!(u64, qdev_prop_uint64); +impl_qdev_prop!(usize, qdev_prop_usize); +impl_qdev_prop!(i32, qdev_prop_int32); +impl_qdev_prop!(i64, qdev_prop_int64); +impl_qdev_prop!(chardev::CharBackend, qdev_prop_chr); =20 /// Trait to define device properties. /// --=20 2.34.1 From nobody Sun Sep 28 16:36:33 2025 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass header.i=@intel.com; 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; dmarc=pass(p=none dis=none) header.from=intel.com ARC-Seal: i=1; a=rsa-sha256; t=1758011776; cv=none; d=zohomail.com; s=zohoarc; b=EHqwcmiXkc8yn0iBV4uqS42ZKy3fJR12YgvOu3KzKlfI13/at5RrJgxmVUVs8nOblavSAW57Ru82ouaau/WxWtKwoHyIfvuIdMn6own9WZU7sp0lD5LZDj3c/e2OthgdbJCotzL0ktFxgAUTUQvxiQIrv3Y1fiqYQ8RWtLGqUq4= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1758011776; 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=zyCw5G9hfIzlcwm3i9gYHtIZiSBpZPTee2sXIRW71cI=; b=AKKQ2z9+3zJsvn0f+shaG2fz8GiVHhwNSWid5xuQPfJtHq8jNILFNOMZkIoyeIs1JAQsR06aS8cgnpo3b1tqTPQeGOWJAaPTv8Q2uRnHPVylamZA3Oc3j0an69NdcJeuPkYFE/X3moYt0owbTJQdAjL2Sekm0kLjJvRhYFVqWuY= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass header.i=@intel.com; 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; dmarc=pass header.from= (p=none dis=none) Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 175801177661452.72253535896971; Tue, 16 Sep 2025 01:36:16 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1uyR9F-0006xn-CN; Tue, 16 Sep 2025 04:34:49 -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 1uyR9A-0006sW-Pk; Tue, 16 Sep 2025 04:34:44 -0400 Received: from mgamail.intel.com ([198.175.65.10]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1uyR96-0005zx-4A; Tue, 16 Sep 2025 04:34:44 -0400 Received: from orviesa007.jf.intel.com ([10.64.159.147]) by orvoesa102.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 16 Sep 2025 01:34:26 -0700 Received: from liuzhao-optiplex-7080.sh.intel.com ([10.239.160.39]) by orviesa007.jf.intel.com with ESMTP; 16 Sep 2025 01:34:24 -0700 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1758011680; x=1789547680; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=JU7XScpelzyROakpaKr5C6kcia1NQZA7tGcllOsCJmM=; b=LB+kfExX7PfCNVqpUH4yFkwgbHW5WuaKI+GQYD7ydhTlctaIn9pTpd9Q k8DLM7KScJWnQoe8K66rlcXTAyx4XIc84qFpQL9y3OEKvKbW1iFhDtUif g+w708GxUrPfjLuLSozsQiEk3r8VeWh2dBS99k2pQTEQKWFjosG1E1pIt 8K3rAcP8d1VVIoFwSui5IfbsK4HAggVqkNmVlJLIvUSapRnmy3/50edqu STXUm3Mf5VaZPyPCLby44wSAohcb0kI7q4YWgUcuqGqcp3JuavFRSZlbb OOy7WgyWQPja+IUlKoT5C+tm2aOI7VvEvC6VHbFlJwfpa0Rdg74R/XwF5 g==; X-CSE-ConnectionGUID: Fwyi6V+FQn+y5R0v8Scp3A== X-CSE-MsgGUID: ssRpXlkRRI+xr2mOlXiUMQ== X-IronPort-AV: E=McAfee;i="6800,10657,11554"; a="77725195" X-IronPort-AV: E=Sophos;i="6.18,268,1751266800"; d="scan'208";a="77725195" X-CSE-ConnectionGUID: TsX6C8beSwq2K765Sf3F9Q== X-CSE-MsgGUID: cRVVQ2rkSo+6EIVPy04GIg== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="6.18,268,1751266800"; d="scan'208";a="174691110" From: Zhao Liu To: Paolo Bonzini , Manos Pitsidianakis Cc: qemu-devel@nongnu.org, qemu-rust@nongnu.org, Zhao Liu Subject: [PATCH 09/12] rust/qdev: Support bit property in #property macro Date: Tue, 16 Sep 2025 16:55:54 +0800 Message-Id: <20250916085557.2008344-10-zhao1.liu@intel.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20250916085557.2008344-1-zhao1.liu@intel.com> References: <20250916085557.2008344-1-zhao1.liu@intel.com> 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=198.175.65.10; envelope-from=zhao1.liu@intel.com; helo=mgamail.intel.com X-Spam_score_int: -43 X-Spam_score: -4.4 X-Spam_bar: ---- X-Spam_report: (-4.4 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-0.035, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_MED=-2.3, 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: 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 @intel.com) X-ZM-MESSAGEID: 1758011778358116600 Content-Type: text/plain; charset="utf-8" Add BIT_INFO to QDevProp trait, so that bit related property info could be bound to u32 & u64. Then add "bit=3D*" field in #property attributes macro to allow device to configure bit property. In addtion, convert the #property field parsing from `if-else` pattern to `match` pattern, to help readability. And note, the `bitnr` member of `Property` struct is generated by manual TokenStream construction, instead of conditional repetition (like #(bitnr: #bitnr,)?) since `quote` doesn't support this. Signed-off-by: Zhao Liu --- rust/hw/core/src/qdev.rs | 15 +++++--- rust/qemu-macros/src/lib.rs | 77 +++++++++++++++++++++++++------------ 2 files changed, 62 insertions(+), 30 deletions(-) diff --git a/rust/hw/core/src/qdev.rs b/rust/hw/core/src/qdev.rs index b57dc05ebb0e..a8cd9e3c2fd5 100644 --- a/rust/hw/core/src/qdev.rs +++ b/rust/hw/core/src/qdev.rs @@ -109,8 +109,8 @@ pub trait ResettablePhasesImpl { /// /// # Safety /// -/// This trait is marked as `unsafe` because `BASE_INFO` must be a valid r= aw -/// reference to a [`bindings::PropertyInfo`]. +/// This trait is marked as `unsafe` because `BASE_INFO` and `BIT_INFO` mu= st be +/// the valid raw references to [`bindings::PropertyInfo`]. /// /// Note we could not use a regular reference: /// @@ -132,13 +132,18 @@ pub trait ResettablePhasesImpl { /// [`bindings::PropertyInfo`] pointer for the trait implementation to be = safe. pub unsafe trait QDevProp { const BASE_INFO: *const bindings::PropertyInfo; + const BIT_INFO: *const bindings::PropertyInfo =3D { + panic!("invalid type for bit property"); + }; } =20 macro_rules! impl_qdev_prop { - ($type:ty,$info:ident) =3D> { + ($type:ty,$info:ident$(, $bit_info:ident)?) =3D> { unsafe impl $crate::qdev::QDevProp for $type { const BASE_INFO: *const $crate::bindings::PropertyInfo =3D addr_of!($crate::bindings::$info); + $(const BIT_INFO: *const $crate::bindings::PropertyInfo =3D + addr_of!($crate::bindings::$bit_info);)? } }; } @@ -146,8 +151,8 @@ unsafe impl $crate::qdev::QDevProp for $type { impl_qdev_prop!(bool, qdev_prop_bool); impl_qdev_prop!(u8, qdev_prop_uint8); impl_qdev_prop!(u16, qdev_prop_uint16); -impl_qdev_prop!(u32, qdev_prop_uint32); -impl_qdev_prop!(u64, qdev_prop_uint64); +impl_qdev_prop!(u32, qdev_prop_uint32, qdev_prop_bit); +impl_qdev_prop!(u64, qdev_prop_uint64, qdev_prop_bit64); impl_qdev_prop!(usize, qdev_prop_usize); impl_qdev_prop!(i32, qdev_prop_int32); impl_qdev_prop!(i64, qdev_prop_int64); diff --git a/rust/qemu-macros/src/lib.rs b/rust/qemu-macros/src/lib.rs index b43ca31bae30..8109ff239227 100644 --- a/rust/qemu-macros/src/lib.rs +++ b/rust/qemu-macros/src/lib.rs @@ -162,6 +162,7 @@ enum DevicePropertyName { #[derive(Debug)] struct DeviceProperty { rename: Option, + bitnr: Option, defval: Option, } =20 @@ -174,40 +175,56 @@ fn parse(input: syn::parse::ParseStream) -> syn::Resu= lt { debug_assert_eq!(&attribute.to_string(), "property"); let mut retval =3D Self { rename: None, + bitnr: None, defval: None, }; let content; _ =3D syn::parenthesized!(content in bracketed); while !content.is_empty() { let value: syn::Ident =3D content.parse()?; - if value =3D=3D "rename" { - let _: syn::Token![=3D] =3D content.parse()?; - if retval.rename.is_some() { - return Err(syn::Error::new( - value.span(), - "`rename` can only be used at most once", - )); + match value { + ref v if v =3D=3D "rename" =3D> { + let _: syn::Token![=3D] =3D content.parse()?; + if retval.rename.is_some() { + return Err(syn::Error::new( + value.span(), + "`rename` can only be used at most once", + )); + } + if content.peek(syn::LitStr) { + retval.rename =3D + Some(DevicePropertyName::Str(content.parse::()?)); + } else { + retval.rename =3D + Some(DevicePropertyName::CStr(content.parse::<= syn::LitCStr>()?)); + } } - if content.peek(syn::LitStr) { - retval.rename =3D Some(DevicePropertyName::Str(content= .parse::()?)); - } else { - retval.rename =3D - Some(DevicePropertyName::CStr(content.parse::()?)); + ref v if v =3D=3D "bit" =3D> { + let _: syn::Token![=3D] =3D content.parse()?; + if retval.bitnr.is_some() { + return Err(syn::Error::new( + value.span(), + "`bit` can only be used at most once", + )); + } + retval.bitnr =3D Some(content.parse()?); + } + ref v if v =3D=3D "default" =3D> { + let _: syn::Token![=3D] =3D content.parse()?; + if retval.defval.is_some() { + return Err(syn::Error::new( + value.span(), + "`default` can only be used at most once", + )); + } + retval.defval =3D Some(content.parse()?); } - } else if value =3D=3D "default" { - let _: syn::Token![=3D] =3D content.parse()?; - if retval.defval.is_some() { + _ =3D> { return Err(syn::Error::new( value.span(), - "`default` can only be used at most once", + format!("unrecognized field `{value}`"), )); } - retval.defval =3D Some(content.parse()?); - } else { - return Err(syn::Error::new( - value.span(), - format!("unrecognized field `{value}`"), - )); } =20 if !content.is_empty() { @@ -242,7 +259,11 @@ fn derive_device_or_error(input: DeriveInput) -> Resul= t {{ @@ -272,14 +293,20 @@ macro_rules! str_to_c_str { }, )?; let field_ty =3D field.ty.clone(); - let qdev_prop =3D quote! { <#field_ty as ::hwcore::QDevProp>::BASE= _INFO }; + let qdev_prop =3D if bitnr.is_none() { + quote! { <#field_ty as ::hwcore::QDevProp>::BASE_INFO } + } else { + quote! { <#field_ty as ::hwcore::QDevProp>::BIT_INFO } + }; + let bitnr =3D bitnr.unwrap_or(syn::Expr::Verbatim(quote! { 0 })); let set_default =3D defval.is_some(); let defval =3D defval.unwrap_or(syn::Expr::Verbatim(quote! { 0 })); properties_expanded.push(quote! { ::hwcore::bindings::Property { name: ::std::ffi::CStr::as_ptr(#prop_name), - info: #qdev_prop , + info: #qdev_prop, offset: ::core::mem::offset_of!(#name, #field_name) as isi= ze, + bitnr: #bitnr, set_default: #set_default, defval: ::hwcore::bindings::Property__bindgen_ty_1 { u: #d= efval as u64 }, ..::common::Zeroable::ZERO --=20 2.34.1 From nobody Sun Sep 28 16:36:33 2025 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass header.i=@intel.com; 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; dmarc=pass(p=none dis=none) header.from=intel.com ARC-Seal: i=1; a=rsa-sha256; t=1758011803; cv=none; d=zohomail.com; s=zohoarc; b=JoC7BQ4GQPdn43Px2DCxs60AhBPUnzlRORHoxxXFlva8Wih8YTKGSu1Izwv0q+4Nibx4WNHAHlXvSUpO1DgjAb/fQByPiq09mrNFGPoY9wT6Ah5j57fb5ZyU8TrDjyz4P60x+gqTHzSlDH2GuYExTFUJS5xqt7qgoLKrojUr/qU= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1758011803; 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=FsIufUCYaPgSUeJUsR70FbRmOSr9Q/j68D4/2l4n4mk=; b=VIFf/LY2QpQQPZ1+PjBAuwMdgD+ZRnIKGIjoC4/u26hZnfmuggJphmO2/e9Suzf6EWHvVDHa6pdzJGxc4gzYw0etEWEPF8XUui75nk6KifA9nuunExEb0wnDfUjbrFrk7s44Xz6XLYG6HCxkorN3iJS4pIfdY0xXv/uTD6Nyg5I= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass header.i=@intel.com; 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; dmarc=pass header.from= (p=none dis=none) Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 17580118036341008.1305815662739; Tue, 16 Sep 2025 01:36:43 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1uyR9G-0006z2-E5; Tue, 16 Sep 2025 04:34:50 -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 1uyR9E-0006xo-HY; Tue, 16 Sep 2025 04:34:48 -0400 Received: from mgamail.intel.com ([198.175.65.10]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1uyR9A-0005zs-L0; Tue, 16 Sep 2025 04:34:48 -0400 Received: from orviesa007.jf.intel.com ([10.64.159.147]) by orvoesa102.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 16 Sep 2025 01:34:28 -0700 Received: from liuzhao-optiplex-7080.sh.intel.com ([10.239.160.39]) by orviesa007.jf.intel.com with ESMTP; 16 Sep 2025 01:34:26 -0700 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1758011685; x=1789547685; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=waLJ79Z2ZxPOvRkgcef2yGkHILtwcEpwytE2aQ9sNt8=; b=kQYE2k9KCu1/S7Hd7L7B1uiICL45GpTwUaqcmNmpMWbLRE8+cqKVa5UZ JKk7d3aUHupNRXx0l2QPTarUuPXp62eE61kuJKtKysA4Ax21VN8QtoM4t eR05Jnf3Sh1inbKowNc1YCrE7jbhT6f1WNVrBReDJHOGE2Txm5F5pIkaI jOkT0LIVxK3qkcTmbW26gu5HPmfxiTiyTd5riDrP0LKb3mf7iNpBCfeQO /KKxr3EbVjlBFF3d2P7B3se9M2phTAdFDH2mbE9GgXHy9bJInjfIXf84F Buq/mDRVbj9G9IafRDDCOcAB2tByxYFhKOequfoERLGLMCZ/jl9n2hHV4 g==; X-CSE-ConnectionGUID: KgDHgSVbQ0mMFGurNvVNsg== X-CSE-MsgGUID: QkYjZcwRTdO7Q7qKphBk9g== X-IronPort-AV: E=McAfee;i="6800,10657,11554"; a="77725201" X-IronPort-AV: E=Sophos;i="6.18,268,1751266800"; d="scan'208";a="77725201" X-CSE-ConnectionGUID: OoSbty66ScCOe6p/w/1OEw== X-CSE-MsgGUID: zMOfhShATlKWLN2qdCebBQ== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="6.18,268,1751266800"; d="scan'208";a="174691118" From: Zhao Liu To: Paolo Bonzini , Manos Pitsidianakis Cc: qemu-devel@nongnu.org, qemu-rust@nongnu.org, Zhao Liu Subject: [PATCH 10/12] rust/hpet: Clean up type mismatch for num_timers property Date: Tue, 16 Sep 2025 16:55:55 +0800 Message-Id: <20250916085557.2008344-11-zhao1.liu@intel.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20250916085557.2008344-1-zhao1.liu@intel.com> References: <20250916085557.2008344-1-zhao1.liu@intel.com> 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=198.175.65.10; envelope-from=zhao1.liu@intel.com; helo=mgamail.intel.com X-Spam_score_int: -43 X-Spam_score: -4.4 X-Spam_bar: ---- X-Spam_report: (-4.4 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-0.035, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_MED=-2.3, 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: 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 @intel.com) X-ZM-MESSAGEID: 1758011804364116600 Content-Type: text/plain; charset="utf-8" Now `num_timers` is `usize` other than `u8`. Although the type field in `declare_properties` macro hasn't been used, it's better to explicitly point this out and clean up this before doing other property work. Signed-off-by: Zhao Liu --- rust/hw/timer/hpet/src/device.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/rust/hw/timer/hpet/src/device.rs b/rust/hw/timer/hpet/src/devi= ce.rs index 3cfbe9c32bb1..fce75415579d 100644 --- a/rust/hw/timer/hpet/src/device.rs +++ b/rust/hw/timer/hpet/src/device.rs @@ -909,7 +909,7 @@ impl ObjectImpl for HPETState { HPETState, num_timers, unsafe { &qdev_prop_usize }, - u8, + usize, default =3D HPET_MIN_TIMERS ), define_property!( --=20 2.34.1 From nobody Sun Sep 28 16:36:33 2025 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass header.i=@intel.com; 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; dmarc=pass(p=none dis=none) header.from=intel.com ARC-Seal: i=1; a=rsa-sha256; t=1758011702; cv=none; d=zohomail.com; s=zohoarc; b=Ri4UTTSasXB83UEZWfQ8goBQ+0Wbnt4/dj3MeWEQbla7sZnD5yeDkpVbjQ75+DJmgJdhPulhW7sH/RYMYrcVeRkPJckKiDj2uHB0Tz5Q6v4sVCyPTa3VTGtMppjfjGQ/4czTp7XI4+ymNdMvOp72DwBo0ZoG1VCyh7o1wPA6Ql8= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1758011702; 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=BqQaZ4ISh2etuIa9bGfm8eCxbBvl8BfNI/FNWwjChOQ=; b=Yr0k/hPh+hTGM48DFfFzRgXirgQG+MBBvSUESneN9CfnPH7uAD0Iiql2L3oTiBFyc1FMhXxbuquCrMdLyeeLFpyTrLU6vcrW00WVcVm/LFKL4i1RmN121fRxCcgA3vAVujIcCxqFExQYrDVYfpIwGXYlIdynaJwJwwOxDgktOq0= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass header.i=@intel.com; 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; dmarc=pass header.from= (p=none dis=none) Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1758011702105703.1488049991129; Tue, 16 Sep 2025 01:35:02 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1uyR9F-0006xu-7M; Tue, 16 Sep 2025 04:34:49 -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 1uyR9C-0006wc-T9; Tue, 16 Sep 2025 04:34:47 -0400 Received: from mgamail.intel.com ([198.175.65.10]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1uyR9A-000603-Pp; Tue, 16 Sep 2025 04:34:46 -0400 Received: from orviesa007.jf.intel.com ([10.64.159.147]) by orvoesa102.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 16 Sep 2025 01:34:29 -0700 Received: from liuzhao-optiplex-7080.sh.intel.com ([10.239.160.39]) by orviesa007.jf.intel.com with ESMTP; 16 Sep 2025 01:34:27 -0700 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1758011685; x=1789547685; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=3DpIAtVPe2GcmZt3Ew37XZkVJO/WxB+atKkvNLLCeOc=; b=YZWrYEGAossMaDR49VxaFnHLgN3b/dXUsXFWabE7BSoWn41xSD4ICCMb goxEABVJ/YxYuD5cWB+LpIStHVlWz5WW+4ltzAKsJVHB2JlYbNKT+PvOC IViEg7bw3GSs60b3SWleJ74Ns2ogjjs2riKPF7uIFZQBMbu8oqyflfAc5 s6K7HucKU4cDQ4diDLcLm8DNqvxtaeCmOvG4SmpRg28xmzmK73Na/P1ub sOHNOvaU1wR9LfwE4LC5wqf55kAkWykhtQyQHjcvcyQgjgcjWFweEu0sl XrWB6P66/QJEqx2sAw+ph54DsNHplZ95QYK4DmCBT/CuTVk2+bh5lmKCS g==; X-CSE-ConnectionGUID: 0yIEEV7kSNalv051fd3dRw== X-CSE-MsgGUID: 1CgURh5NSKWVMEBRPEGGMQ== X-IronPort-AV: E=McAfee;i="6800,10657,11554"; a="77725207" X-IronPort-AV: E=Sophos;i="6.18,268,1751266800"; d="scan'208";a="77725207" X-CSE-ConnectionGUID: KpBMtPJ8RHmxLNtMg2pK8w== X-CSE-MsgGUID: dMpdE2pHQZKSrNXfPK96hQ== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="6.18,268,1751266800"; d="scan'208";a="174691131" From: Zhao Liu To: Paolo Bonzini , Manos Pitsidianakis Cc: qemu-devel@nongnu.org, qemu-rust@nongnu.org, Zhao Liu Subject: [PATCH 11/12] rust/hpet: Convert qdev properties to #property macro Date: Tue, 16 Sep 2025 16:55:56 +0800 Message-Id: <20250916085557.2008344-12-zhao1.liu@intel.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20250916085557.2008344-1-zhao1.liu@intel.com> References: <20250916085557.2008344-1-zhao1.liu@intel.com> 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=198.175.65.10; envelope-from=zhao1.liu@intel.com; helo=mgamail.intel.com X-Spam_score_int: -43 X-Spam_score: -4.4 X-Spam_bar: ---- X-Spam_report: (-4.4 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-0.035, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_MED=-2.3, 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: 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 @intel.com) X-ZM-MESSAGEID: 1758011703672116600 Content-Type: text/plain; charset="utf-8" Convert HPET's properties to #property macro: * num_timers: usize property. * flags: u32 bit property. * int_route_cap: u32 property. * hpet_offset_saved: bool property. Signed-off-by: Zhao Liu Reviewed-by: Manos Pitsidianakis --- rust/hw/timer/hpet/src/device.rs | 55 ++++---------------------------- 1 file changed, 7 insertions(+), 48 deletions(-) diff --git a/rust/hw/timer/hpet/src/device.rs b/rust/hw/timer/hpet/src/devi= ce.rs index fce75415579d..86638c076666 100644 --- a/rust/hw/timer/hpet/src/device.rs +++ b/rust/hw/timer/hpet/src/device.rs @@ -13,9 +13,8 @@ use bql::{BqlCell, BqlRefCell}; use common::{bitops::IntegerExt, uninit_field_mut}; use hwcore::{ - bindings::{qdev_prop_bit, qdev_prop_bool, qdev_prop_uint32, qdev_prop_= usize}, - declare_properties, define_property, DeviceImpl, DeviceMethods, Device= State, InterruptSource, - Property, ResetType, ResettablePhasesImpl, SysBusDevice, SysBusDeviceI= mpl, SysBusDeviceMethods, + DeviceImpl, DeviceMethods, DeviceState, InterruptSource, ResetType, Re= settablePhasesImpl, + SysBusDevice, SysBusDeviceImpl, SysBusDeviceMethods, }; use migration::{ self, impl_vmstate_struct, vmstate_fields, vmstate_of, vmstate_subsect= ions, vmstate_validate, @@ -520,7 +519,7 @@ fn write(&mut self, reg: TimerRegister, value: u64, shi= ft: u32, len: u32) { =20 /// HPET Event Timer Block Abstraction #[repr(C)] -#[derive(qom::Object)] +#[derive(qom::Object, hwcore::Device)] pub struct HPETState { parent_obj: ParentField, iomem: MemoryRegion, @@ -540,10 +539,12 @@ pub struct HPETState { // Internal state /// Capabilities that QEMU HPET supports. /// bit 0: MSI (or FSB) support. + #[property(rename =3D "msi", bit =3D HPET_FLAG_MSI_SUPPORT_SHIFT as u8= , default =3D false)] flags: u32, =20 /// Offset of main counter relative to qemu clock. hpet_offset: BqlCell, + #[property(rename =3D "hpet-offset-saved", default =3D true)] hpet_offset_saved: bool, =20 irqs: [InterruptSource; HPET_NUM_IRQ_ROUTES], @@ -555,11 +556,13 @@ pub struct HPETState { /// the timers' interrupt can be routed, and is encoded in the /// bits 32:64 of timer N's config register: #[doc(alias =3D "intcap")] + #[property(rename =3D "hpet-intcap", default =3D 0)] int_route_cap: u32, =20 /// HPET timer array managed by this timer block. #[doc(alias =3D "timer")] timers: [BqlRefCell; HPET_MAX_TIMERS], + #[property(rename =3D "timers", default =3D HPET_MIN_TIMERS)] num_timers: usize, num_timers_save: BqlCell, =20 @@ -901,44 +904,6 @@ impl ObjectImpl for HPETState { const CLASS_INIT: fn(&mut Self::Class) =3D Self::Class::class_init::; } =20 -// TODO: Make these properties user-configurable! -declare_properties! { - HPET_PROPERTIES, - define_property!( - c"timers", - HPETState, - num_timers, - unsafe { &qdev_prop_usize }, - usize, - default =3D HPET_MIN_TIMERS - ), - define_property!( - c"msi", - HPETState, - flags, - unsafe { &qdev_prop_bit }, - u32, - bit =3D HPET_FLAG_MSI_SUPPORT_SHIFT as u8, - default =3D false, - ), - define_property!( - c"hpet-intcap", - HPETState, - int_route_cap, - unsafe { &qdev_prop_uint32 }, - u32, - default =3D 0 - ), - define_property!( - c"hpet-offset-saved", - HPETState, - hpet_offset_saved, - unsafe { &qdev_prop_bool }, - bool, - default =3D true - ), -} - static VMSTATE_HPET_RTC_IRQ_LEVEL: VMStateDescription =3D VMStateDescriptionBuilder::::new() .name(c"hpet/rtc_irq_level") @@ -1001,12 +966,6 @@ impl ObjectImpl for HPETState { )) .build(); =20 -// SAFETY: HPET_PROPERTIES is a valid Property array constructed with the -// hwcore::declare_properties macro. -unsafe impl hwcore::DevicePropertiesImpl for HPETState { - const PROPERTIES: &'static [Property] =3D &HPET_PROPERTIES; -} - impl DeviceImpl for HPETState { const VMSTATE: Option> =3D Some(VMSTATE_HPET); const REALIZE: Option util::Result<()>> =3D Some(Self::re= alize); --=20 2.34.1 From nobody Sun Sep 28 16:36:33 2025 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass header.i=@intel.com; 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; dmarc=pass(p=none dis=none) header.from=intel.com ARC-Seal: i=1; a=rsa-sha256; t=1758011736; cv=none; d=zohomail.com; s=zohoarc; b=SlqPYcQdBbgntBDJz0PZJAZBVcx7bwIjX88ClJG3jvARkBjQ3O1XZJIO9bR1mPpvDK8mm6VzmxSz/27hDt4aMJGPTG+K7y6tV8jJz5suXavPbWsNx1rIDf/KxQskE09YZ3LbUeV+p8ja1OLZE18yOmGv5i2dCq4R+3NQVcTz4sM= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1758011736; 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=exihX/P7M2OwRorvtgsSmHI4pEQN2QbKUIWHLbVVhZM=; b=kRmB6cPwS5q5gRFK0sk3Ld0+gpxzJ9y+ngVSQ3V1v5C5BGCl2vmjjOU7V8KqAzL/QNujxaGaI28N7T80nHSk1b0aOY4nJ6B4lcWvi44RJpROPwhfx6YHAk3412JLX3dMk+V2gqD5P2ysnUDWy+LZW9GKm1uIvbiHZCPA0l8Gmpw= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass header.i=@intel.com; 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; dmarc=pass header.from= (p=none dis=none) Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1758011735991425.4285179110558; Tue, 16 Sep 2025 01:35:35 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1uyR9f-0007am-2E; Tue, 16 Sep 2025 04:35:15 -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 1uyR9a-0007Vr-1B; Tue, 16 Sep 2025 04:35:10 -0400 Received: from mgamail.intel.com ([198.175.65.10]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1uyR9X-0005zx-3H; Tue, 16 Sep 2025 04:35:09 -0400 Received: from orviesa007.jf.intel.com ([10.64.159.147]) by orvoesa102.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 16 Sep 2025 01:34:31 -0700 Received: from liuzhao-optiplex-7080.sh.intel.com ([10.239.160.39]) by orviesa007.jf.intel.com with ESMTP; 16 Sep 2025 01:34:29 -0700 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1758011707; x=1789547707; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=c6s+RAJPZBzQdmFf2QbKGsWT+vtbTiMBphMI82r/Poo=; b=fSyiAxh+1HeCOFUUQzUhS3o/NrzvBRDNIy+/l3o0LqvTnPJevQhZvoHU 5uq4MpDRVCp9KA8dtfdeermXX5jdGKYeDGpK9FyrHYiKTeFe1PqlU0F3O Xy4mSU8G141PBv06LtVhHtHr/jXt/oq0TUuOfGErbpuOP7FoESDLfci0S uws9/M/SrvQ5rjoxAFRgYTZ6FNW1xEFgxnXMsgJnmNdxBNyrMOs7Mhw21 qer0Foby6z35o6tU26bRlhwywn9cPtva/PmpXjBkL2J8UXv4xtYpiTLrY l3RzcDMeP75pA0NNw7qjYeIxRE7dQ3tz0UJsaaMOaezXMIy9aTGKmacTF A==; X-CSE-ConnectionGUID: 4jhdDqcPRwK5ziG4Ud2OPQ== X-CSE-MsgGUID: A51sp1EJRvygqyIhoe8odQ== X-IronPort-AV: E=McAfee;i="6800,10657,11554"; a="77725213" X-IronPort-AV: E=Sophos;i="6.18,268,1751266800"; d="scan'208";a="77725213" X-CSE-ConnectionGUID: e+BY3QJgSc2a7+KOLQooXQ== X-CSE-MsgGUID: r45eLBvYSsmV7JRch/QF8g== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="6.18,268,1751266800"; d="scan'208";a="174691141" From: Zhao Liu To: Paolo Bonzini , Manos Pitsidianakis Cc: qemu-devel@nongnu.org, qemu-rust@nongnu.org, Zhao Liu Subject: [PATCH 12/12] rust/qdev: Drop declare_properties & define_property macros Date: Tue, 16 Sep 2025 16:55:57 +0800 Message-Id: <20250916085557.2008344-13-zhao1.liu@intel.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20250916085557.2008344-1-zhao1.liu@intel.com> References: <20250916085557.2008344-1-zhao1.liu@intel.com> 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=198.175.65.10; envelope-from=zhao1.liu@intel.com; helo=mgamail.intel.com X-Spam_score_int: -43 X-Spam_score: -4.4 X-Spam_bar: ---- X-Spam_report: (-4.4 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-0.035, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_MED=-2.3, 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: 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 @intel.com) X-ZM-MESSAGEID: 1758011741577116600 Content-Type: text/plain; charset="utf-8" After HPET's #property conversion, there's no use case for declare_properties & define_property. So get rid of them for now. In future, if there's something that #property really cannot resolve, they can be brought back. Signed-off-by: Zhao Liu Reviewed-by: Manos Pitsidianakis --- rust/hw/core/src/qdev.rs | 53 ---------------------------------------- 1 file changed, 53 deletions(-) diff --git a/rust/hw/core/src/qdev.rs b/rust/hw/core/src/qdev.rs index a8cd9e3c2fd5..a32ada4c175e 100644 --- a/rust/hw/core/src/qdev.rs +++ b/rust/hw/core/src/qdev.rs @@ -248,59 +248,6 @@ pub fn class_init(&mut self) { } } =20 -#[macro_export] -macro_rules! define_property { - ($name:expr, $state:ty, $field:ident, $prop:expr, $type:ty, bit =3D $b= itnr:expr, default =3D $defval:expr$(,)*) =3D> { - $crate::bindings::Property { - // use associated function syntax for type checking - name: ::std::ffi::CStr::as_ptr($name), - info: $prop, - offset: ::std::mem::offset_of!($state, $field) as isize, - bitnr: $bitnr, - set_default: true, - defval: $crate::bindings::Property__bindgen_ty_1 { u: $defval = as u64 }, - ..::common::zeroable::Zeroable::ZERO - } - }; - ($name:expr, $state:ty, $field:ident, $prop:expr, $type:ty, default = =3D $defval:expr$(,)*) =3D> { - $crate::bindings::Property { - // use associated function syntax for type checking - name: ::std::ffi::CStr::as_ptr($name), - info: $prop, - offset: ::std::mem::offset_of!($state, $field) as isize, - set_default: true, - defval: $crate::bindings::Property__bindgen_ty_1 { u: $defval = as u64 }, - ..::common::zeroable::Zeroable::ZERO - } - }; - ($name:expr, $state:ty, $field:ident, $prop:expr, $type:ty$(,)*) =3D> { - $crate::bindings::Property { - // use associated function syntax for type checking - name: ::std::ffi::CStr::as_ptr($name), - info: $prop, - offset: ::std::mem::offset_of!($state, $field) as isize, - set_default: false, - ..::common::zeroable::Zeroable::ZERO - } - }; -} - -#[macro_export] -macro_rules! declare_properties { - ($ident:ident, $($prop:expr),*$(,)*) =3D> { - pub static $ident: [$crate::bindings::Property; { - let mut len =3D 0; - $({ - _ =3D stringify!($prop); - len +=3D 1; - })* - len - }] =3D [ - $($prop),*, - ]; - }; -} - unsafe impl ObjectType for DeviceState { type Class =3D DeviceClass; const TYPE_NAME: &'static CStr =3D --=20 2.34.1