From nobody Sun Sep 28 15:29:06 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=1758383138; cv=none; d=zohomail.com; s=zohoarc; b=fotlFTti0bxkMQQpQGAMwCeL2dVuMlK8RCVaLNKFydbTn9qONmRiN4ffowARGWUVDYZhdBGI6UzZBm+5IeZICE0ks61MByey50NGN1rEXI0ne/b+8V3ilvV9J+CpUBXsQa0VtSidn57zS0OKuamy3Pa1o/HlcxBSGgjsEVDKAKg= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1758383138; 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=ur3c2nu8FArMddYFj1ZGCV8mG5HHH7auC7xa6/6ttMk=; b=HH+PO8egM68QWGavyhGkhBZ1U5QTqd87lcryXmSf/sPJh9f3hD4m+LfunElfIE+zPFBu2+Ejg0QhuKJtzCe27bTdFFGYiLdRn5mCeND8ccw+CUZMS/4oJssWK2RS4nZJgoVLeqnEix+HipcTLnA5mCr5xHh2bWwdtI7yD6zCH74= 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 175838313838874.5211646269604; Sat, 20 Sep 2025 08:45:38 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1uzzkj-0007wy-4t; Sat, 20 Sep 2025 11:43:57 -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 1uzzkb-0007uJ-48; Sat, 20 Sep 2025 11:43:50 -0400 Received: from mgamail.intel.com ([198.175.65.11]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1uzzkY-0001zT-8d; Sat, 20 Sep 2025 11:43:48 -0400 Received: from fmviesa004.fm.intel.com ([10.60.135.144]) by orvoesa103.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 20 Sep 2025 08:43:41 -0700 Received: from liuzhao-optiplex-7080.sh.intel.com ([10.239.160.39]) by fmviesa004.fm.intel.com with ESMTP; 20 Sep 2025 08:43:39 -0700 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1758383027; x=1789919027; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=FiodBfQIWHUki8bQeGhImk08nFJr+3jgVXS0P5WVo3s=; b=lDahQF+1x00hdMBNle8vrOmCSHaIEmO43rl0HTFDKOOz5SiKtINXAs2h nfMvTSMO4Yhnw15Fz9UTZ+KXg6YkaTros8++dPzG69e6xG6aBSL9dTong 3Vqudt3OewYPhKv5osTzSB+tcMdv09CxmTyTQfb+kAwzcKSRpBdRmDY9b NXvGSFaOv7vG0gEE+IXvUE9RBL8MfFF6zDwGtxCL21YwsLxu4rD3uwQPu HDeC3+yswjwV7hNDr9tFvz2UV1BtxIUn24yB/csehWGMPf/t+Pvq4/9X+ vD0IAi7Ly03HT6EdYXIGY6kuawn03Aw1Y50rPceB7V1RmwwPh4PQ2ExHI Q==; X-CSE-ConnectionGUID: kxSEbgx0T9inDMJfrmMynQ== X-CSE-MsgGUID: MWjlggIVTlq541I/XuqKzA== X-IronPort-AV: E=McAfee;i="6800,10657,11559"; a="70955491" X-IronPort-AV: E=Sophos;i="6.18,281,1751266800"; d="scan'208";a="70955491" X-CSE-ConnectionGUID: SMUMti+dQ36IuvJ9OWis1Q== X-CSE-MsgGUID: WmqcS8HsT5uGBoEHhAJc2g== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="6.18,281,1751266800"; d="scan'208";a="181349430" From: Zhao Liu To: Paolo Bonzini , Manos Pitsidianakis Cc: qemu-devel@nongnu.org, qemu-rust@nongnu.org, Zhao Liu Subject: [PATCH v2 01/12] subprojects: Update .gitignore for proc-macro2 and syn Date: Sun, 21 Sep 2025 00:05:09 +0800 Message-Id: <20250920160520.3699591-2-zhao1.liu@intel.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20250920160520.3699591-1-zhao1.liu@intel.com> References: <20250920160520.3699591-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.11; 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.045, 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_RPBL_BLOCKED=0.001, RCVD_IN_VALIDITY_SAFE_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: 1758383140139116600 Content-Type: text/plain; charset="utf-8" Reviewed-by: Manos Pitsidianakis Signed-off-by: Zhao Liu --- subprojects/.gitignore | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/subprojects/.gitignore b/subprojects/.gitignore index 4f2a489105e9..085de898d9d3 100644 --- a/subprojects/.gitignore +++ b/subprojects/.gitignore @@ -17,7 +17,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 /serde-1.0.219 /syn-2.0.104 --=20 2.34.1 From nobody Sun Sep 28 15:29:06 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=1758383135; cv=none; d=zohomail.com; s=zohoarc; b=g6JjFhDz/FrNgBo7VX+kux1ONff6m7Sn3Rr+z5VpSzv8jzx+J9EdW/p99Zd+zPdTpJC9VP2Cx7+mtvgHB8hnKZfU5CinL/tfGAha7Xw8fj1CZByKuFH80OZ9kSGDfXE0+/BJFa5TiKWWBkkuBxNCNr2x5/O91pTfgtrRT6GaABQ= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1758383135; 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=fg6citvY2EyGJBulqzjjI4ITiY2jOKa+YbkutJcejqM=; b=jq1gh/uJHDL0bH4l8f+ViPeJw1px2T7gzRm4F1A0hUQTRDcpWT3vNXkKjriWS5GoL2im3GvodFBk1mrY9QmDs95RvQxF8Pgrt/4O32Hp83/4Cglwjw6LOHi9YNY3aGLqki5YHAd5/Lpafeg+OKeHzahMDRIwTFqrZnsDcCumEE4= 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 1758383135635567.509679923929; Sat, 20 Sep 2025 08:45:35 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1uzzko-00080m-Bp; Sat, 20 Sep 2025 11:44:03 -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 1uzzkc-0007uw-5W; Sat, 20 Sep 2025 11:43:51 -0400 Received: from mgamail.intel.com ([198.175.65.11]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1uzzkY-0001zY-GH; Sat, 20 Sep 2025 11:43:49 -0400 Received: from fmviesa004.fm.intel.com ([10.60.135.144]) by orvoesa103.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 20 Sep 2025 08:43:43 -0700 Received: from liuzhao-optiplex-7080.sh.intel.com ([10.239.160.39]) by fmviesa004.fm.intel.com with ESMTP; 20 Sep 2025 08:43:40 -0700 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1758383027; x=1789919027; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=iHm4CkZ03uuJZvAPbt/KEPUG1yjYw42LQQXVgdoRFsE=; b=B576PABoE8ptKnbNwnYG4s51B2Qv7JjFiWApfgeBmEMj0bM2484GfqJw EPIUyOAIjKDWgh2TDfq8W7nHrkD2iLUjMhGjl6HcacRrj9Q425AZikPnY D6+BgDRjOv/B8dOTskxAp8l73GlSPOMqZCx7IZZHeJpHqIbjbdRyWRt30 7tWXwoSCK6Wxbot7/6U2C6vFARDiFiXKFH79+Y59A3YvsvDGBHKSxMk2v sM34wzp9yYOVAIDqeTx9kh/jUR8T1GlBoF5ZCeK/QxnFVxJVUNx5eXo6z OzczaNqQfhc+PJWsdIRWFQefozxA2AYhhIcUbSy98XmZ8PawS+P5xdcEY Q==; X-CSE-ConnectionGUID: azzeotCYS/S8ybbcBGMmXQ== X-CSE-MsgGUID: eMcPFD4MQhK4oN3bkx8CTg== X-IronPort-AV: E=McAfee;i="6800,10657,11559"; a="70955503" X-IronPort-AV: E=Sophos;i="6.18,281,1751266800"; d="scan'208";a="70955503" X-CSE-ConnectionGUID: FixEgr2rREW6jF6fS/Sg5Q== X-CSE-MsgGUID: 49Dt4NqqTdKqqKKi7Zi0Lg== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="6.18,281,1751266800"; d="scan'208";a="181349435" From: Zhao Liu To: Paolo Bonzini , Manos Pitsidianakis Cc: qemu-devel@nongnu.org, qemu-rust@nongnu.org, Zhao Liu Subject: [PATCH v2 02/12] subprojects: Ignore .wraplock file generated by meson v1.9.0 Date: Sun, 21 Sep 2025 00:05:10 +0800 Message-Id: <20250920160520.3699591-3-zhao1.liu@intel.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20250920160520.3699591-1-zhao1.liu@intel.com> References: <20250920160520.3699591-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.11; 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.045, 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_RPBL_BLOCKED=0.001, RCVD_IN_VALIDITY_SAFE_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: 1758383135944116600 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. Reviewed-by: Manos Pitsidianakis Signed-off-by: Zhao Liu --- subprojects/.gitignore | 3 +++ 1 file changed, 3 insertions(+) diff --git a/subprojects/.gitignore b/subprojects/.gitignore index 085de898d9d3..a7058cd4b0e5 100644 --- a/subprojects/.gitignore +++ b/subprojects/.gitignore @@ -22,3 +22,6 @@ /serde-1.0.219 /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 15:29:06 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=1758383152; cv=none; d=zohomail.com; s=zohoarc; b=bbdVbJ7HAcaKejtQ326HtaXBx3X9un+R1UOVsJ5MkxOtI5pFSKPXe9lc0RbrEEHYdUFkUdN0CcgRR5nYIrl91L5uIWLpdq/OcBUN5Zjn8WCpqTmUgHoNC81nRs5coasnryTqKI9MZ3EQglaQWVTCrzNA0er7K0VnNoxnsjS7YJI= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1758383152; 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=qL8cjH8+hA0sJFG681yjWWNua6EqSDIkVZ6P+AkvHLU=; b=Du/DzMP82CzQ1lnZbICk2DSXdKDVKHUHzEndy9CTB5K8DwRMzfhFM9IIurMXvpIGQUunrHo6DEPi3uBbCGEa7o7XeosXQ/iTUr9iXBtbqw9kvI6KhaCNcc+5C/jUC3OJQn93zUlW+7meOsPKbtU+vRmz9RAmG+2j+PsqXIVUHxc= 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 1758383152895180.9638301297514; Sat, 20 Sep 2025 08:45:52 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1uzzkn-0007zs-Ib; Sat, 20 Sep 2025 11:44:01 -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 1uzzke-0007va-UX; Sat, 20 Sep 2025 11:43:54 -0400 Received: from mgamail.intel.com ([198.175.65.11]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1uzzkb-0001zC-Hc; Sat, 20 Sep 2025 11:43:50 -0400 Received: from fmviesa004.fm.intel.com ([10.60.135.144]) by orvoesa103.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 20 Sep 2025 08:43:44 -0700 Received: from liuzhao-optiplex-7080.sh.intel.com ([10.239.160.39]) by fmviesa004.fm.intel.com with ESMTP; 20 Sep 2025 08:43:42 -0700 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1758383030; x=1789919030; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=e2m8PPZayoxqwvYik36u1YFgyjvQ2yQsYIRZWJ/B+oc=; b=ZGUmHXvIELot7WBiaJ5EttDbZz/gxyI/G2N0iy7OcjY1ZkmrMtQizpmj dkOBkXikB+Xza7LNN9KH3Uk/ecMyWSNYxCTrLs58jJkyLbpj68vxzq898 AXY7wMME8TXh0bxy+PRjOwA10wTAiTnw+qvwVu9p3a63z9wS8/7HqLvGO Fj/uk5sYRa1pCy1ivgg1tCjRM1qzJonq9H3Pwj+0ofAkonjWiXXjKoLGD UF4AA/gbHFpU+9LSJLg9XHVi5wHme104SP3GMCESqBf+Vuh8mXvYgBMn+ it7aind9ZLmFhu7DZX0q1vUgPFOCATBPWqg8XJPkrRFXjmSJ6W4mCFO4H w==; X-CSE-ConnectionGUID: WxP2DggDSnilSN42Za8ujw== X-CSE-MsgGUID: 14InECDLSaWG8UgJf98F5Q== X-IronPort-AV: E=McAfee;i="6800,10657,11559"; a="70955509" X-IronPort-AV: E=Sophos;i="6.18,281,1751266800"; d="scan'208";a="70955509" X-CSE-ConnectionGUID: tf4WPbhGT2io0nZ715Y6CQ== X-CSE-MsgGUID: KBXVuPVlSW+cXm450W2Wvw== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="6.18,281,1751266800"; d="scan'208";a="181349441" From: Zhao Liu To: Paolo Bonzini , Manos Pitsidianakis Cc: qemu-devel@nongnu.org, qemu-rust@nongnu.org, Zhao Liu Subject: [PATCH v2 03/12] rust/qemu-macros: Fix Clippy's complaints about lambda parameter naming Date: Sun, 21 Sep 2025 00:05:11 +0800 Message-Id: <20250920160520.3699591-4-zhao1.liu@intel.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20250920160520.3699591-1-zhao1.liu@intel.com> References: <20250920160520.3699591-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.11; 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.045, 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_RPBL_BLOCKED=0.001, RCVD_IN_VALIDITY_SAFE_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: 1758383154088116600 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. Reviewed-by: Manos Pitsidianakis Signed-off-by: Zhao Liu --- 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 8151fb6d4e1e..ed2b997b24a4 100644 --- a/rust/qemu-macros/src/lib.rs +++ b/rust/qemu-macros/src/lib.rs @@ -246,8 +246,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 15:29:06 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=1758383158; cv=none; d=zohomail.com; s=zohoarc; b=nE2sLPoiPkzPR71cwln01ULuWMftdpRREN/k0DOwGxIv5nInIrKWP787DGS0Npyf/jEgZUO+l/XIcEQfiZoUQYtVcJZt3r+KuB1snjirFkm8bNuNPTWp0iluYw4lW/Sd05o0E4tAAcEUc/B2mm3km0WK4LYcAovdAEWTlkKZh4g= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1758383158; 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=uqNQDZ1CnL9WECrBWyo8qQZ4ofU87IWf+hCoa4A2ZIU=; b=Cd90aX2BxnbiBzVdsMW7KMMTH8NO5QHozGt5kPNDgaxp68qrlD9wRTquHO+BPnYAuuqqtQHyXv2//CHNLLVAPbW9wMkXmnpF6iEmfGXSKMerT1vj4tmiCbCWBB4AjkDfAgjrCdlS8AavH11xaVHdnjcCrd38i4Oxzhn7VPoNGXo= 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 1758383158487275.2716826818256; Sat, 20 Sep 2025 08:45:58 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1uzzkn-0007zw-M6; Sat, 20 Sep 2025 11:44:01 -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 1uzzke-0007vb-V5; Sat, 20 Sep 2025 11:43:54 -0400 Received: from mgamail.intel.com ([198.175.65.11]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1uzzkb-0001zT-Ij; Sat, 20 Sep 2025 11:43:51 -0400 Received: from fmviesa004.fm.intel.com ([10.60.135.144]) by orvoesa103.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 20 Sep 2025 08:43:46 -0700 Received: from liuzhao-optiplex-7080.sh.intel.com ([10.239.160.39]) by fmviesa004.fm.intel.com with ESMTP; 20 Sep 2025 08:43:44 -0700 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1758383030; x=1789919030; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=IFeVZke/HWz43jXrNgwIElT7PX2TkqZW6CE4stypwe0=; b=jDxmMI1/ILn7peS301bL+Nao+e4O72D2cTWI9Bly7J4Q+fOW4j9PTHHn rifr4k+ih9Cf93muIDCXRKyaBWJRHxk7bCcl9QI/f/Nbb0gWo1r1WWpeB Lg83/8q4pY4VbIZAGfh/j+K6ENyqJmPcUppWOiFYdUf2Xxiw33PXR3+Al K01LAnGf+4yiyXXYo22omEytRoOtVdRGmgHbkVAnlOF8GuQn9kh51qjWe GlnpChdG5heISq38cENIf8C7YCw/y/1Qjh9GT0/FUDhpqql2xv4OWsrsO nw/rdNPwKHj8k2LygFxxSuQ2VQV5CUextsULeRBBk/LF0LVSojPsksSc+ A==; X-CSE-ConnectionGUID: TZEAcpPSRPOj4wKBxwG61w== X-CSE-MsgGUID: StN1+M9MQ4aEDVVEpo+NXQ== X-IronPort-AV: E=McAfee;i="6800,10657,11559"; a="70955520" X-IronPort-AV: E=Sophos;i="6.18,281,1751266800"; d="scan'208";a="70955520" X-CSE-ConnectionGUID: H/BeRLvgQnqBWnjE65lokw== X-CSE-MsgGUID: qWJixoeuRvCx9lYSolKF6g== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="6.18,281,1751266800"; d="scan'208";a="181349451" From: Zhao Liu To: Paolo Bonzini , Manos Pitsidianakis Cc: qemu-devel@nongnu.org, qemu-rust@nongnu.org, Zhao Liu Subject: [PATCH v2 04/12] rust/common/uninit: Fix Clippy's complaints about lifetime Date: Sun, 21 Sep 2025 00:05:12 +0800 Message-Id: <20250920160520.3699591-5-zhao1.liu@intel.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20250920160520.3699591-1-zhao1.liu@intel.com> References: <20250920160520.3699591-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.11; 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.045, 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_RPBL_BLOCKED=0.001, RCVD_IN_VALIDITY_SAFE_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: 1758383161113116600 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) Reviewed-by: Manos Pitsidianakis Signed-off-by: Zhao Liu --- 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 15:29:06 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=1758383138; cv=none; d=zohomail.com; s=zohoarc; b=N8TFGura3WzuvrjUr5E/y4s6OOZEcpDtuOXk+CKw9n6Tqj9rUGjmO5LSdNwMT0iNDG1xl3UKJd+DXhrJBCzLttoA5KhRyUYdG5FmlRY/p98cJ2Rr1uOvn9VZEf2t5fHdJHwIuk6o2Qwe4EFpTjKNmZo8ZxEMGqjbhg1szJpsR0Y= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1758383138; 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=zsndaridfL0N8E2IFoCr9zAHDXg+/HH8/mudlwCSb7A=; b=YC+WqUukQHKrfW7UjVWaJxzU6zna1uNAQE3uia3vEbcCghk2GRlYdOMJfgts5YdEiaVAmxZ6Ec10kOJ9QyPiiy0cCK04m8iTNi0o5kx7+beowvbvZ26uydQFmH3rrNiysVGia2X87tC+z2enD+71iBteBKGeDPf+qjoJlJj4ulM= 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 1758383138289619.4278097267475; Sat, 20 Sep 2025 08:45:38 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1uzzkm-0007zF-6U; Sat, 20 Sep 2025 11:44:00 -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 1uzzkh-0007vd-2d; Sat, 20 Sep 2025 11:43:55 -0400 Received: from mgamail.intel.com ([198.175.65.11]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1uzzkd-0001zY-2m; Sat, 20 Sep 2025 11:43:53 -0400 Received: from fmviesa004.fm.intel.com ([10.60.135.144]) by orvoesa103.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 20 Sep 2025 08:43:47 -0700 Received: from liuzhao-optiplex-7080.sh.intel.com ([10.239.160.39]) by fmviesa004.fm.intel.com with ESMTP; 20 Sep 2025 08:43:46 -0700 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1758383032; x=1789919032; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=pFp62miZ41RQpRrF2bJMVDi/xIKfTioqkf1d5QID2Po=; b=HW7wDw8RaxMiz4bzlhxgu+uWxq61jmlz2H4HONwWMBgq6DU5BjSzJGFA PdU0/2g/klxfxS7mWPaxol0y87dHhFgqcMgnM0K9PTO2GHwGWP6cXuwdN hxfrAn2p9L92aUlncvQUNI9G2UY4mM1V3AafnP1Cpw/1kfPIfeUfLGIlX kmJk52PBuhUIfoSIgMUcZRDfzGRNQZB/W+RDUMukiUgZgkAsnwAYYrCGq gGIozcjl2miXyj3MCaEa3KzIyZAm/uy54fd/dUUKtKtfc2AEqqfI2s4eI iz/hVMJ7zu8BQR70Az9onR8PE6Bgejc/BxvBnQm9hPeZZZnQu/YgJGSVi w==; X-CSE-ConnectionGUID: hQrvM99RRVea5vGY8CzxcA== X-CSE-MsgGUID: 4IIb0a1JTBW0XuMaLstSaQ== X-IronPort-AV: E=McAfee;i="6800,10657,11559"; a="70955528" X-IronPort-AV: E=Sophos;i="6.18,281,1751266800"; d="scan'208";a="70955528" X-CSE-ConnectionGUID: eBOXPHaETA6IqvSxTIl9Rw== X-CSE-MsgGUID: QmAk+qAqSnC0rTxNCMIh4Q== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="6.18,281,1751266800"; d="scan'208";a="181349455" From: Zhao Liu To: Paolo Bonzini , Manos Pitsidianakis Cc: qemu-devel@nongnu.org, qemu-rust@nongnu.org, Zhao Liu Subject: [PATCH v2 05/12] rust/qdev: use addr_of! in QDevProp Date: Sun, 21 Sep 2025 00:05:13 +0800 Message-Id: <20250920160520.3699591-6-zhao1.liu@intel.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20250920160520.3699591-1-zhao1.liu@intel.com> References: <20250920160520.3699591-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.11; 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.045, 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_RPBL_BLOCKED=0.001, RCVD_IN_VALIDITY_SAFE_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: 1758383140179116600 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 e384cad4d26b..d8113238e513 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 15:29:06 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=1758383082; cv=none; d=zohomail.com; s=zohoarc; b=H5qizrGxJOr2nLxjOKn1l3IHnjUs62jUBjFpjxpdGMQ2k5mHKteotTIeWu9lH+1kC/qoEIHd/8dXD0zM9vI6XATZU9+DcyMSHLREODxBvM0W51SPI7EjJf2IAWisaUOoJ7a/8i331TZ5wjtpqMefCliDVcdeOp0YKYLsdToyzNc= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1758383082; 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=aljCK2ZVYEwZya0/3maOXJwQJ846pER3aEMUJdyXZPk=; b=L9EcHniDDjUDBoup+w8mounlHoQOzeEIt533/swdn1gzhoaFTN2z1SfVt3L7vVvqc5bmv+Cv6dhWwrqRKvAlOmFWtPbmHpVrp1rMqkFF3N+1HrtYKZCXlKzI3tgU4x+8qNmDYIteKUBQmcHQ+PtgqvCT6X+oftTDdfjkeSj2e1Q= 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 17583830820391004.6503065375026; Sat, 20 Sep 2025 08:44:42 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1uzzkq-00080w-2n; Sat, 20 Sep 2025 11:44:04 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1uzzkk-0007yO-FR; Sat, 20 Sep 2025 11:43:58 -0400 Received: from mgamail.intel.com ([198.175.65.11]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1uzzkf-0001zC-Ly; Sat, 20 Sep 2025 11:43:58 -0400 Received: from fmviesa004.fm.intel.com ([10.60.135.144]) by orvoesa103.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 20 Sep 2025 08:43:49 -0700 Received: from liuzhao-optiplex-7080.sh.intel.com ([10.239.160.39]) by fmviesa004.fm.intel.com with ESMTP; 20 Sep 2025 08:43:47 -0700 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1758383034; x=1789919034; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=FE/A26CM7lN9wxf4s24xxF3DOe3NwCfkq0cfOOFg6wU=; b=TatoO260RYfy+GOZJM5sL50z8IdvFxMVWxbJL3A6DkmDl2m1A/ZG3a+M St5lG4YI2dr7js7jF7Ia08rywO/RzdAu44Jg1bffMKWDWjHB2PAuvZV8N LZ8Ib9qvjjHeyx9qtPflzC/mcg/FFa+xIr2D7jv4BmWATwvgerhfC5K0y o2hKqIQPKz0FC+oCwdYd8EFqU2G1zPotLBaTcEyNdjNXWYROXvg89TxdX OsvabZFamqrETzhDeeuI6Hy1yhJcP9fXfB8mZQbaN8z5pI7QjUkW7Rutu Q8lPdvnu5OPV4hyMEKroZ3eBD2thIE7m3P4HT31w6ByuN7Hyb0Lnc/UqL A==; X-CSE-ConnectionGUID: rZhrKqiVQRyHGW+qevF3/Q== X-CSE-MsgGUID: 7WROMVWtRDKh0vAbASwZ9A== X-IronPort-AV: E=McAfee;i="6800,10657,11559"; a="70955535" X-IronPort-AV: E=Sophos;i="6.18,281,1751266800"; d="scan'208";a="70955535" X-CSE-ConnectionGUID: XxLnda1HTYCpFDrH9JhOow== X-CSE-MsgGUID: m2tE3PAQQH2ZB7yFOCkhdA== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="6.18,281,1751266800"; d="scan'208";a="181349462" From: Zhao Liu To: Paolo Bonzini , Manos Pitsidianakis Cc: qemu-devel@nongnu.org, qemu-rust@nongnu.org, Zhao Liu Subject: [PATCH v2 06/12] rust/qdev: Refine the documentation for QDevProp trait Date: Sun, 21 Sep 2025 00:05:14 +0800 Message-Id: <20250920160520.3699591-7-zhao1.liu@intel.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20250920160520.3699591-1-zhao1.liu@intel.com> References: <20250920160520.3699591-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.11; 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, 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_RPBL_BLOCKED=0.001, RCVD_IN_VALIDITY_SAFE_BLOCKED=0.001, SPF_PASS=-0.001, T_SPF_HELO_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: 1758383084668116600 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 d8113238e513..89c21e7c6b50 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 15:29:06 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=1758383113; cv=none; d=zohomail.com; s=zohoarc; b=hExdkAC4GExo8VrWl02zUpSo7qJG+g+EBHwgs+rcxaBwP1idF7tDVJgzAA1wQ9ZeboOrW88TYoTJ0W/XZi+M56ZnbgacGx9iW9LgkC2h+9msWSjcfQBvaGXAQp6EWzV+8d5z5nLRImiDMPWpJEghD+BoyljjZORZLvhWRmRkHKs= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1758383113; 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=zVzNzrzqHqPPy2diXWJWWS2dSyoBaceVpdg+H11gNb0=; b=bLfk4ml7J3Eh0s1ktQyqlL70GCcx+FkYLxWgc7cbJGODJRmMKp3GlgO7QjjG6LxJjNa60eFqw+GTb3gudQfTVwu25b9NlBTVEGx+YzbNkDUcmkvIA3Ptrn/3LR+wdyXj95RXfXc2JaXfnkyJeW8om02vRtG22mNbXReLfjGGqBA= 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 1758383113640649.9460751345121; Sat, 20 Sep 2025 08:45:13 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1uzzkm-0007zg-Gv; Sat, 20 Sep 2025 11:44:00 -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 1uzzki-0007wo-JF; Sat, 20 Sep 2025 11:43:56 -0400 Received: from mgamail.intel.com ([198.175.65.11]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1uzzkf-0001zT-Lx; Sat, 20 Sep 2025 11:43:55 -0400 Received: from fmviesa004.fm.intel.com ([10.60.135.144]) by orvoesa103.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 20 Sep 2025 08:43:50 -0700 Received: from liuzhao-optiplex-7080.sh.intel.com ([10.239.160.39]) by fmviesa004.fm.intel.com with ESMTP; 20 Sep 2025 08:43:48 -0700 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1758383034; x=1789919034; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=yXrP73a12JJn4IAYq71AmqAT+gHNTzZ0Y1rswE00zAo=; b=bBRblinQuMaIBPtXkCisnX/7+UGYUe4C+f3bzkSGCF9aOIbVwc7glc17 Mj5Fpka5FU+whR4bJVK/cL+aAm9PZHTwC1ZN7ilW2wivZUTxtzHwLrE/g KTAzEAPIyNi84I1YQbXbEGUW3FwGF6hqhqlF/jPk1WERaiXDvX5ocPln3 DFx44FhJ6S2LjG+SN69sxnZZ5oxW5P8s6TCMItmtQx7qj7dHpQpcfTkmr SFCQXqhlgRykB+Ge83V8TKKzNYTRQVAGO+KyThwZTlhfRkhBIAYBUG746 xqEZazytGNWolfXatcCZn0IzsXHc4LCWdHuRhNoRHT46AspMKLY6iEttY g==; X-CSE-ConnectionGUID: mAQdu+OmSh+rD+g2efUbng== X-CSE-MsgGUID: FpCJ3QjcQo2Q+QExBzGMpg== X-IronPort-AV: E=McAfee;i="6800,10657,11559"; a="70955541" X-IronPort-AV: E=Sophos;i="6.18,281,1751266800"; d="scan'208";a="70955541" X-CSE-ConnectionGUID: jkWtAfONRP2NTTHTpKjTQw== X-CSE-MsgGUID: slE/YtbiQCmIYmNVttLrmQ== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="6.18,281,1751266800"; d="scan'208";a="181349467" From: Zhao Liu To: Paolo Bonzini , Manos Pitsidianakis Cc: qemu-devel@nongnu.org, qemu-rust@nongnu.org, Zhao Liu Subject: [PATCH v2 07/12] rust/qdev: Support property info for more common types Date: Sun, 21 Sep 2025 00:05:15 +0800 Message-Id: <20250920160520.3699591-8-zhao1.liu@intel.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20250920160520.3699591-1-zhao1.liu@intel.com> References: <20250920160520.3699591-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.11; 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.045, 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_RPBL_BLOCKED=0.001, RCVD_IN_VALIDITY_SAFE_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: 1758383115721116600 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 --- 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 89c21e7c6b50..14d6ecf2ca23 100644 --- a/rust/hw/core/src/qdev.rs +++ b/rust/hw/core/src/qdev.rs @@ -134,20 +134,24 @@ pub unsafe trait QDevProp { const VALUE: *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); -} - -/// Use [`bindings::qdev_prop_uint64`] for `u64`. -unsafe impl QDevProp for u64 { - const VALUE: *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 VALUE: *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 VALUE: *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 15:29:06 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=1758383089; cv=none; d=zohomail.com; s=zohoarc; b=hCO9Wur70ROPNEpjU9ZGPaBhI98n6eAeng7BLPImwHERCFaR9A2YpjT0GjpQQe72ygykTRtWcWEc7+ZLTYLkkRuE9h0dz8BXUzNWbLC7KrquYgBY9FNXtUgGgnDRe4shDtYADkp6OpjN9+zYTNNwaXyTF60cN8uxQDj1gpzWuCA= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1758383089; 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=4Q3dtmpjZ2y08+YpQVKKFnkGHOFxiljyFpgmSBHvLZ4=; b=j5eSHfHvKiL9L9W0E4xAIeVul0WyV4rPpRf/JoGgTVqj5Xma6c3AQ8iMn3b1AWvjU+2GEKPW3N3M6SzTJrAnqU9ZSrKhq51ClORHNC7WcvSxXqVLYFhdaxCkFfeZxxpDGo+MlmdjqSLoecMPwuTzqGdy7VCnd68VQK0D8EdKvI0= 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 1758383089776878.4927044107543; Sat, 20 Sep 2025 08:44:49 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1uzzkq-00082C-RG; Sat, 20 Sep 2025 11:44:04 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1uzzkk-0007ya-PC; Sat, 20 Sep 2025 11:43:59 -0400 Received: from mgamail.intel.com ([198.175.65.11]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1uzzki-0001zY-RL; Sat, 20 Sep 2025 11:43:58 -0400 Received: from fmviesa004.fm.intel.com ([10.60.135.144]) by orvoesa103.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 20 Sep 2025 08:43:52 -0700 Received: from liuzhao-optiplex-7080.sh.intel.com ([10.239.160.39]) by fmviesa004.fm.intel.com with ESMTP; 20 Sep 2025 08:43:50 -0700 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1758383037; x=1789919037; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=A2RQC03kkpwdd2KD8mxBPSDYqTCska/UixEK4wWtb/s=; b=izistnAyUgfSkmbj8M2QHtgXLvlSdtNLoshz80Mc8X+XKhXZuqJYnF3F oGevOSswFp7YGHarQB0YiQNqqeLSZU2763yuY58AZ6oVluMYW/b4SyWTs 02JWO3YFZpkIU7eAaU5wVyoXo+CJdTfz4weWA2hzMr/XQpz7ohlDd2LWk 2rzWyJD9xa/H7Ra+uyjc88MphVKaK07nhloYyUe6r/2ejUFfKPPDEIxFa NGAmCyUoIZ9Fv1MrOz38TOtBsuXJuWhl6PCu4RiVQqjIyb/IRFdv+txbP cxkKR2wGjDOYb4Zern6vWJl8J/p3c5WFRds1DMCN1EPtpLLML5kIhTeBR Q==; X-CSE-ConnectionGUID: bLBfY3dLRxqwA30+WjnD/g== X-CSE-MsgGUID: v0b7tbkcT/mRQwC1mrZDZw== X-IronPort-AV: E=McAfee;i="6800,10657,11559"; a="70955549" X-IronPort-AV: E=Sophos;i="6.18,281,1751266800"; d="scan'208";a="70955549" X-CSE-ConnectionGUID: /UonA2rHS5C+oHvDK/0ovQ== X-CSE-MsgGUID: 5Dg7hN2SRj2vHMqCt4uM3w== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="6.18,281,1751266800"; d="scan'208";a="181349474" From: Zhao Liu To: Paolo Bonzini , Manos Pitsidianakis Cc: qemu-devel@nongnu.org, qemu-rust@nongnu.org, Zhao Liu Subject: [PATCH v2 08/12] rust/qdev: Support bit property in #property macro Date: Sun, 21 Sep 2025 00:05:16 +0800 Message-Id: <20250920160520.3699591-9-zhao1.liu@intel.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20250920160520.3699591-1-zhao1.liu@intel.com> References: <20250920160520.3699591-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.11; 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.045, 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_RPBL_BLOCKED=0.001, RCVD_IN_VALIDITY_SAFE_BLOCKED=0.001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, T_FILL_THIS_FORM_SHORT=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: 1758383091763116600 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. In addtion, rename VALUE member of QDevProp trait to BASE_INFO. And update the test cases about qdev property. Signed-off-by: Zhao Liu --- Changes since v1: * Use attrs to parse "lib" field in #property. * Rename VALUE to BASE_INFO in this patch. * Update test cases. --- rust/hw/core/src/qdev.rs | 19 ++++++++++++------- rust/qemu-macros/src/lib.rs | 18 +++++++++++++++--- rust/qemu-macros/src/tests.rs | 8 +++++--- 3 files changed, 32 insertions(+), 13 deletions(-) diff --git a/rust/hw/core/src/qdev.rs b/rust/hw/core/src/qdev.rs index 14d6ecf2ca23..5cc8a35d1ab0 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 `VALUE` must be a valid raw -/// reference to a [`bindings::PropertyInfo`]. +/// This trait is marked as `unsafe` because `BASE_INFO` and `BIT_INFO` mu= st be +/// valid raw references to [`bindings::PropertyInfo`]. /// /// Note we could not use a regular reference: /// @@ -131,14 +131,19 @@ 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; + 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 VALUE: *const $crate::bindings::PropertyInfo =3D + 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 ed2b997b24a4..c459f9bcb42f 100644 --- a/rust/qemu-macros/src/lib.rs +++ b/rust/qemu-macros/src/lib.rs @@ -183,6 +183,7 @@ fn parse(input: ParseStream<'_>) -> syn::Result { #[derive(Default, Debug)] struct DeviceProperty { rename: Option, + bitnr: Option, defval: Option, } =20 @@ -191,6 +192,7 @@ fn parse_from(&mut self, a: &Attribute) -> syn::Result<= ()> { use attrs::{set, with, Attrs}; let mut parser =3D Attrs::new(); parser.once("rename", with::eq(set::parse(&mut self.rename))); + parser.once("bit", with::eq(set::parse(&mut self.bitnr))); parser.once("default", with::eq(set::parse(&mut self.defval))); a.parse_args_with(&mut parser) } @@ -226,7 +228,11 @@ fn derive_device_or_error(input: DeriveInput) -> Resul= t {{ @@ -256,14 +262,20 @@ 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 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 diff --git a/rust/qemu-macros/src/tests.rs b/rust/qemu-macros/src/tests.rs index 1ce43aa568ec..c6b00c9783a8 100644 --- a/rust/qemu-macros/src/tests.rs +++ b/rust/qemu-macros/src/tests.rs @@ -60,7 +60,7 @@ struct DummyState { migrate_clock: bool, } }, - "Expected one of `default` or `rename`" + "Expected one of `bit`, `default` or `rename`" ); // Check that repeated attributes are not allowed: derive_compile_fail!( @@ -106,8 +106,9 @@ unsafe impl ::hwcore::DevicePropertiesImpl for DummySta= te { const PROPERTIES: &'static [::hwcore::bindings::Property] = =3D &[ ::hwcore::bindings::Property { name: ::std::ffi::CStr::as_ptr(c"migrate_clock"), - info: ::VALUE, + info: ::BASE_INFO, offset: ::core::mem::offset_of!(DummyState, migrat= e_clock) as isize, + bitnr: 0, set_default: true, defval: ::hwcore::bindings::Property__bindgen_ty_1= { u: true as u64 }, ..::common::Zeroable::ZERO @@ -133,8 +134,9 @@ unsafe impl ::hwcore::DevicePropertiesImpl for DummySta= te { const PROPERTIES: &'static [::hwcore::bindings::Property] = =3D &[ ::hwcore::bindings::Property { name: ::std::ffi::CStr::as_ptr(c"migrate-clk"), - info: ::VALUE, + info: ::BASE_INFO, offset: ::core::mem::offset_of!(DummyState, migrat= e_clock) as isize, + bitnr: 0, set_default: true, defval: ::hwcore::bindings::Property__bindgen_ty_1= { u: true as u64 }, ..::common::Zeroable::ZERO --=20 2.34.1 From nobody Sun Sep 28 15:29:06 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=1758383098; cv=none; d=zohomail.com; s=zohoarc; b=RPnbAxTZWcppz2SOqJ7z0b8tacKMsSkWvN2bDeEd6ARk+XruEWgYDLN3ABU93lm5uPCmuYIPpxTlo0FiqdlEH5rfOZFkEllwxuaE7rOfqXsbk9PMAg5Jv+SZQCjEMZw6K5VF4EAR3aHJvq2jRH+NReI+hn2mt4tPoDsKK9/XgEY= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1758383098; 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=CHhT2t1RmMMAyXdCrLvE8OvrwyuN/ejrnUZZMHjMnhg=; b=hD6Zv5b3t8Fvk7cJiNChd9xyCMY923ypBJipb/2XMPqvR4oKIDSI5fhmPRW2wKpa0Fe4tfd7JxCE2A6r7PdF0wTsO3QEvgl8RziGMtKPlU4F5/z6RY7AreMydmK9FwWClimlDI+Tvgvo8bSwb7uHdgfdVzKUt1YenHFdvpCqkw0= 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 1758383098065460.5423219689244; Sat, 20 Sep 2025 08:44:58 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1uzzkt-00082s-Sc; Sat, 20 Sep 2025 11:44:07 -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 1uzzkl-0007ye-20; Sat, 20 Sep 2025 11:43:59 -0400 Received: from mgamail.intel.com ([198.175.65.11]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1uzzkj-0001zT-BS; Sat, 20 Sep 2025 11:43:58 -0400 Received: from fmviesa004.fm.intel.com ([10.60.135.144]) by orvoesa103.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 20 Sep 2025 08:43:54 -0700 Received: from liuzhao-optiplex-7080.sh.intel.com ([10.239.160.39]) by fmviesa004.fm.intel.com with ESMTP; 20 Sep 2025 08:43:52 -0700 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1758383038; x=1789919038; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=7K1AoX1vYKJi0eA0/Ol1SLh0EzyubRlT44C6WqHZJJI=; b=io4toLzMtAibBPZxMyoX9NVk+qNqlSkBYtkbZBZY0tSOltNvGFb/tL9v rm1vaeHfB1D3+oso7Lq1k4C7M7DXoFvFzZHoQNiiNyAiCda5cS4FpXQVy EidyIKrkhUWdeyFXZTAY5pcGtFYMuJ2KGRohcATxhjMi2Kgv9HO4//PKl hSLzy8QzX0TRZmwYwm6ZLvtR6yFvTZTGOK7ESdjFqBCpiX5wAn/cVjYw3 X1FYHXLikVN6sXATg+lYqETdjf00zbvuzj33NCXYUcue+uWc5XeRat+1t p0nNVJe/ByK23f442DFbJvRUwOIboVo11hriG817EiSpwbBPTg8kzVceh g==; X-CSE-ConnectionGUID: 8Bnhm0sbTHGb/hfMzIM5hg== X-CSE-MsgGUID: Vfa7384yRm2qsImKSNnm0w== X-IronPort-AV: E=McAfee;i="6800,10657,11559"; a="70955558" X-IronPort-AV: E=Sophos;i="6.18,281,1751266800"; d="scan'208";a="70955558" X-CSE-ConnectionGUID: mEvzBRn+RDCRYbPHf3wBNA== X-CSE-MsgGUID: 7QuzDe2uSne9WR8nvwfbkA== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="6.18,281,1751266800"; d="scan'208";a="181349478" From: Zhao Liu To: Paolo Bonzini , Manos Pitsidianakis Cc: qemu-devel@nongnu.org, qemu-rust@nongnu.org, Zhao Liu Subject: [PATCH v2 09/12] rust/qdev: Test bit property for #property Date: Sun, 21 Sep 2025 00:05:17 +0800 Message-Id: <20250920160520.3699591-10-zhao1.liu@intel.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20250920160520.3699591-1-zhao1.liu@intel.com> References: <20250920160520.3699591-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.11; 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.045, 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_RPBL_BLOCKED=0.001, RCVD_IN_VALIDITY_SAFE_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: 1758383099577116600 Content-Type: text/plain; charset="utf-8" There's a diference between Rust and C: Though C macro (e.g., DEFINE_PROP_BIT or DEFINE_PROP_BIT64) always requires default value, Rust side allows to omit this "default" field in #property, and provides a default value ("0" - false) for this field. This minor difference does not break user habits and should be acceptable. Therefore, the test cases also cover this scenario. Signed-off-by: Zhao Liu --- rust/qemu-macros/src/tests.rs | 99 +++++++++++++++++++++++++++++++++++ 1 file changed, 99 insertions(+) diff --git a/rust/qemu-macros/src/tests.rs b/rust/qemu-macros/src/tests.rs index c6b00c9783a8..7516bc3d92a0 100644 --- a/rust/qemu-macros/src/tests.rs +++ b/rust/qemu-macros/src/tests.rs @@ -89,6 +89,19 @@ struct DummyState { "Duplicate argument", "Already used here", ); + derive_compile_fail!( + derive_device_or_error, + quote! { + #[repr(C)] + #[derive(Device)] + struct DummyState { + #[property(bit =3D 0, bit =3D 1)] + flags: u32, + } + }, + "Duplicate argument", + "Already used here", + ); // Check that the field name is preserved when `rename` isn't used: derive_compile!( derive_device_or_error, @@ -145,6 +158,92 @@ unsafe impl ::hwcore::DevicePropertiesImpl for DummySt= ate { } } ); + // Check that `bit` value is used for the bit property without default + // value (note: though C macro (e.g., DEFINE_PROP_BIT) always requires + // default value, Rust side allows to default this field to "0"): + derive_compile!( + derive_device_or_error, + quote! { + #[repr(C)] + #[derive(Device)] + pub struct DummyState { + parent: ParentField, + #[property(bit =3D 3)] + flags: u32, + } + }, + quote! { + unsafe impl ::hwcore::DevicePropertiesImpl for DummyState { + const PROPERTIES: &'static [::hwcore::bindings::Property] = =3D &[ + ::hwcore::bindings::Property { + name: ::std::ffi::CStr::as_ptr(c"flags"), + info: ::BIT_INFO, + offset: ::core::mem::offset_of!(DummyState, flags)= as isize, + bitnr: 3, + set_default: false, + defval: ::hwcore::bindings::Property__bindgen_ty_1= { u: 0 as u64 }, + ..::common::Zeroable::ZERO + } + ]; + } + } + ); + // Check that `bit` value is used for the bit property when used: + derive_compile!( + derive_device_or_error, + quote! { + #[repr(C)] + #[derive(Device)] + pub struct DummyState { + parent: ParentField, + #[property(bit =3D 3, default =3D true)] + flags: u32, + } + }, + quote! { + unsafe impl ::hwcore::DevicePropertiesImpl for DummyState { + const PROPERTIES: &'static [::hwcore::bindings::Property] = =3D &[ + ::hwcore::bindings::Property { + name: ::std::ffi::CStr::as_ptr(c"flags"), + info: ::BIT_INFO, + offset: ::core::mem::offset_of!(DummyState, flags)= as isize, + bitnr: 3, + set_default: true, + defval: ::hwcore::bindings::Property__bindgen_ty_1= { u: true as u64 }, + ..::common::Zeroable::ZERO + } + ]; + } + } + ); + // Check that `bit` value is used for the bit property with rename whe= n used: + derive_compile!( + derive_device_or_error, + quote! { + #[repr(C)] + #[derive(Device)] + pub struct DummyState { + parent: ParentField, + #[property(rename =3D "msi", bit =3D 3, default =3D false)] + flags: u64, + } + }, + quote! { + unsafe impl ::hwcore::DevicePropertiesImpl for DummyState { + const PROPERTIES: &'static [::hwcore::bindings::Property] = =3D &[ + ::hwcore::bindings::Property { + name: ::std::ffi::CStr::as_ptr(c"msi"), + info: ::BIT_INFO, + offset: ::core::mem::offset_of!(DummyState, flags)= as isize, + bitnr: 3, + set_default: true, + defval: ::hwcore::bindings::Property__bindgen_ty_1= { u: false as u64 }, + ..::common::Zeroable::ZERO + } + ]; + } + } + ); } =20 #[test] --=20 2.34.1 From nobody Sun Sep 28 15:29:06 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=1758383089; cv=none; d=zohomail.com; s=zohoarc; b=l+LZILnu/s2F+vE/8D15BtVTZszrQPUF9S3Qqj96h6qoMwxo51mUWUhF3VXhxGKcOqzbyvqAYQk/zx9+a84dvkfBj3VbbQbF9AoSjiaOmg8BDtnXi1B29DP+Kby5OWBtzI+rZnGyng7enmZPCR572M2Jf2b7JtQ8wROLH+2NoRI= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1758383089; 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=P2q3j9Zz0X+ZeY5wJW3yk1ruqZQ3ECP6nmaAqS7i5Fv9Z8dZZ1q7ltCUuRl1YJ2KZctBfc1UGe8XQPop6uzmEQ46qLNkSlEu9FL4OLIB4Z9Bv1WMWxMN8XfyNbaQZGIwmqAr2I9lOlfEXPDL2OTrWX51oOtz8BjrssSNycAP1ic= 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 1758383089977673.6836772976783; Sat, 20 Sep 2025 08:44:49 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1uzzkt-000837-Sv; Sat, 20 Sep 2025 11:44:07 -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 1uzzkn-000806-NH; Sat, 20 Sep 2025 11:44:01 -0400 Received: from mgamail.intel.com ([198.175.65.11]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1uzzkl-0001zC-6g; Sat, 20 Sep 2025 11:44:01 -0400 Received: from fmviesa004.fm.intel.com ([10.60.135.144]) by orvoesa103.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 20 Sep 2025 08:43:55 -0700 Received: from liuzhao-optiplex-7080.sh.intel.com ([10.239.160.39]) by fmviesa004.fm.intel.com with ESMTP; 20 Sep 2025 08:43:53 -0700 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1758383040; x=1789919040; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=waLJ79Z2ZxPOvRkgcef2yGkHILtwcEpwytE2aQ9sNt8=; b=YEWnuszib5UMpc1h/HilWL9FleJ6Erb95MRrpcUpuS1xV/BgpsPsWqOA zhlV2GKsifRcdM+NNvMsLYQkv5q5EMTkmwgdqGQimXfDAe76Mys4PTYl0 yF1JjvgYh1pKpwXEjnTPKtfHiN3GN/LI6i7neOVP7xkPAJCeVw3hnxdGK Qf3m4PvpVk7Ah3Sc0BSYVQQnuEk9akLuTnuqefGV8sbzJyLtpMeAd7dur TTu/9IzPdd4X8cTsXb6CB/eVAPOVVWn9ifPWyuBgu/e/Zslzk4SW2ur8x zIj4yAtr6lWb9/NJkpmqBvtvZblt8qhSmorHg6yPPlMwp8BxcqNoFb5Xn Q==; X-CSE-ConnectionGUID: /i1VSowERXiuUVXmvPcsXg== X-CSE-MsgGUID: SvicmQXPRDiAQCapeS4y0w== X-IronPort-AV: E=McAfee;i="6800,10657,11559"; a="70955565" X-IronPort-AV: E=Sophos;i="6.18,281,1751266800"; d="scan'208";a="70955565" X-CSE-ConnectionGUID: JUtPN4YgSFGqR4wfx+Vu4A== X-CSE-MsgGUID: INZI3f0rR8i1Gn75AuY84A== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="6.18,281,1751266800"; d="scan'208";a="181349485" From: Zhao Liu To: Paolo Bonzini , Manos Pitsidianakis Cc: qemu-devel@nongnu.org, qemu-rust@nongnu.org, Zhao Liu Subject: [PATCH v2 10/12] rust/hpet: Clean up type mismatch for num_timers property Date: Sun, 21 Sep 2025 00:05:18 +0800 Message-Id: <20250920160520.3699591-11-zhao1.liu@intel.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20250920160520.3699591-1-zhao1.liu@intel.com> References: <20250920160520.3699591-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.11; 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.045, 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_RPBL_BLOCKED=0.001, RCVD_IN_VALIDITY_SAFE_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: 1758383091526116600 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 15:29:06 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=1758383083; cv=none; d=zohomail.com; s=zohoarc; b=Jy2gesZlz53wejo3azjAHiodQIFd7Su3Va0NuskxHrNV88S+4D3MhU06SFkafaCRjd2QLrOtBtDcucZ66q2XHgb78u5aYSAnoFcpWEW770tcl68VishrMfG8kO3eyJ7QMO3+9ua5Hf2GYpo8Bnb8ocvfpq5Fo0Nky6j9N8O+Pvk= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1758383083; 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=cMhWfhRN8M4UNrrKVCHR33GKcqWdmUM1nkQVp6Y4hh8=; b=VW4dMYqQd+j69hTeJMPOC7sUS8lrT9VjKep9tDBxxgfXqbfXFSIAqVGKxxaQj7W4LO/rwYv7P6tS1FyqPQd2VK8Iqip6YkG3Tt551gkln1k4fX5Pm01WzFiHvJIlq25luZZszDXpiflCMCzkCZyUqvXvfsnO3i+8k1l/j3U4cns= 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 1758383083566912.9560011833655; Sat, 20 Sep 2025 08:44:43 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1uzzlB-000863-UM; Sat, 20 Sep 2025 11:44:25 -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 1uzzl7-00085H-9A; Sat, 20 Sep 2025 11:44:21 -0400 Received: from mgamail.intel.com ([198.175.65.11]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1uzzl5-0001zY-Go; Sat, 20 Sep 2025 11:44:21 -0400 Received: from fmviesa004.fm.intel.com ([10.60.135.144]) by orvoesa103.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 20 Sep 2025 08:43:57 -0700 Received: from liuzhao-optiplex-7080.sh.intel.com ([10.239.160.39]) by fmviesa004.fm.intel.com with ESMTP; 20 Sep 2025 08:43:55 -0700 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1758383060; x=1789919060; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=5Ft6/zWuJrh1XDhFRWHRyCggIiXG4AZeWLOxo0l8lu0=; b=LW1QtDb5dWFyek73oxymhulEsFI4NAkqYxGXLuW9KP8uKSLVJR34vGO7 scm4twneVIrhrPbOb/JEMWC3Yy+ARyq5zDDj2J0ZAazNuDd0JgQBArEwR Qg9L3KqnpmsuB5gjjp7ENrJWe4jZENjM5T+fwbR4ryYbVD6JFNa/jtMN1 W9KIPVZVVOhF2n5L/yGmm1+mRBx9SFpKsqpiNtktvhDazrE78o9/izJrv CuTu09wE35wtAdIgq63HxwXu5I20a0l/GFOBGRgv+cz0iZJ6ULhQ0H6I1 WHxiq8Stbzc8l7Bd7/faOeKuViswjiWnpm2iCs7cq8zsON732PKadz53j A==; X-CSE-ConnectionGUID: XrO5SKy1RrigQGnfei4faQ== X-CSE-MsgGUID: a/gceFDQQyG7sPQd2PhjlA== X-IronPort-AV: E=McAfee;i="6800,10657,11559"; a="70955569" X-IronPort-AV: E=Sophos;i="6.18,281,1751266800"; d="scan'208";a="70955569" X-CSE-ConnectionGUID: OIRHsUfHSNOBoiJonCYaew== X-CSE-MsgGUID: bIiqnjL9TfO6aN9uwJQvqw== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="6.18,281,1751266800"; d="scan'208";a="181349489" From: Zhao Liu To: Paolo Bonzini , Manos Pitsidianakis Cc: qemu-devel@nongnu.org, qemu-rust@nongnu.org, Zhao Liu Subject: [PATCH v2 11/12] rust/hpet: Convert qdev properties to #property macro Date: Sun, 21 Sep 2025 00:05:19 +0800 Message-Id: <20250920160520.3699591-12-zhao1.liu@intel.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20250920160520.3699591-1-zhao1.liu@intel.com> References: <20250920160520.3699591-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.11; 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.045, 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_RPBL_BLOCKED=0.001, RCVD_IN_VALIDITY_SAFE_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: 1758383085397116600 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. Reviewed-by: Manos Pitsidianakis Signed-off-by: Zhao Liu --- 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 15:29:06 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=1758383091; cv=none; d=zohomail.com; s=zohoarc; b=F7uf/j5pu2SBbLJK/w73Maty8bGIBHyQy+dtvbzzUpiCrZXot7S6w06VEwOSmA+HeYdLaFkbJodGXSt1oA/nSjvl8hyOWk0AfCpbmkAiZrkGZJNO5eTElR8+nb5a/1HJWzAxFx+YTdTnBaXodHUkAihkRKQYme+sKJUBqo66bVw= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1758383091; 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=7J0BkQcmV1V7SMmiN42CpFg+JqAagVcmaSiTHYZJUkM=; b=Z/9JphdsNWmlJM2LtbLkTCmOV8ABxItrm2fABMB9ReVof1krJIjX9dh0aMjtM5NDgZDgixS/G6ROSUUdpxJMQ+/+IcnaG+7PxJMZB4yRtNFLhfUYFzEgT/9P1xbhFoZ6yThJhjiRJWxGH5EnHco2Fx68Ds/ij3D6N2uVEdYTvNI= 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 175838309194952.019976983723495; Sat, 20 Sep 2025 08:44:51 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1uzzlF-00086j-8f; Sat, 20 Sep 2025 11:44:29 -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 1uzzl7-00085a-MU; Sat, 20 Sep 2025 11:44:21 -0400 Received: from mgamail.intel.com ([198.175.65.11]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1uzzl6-0001zT-4A; Sat, 20 Sep 2025 11:44:21 -0400 Received: from fmviesa004.fm.intel.com ([10.60.135.144]) by orvoesa103.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 20 Sep 2025 08:43:58 -0700 Received: from liuzhao-optiplex-7080.sh.intel.com ([10.239.160.39]) by fmviesa004.fm.intel.com with ESMTP; 20 Sep 2025 08:43:56 -0700 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1758383061; x=1789919061; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=L8gnmi+J4MzRrbiFkXtGqJm6GBBwWXfcXWg3n8slJpE=; b=NRlQdUs4wUSIVH/GK9Wu0NQ/AjIH2Hk5wYZPiynWt23nXEeXFov/gq2z p/sVmKz94ctpf2fysSZSRBNB+xwC3n13kflcad5M3CUyJdd9pAxgu2XlG udobLbNamBVeruNOcT6IjEFXCi3V+S9Fo9bvXKj2Wlu6iAyzVcLoaB0Hb TNpzctTlJDn9Yl1RV+Y2z1kt/ejpKhjnJosDlqiCL4IjthOPKVBr7gVcB VKC7Cr+jIXPpRJYF3NmmdppjdbOqqVeSuERjp6HbxNxqDs+krCtTkdQCW G/u37oSxaNdPqtkcvQsro435pLQ0o6LKGn3P9C2cjUeEVsq3cavBJBv2y w==; X-CSE-ConnectionGUID: HdAnyg9qR9yoRlUW6DvyfQ== X-CSE-MsgGUID: /iF6uqb2QzGtalYIOsB9qA== X-IronPort-AV: E=McAfee;i="6800,10657,11559"; a="70955579" X-IronPort-AV: E=Sophos;i="6.18,281,1751266800"; d="scan'208";a="70955579" X-CSE-ConnectionGUID: zBAUwL6vTbyJ0gic2vC3vw== X-CSE-MsgGUID: C6lN+5phRnG4vu/Xt5AHLA== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="6.18,281,1751266800"; d="scan'208";a="181349494" From: Zhao Liu To: Paolo Bonzini , Manos Pitsidianakis Cc: qemu-devel@nongnu.org, qemu-rust@nongnu.org, Zhao Liu Subject: [PATCH v2 12/12] rust/qdev: Drop declare_properties & define_property macros Date: Sun, 21 Sep 2025 00:05:20 +0800 Message-Id: <20250920160520.3699591-13-zhao1.liu@intel.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20250920160520.3699591-1-zhao1.liu@intel.com> References: <20250920160520.3699591-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.11; 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.045, 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_RPBL_BLOCKED=0.001, RCVD_IN_VALIDITY_SAFE_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: 1758383093648116600 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. Reviewed-by: Manos Pitsidianakis Signed-off-by: Zhao Liu --- 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 5cc8a35d1ab0..c3097a284d73 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