qemu-rust.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: Zhao Liu <zhao1.liu@intel.com>
To: Paolo Bonzini <pbonzini@redhat.com>,
	Manos Pitsidianakis <manos.pitsidianakis@linaro.org>
Cc: qemu-devel@nongnu.org, qemu-rust@nongnu.org,
	Zhao Liu <zhao1.liu@intel.com>
Subject: [PATCH 07/12] rust/qdev: Rename PropertyInfo field from VALUE to BASE_INFO
Date: Tue, 16 Sep 2025 16:55:52 +0800	[thread overview]
Message-ID: <20250916085557.2008344-8-zhao1.liu@intel.com> (raw)
In-Reply-To: <20250916085557.2008344-1-zhao1.liu@intel.com>

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 <zhao1.liu@intel.com>
---
 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 raw
 /// reference to a [`bindings::PropertyInfo`].
 ///
 /// Note we could not use a regular reference:
 ///
 /// ```text
-/// const VALUE: &bindings::PropertyInfo = ...
+/// const BASE_INFO: &bindings::PropertyInfo = ...
 /// ```
 ///
 /// 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;
 }
 
 /// Use [`bindings::qdev_prop_bool`] for `bool`.
 unsafe impl QDevProp for bool {
-    const VALUE: *const bindings::PropertyInfo = addr_of!(bindings::qdev_prop_bool);
+    const BASE_INFO: *const bindings::PropertyInfo = addr_of!(bindings::qdev_prop_bool);
 }
 
 /// Use [`bindings::qdev_prop_uint64`] for `u64`.
 unsafe impl QDevProp for u64 {
-    const VALUE: *const bindings::PropertyInfo = addr_of!(bindings::qdev_prop_uint64);
+    const BASE_INFO: *const bindings::PropertyInfo = addr_of!(bindings::qdev_prop_uint64);
 }
 
 /// Use [`bindings::qdev_prop_chr`] for [`chardev::CharBackend`].
 unsafe impl QDevProp for chardev::CharBackend {
-    const VALUE: *const bindings::PropertyInfo = addr_of!(bindings::qdev_prop_chr);
+    const BASE_INFO: *const bindings::PropertyInfo = addr_of!(bindings::qdev_prop_chr);
 }
 
 /// 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 = field.ty.clone();
-        let qdev_prop = quote! { <#field_ty as ::hwcore::QDevProp>::VALUE };
+        let qdev_prop = quote! { <#field_ty as ::hwcore::QDevProp>::BASE_INFO };
         let set_default = defval.is_some();
         let defval = defval.unwrap_or(syn::Expr::Verbatim(quote! { 0 }));
         properties_expanded.push(quote! {
-- 
2.34.1



  parent reply	other threads:[~2025-09-16  8:37 UTC|newest]

Thread overview: 28+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-09-16  8:55 [PATCH 00/12] rust: miscellaneous cleanup & HPET #property conversion Zhao Liu
2025-09-16  8:55 ` [PATCH 01/12] subprojects: Update .gitignore for proc-macro2 and syn Zhao Liu
2025-09-16  9:58   ` Manos Pitsidianakis
2025-09-17  6:43     ` Zhao Liu
2025-09-16  8:55 ` [PATCH 02/12] subprojects: Ignore .wraplock file generated by meson v1.9.0 Zhao Liu
2025-09-16  9:59   ` Manos Pitsidianakis
2025-09-16  8:55 ` [PATCH 03/12] rust/qemu-macros: Fix Clippy's complaints about lambda parameter naming Zhao Liu
2025-09-16 10:00   ` Manos Pitsidianakis
2025-09-16  8:55 ` [PATCH 04/12] rust/common/uninit: Fix Clippy's complaints about lifetime Zhao Liu
2025-09-16 10:00   ` Manos Pitsidianakis
2025-09-16  8:55 ` [PATCH 05/12] rust/qdev: use addr_of! in QDevProp Zhao Liu
2025-09-16  8:55 ` [PATCH 06/12] rust/qdev: Refine the documentation for QDevProp trait Zhao Liu
2025-09-16  8:55 ` Zhao Liu [this message]
2025-09-16 10:10   ` [PATCH 07/12] rust/qdev: Rename PropertyInfo field from VALUE to BASE_INFO Manos Pitsidianakis
2025-09-17  6:46     ` Zhao Liu
2025-09-16  8:55 ` [PATCH 08/12] rust/qdev: Support property info for more common types Zhao Liu
2025-09-16 10:13   ` Manos Pitsidianakis
2025-09-17  7:13     ` Zhao Liu
2025-09-16  8:55 ` [PATCH 09/12] rust/qdev: Support bit property in #property macro Zhao Liu
2025-09-16 10:16   ` Manos Pitsidianakis
2025-09-17  7:25     ` Zhao Liu
2025-09-17 11:40       ` Paolo Bonzini
2025-09-17  9:14   ` Paolo Bonzini
2025-09-16  8:55 ` [PATCH 10/12] rust/hpet: Clean up type mismatch for num_timers property Zhao Liu
2025-09-16  8:55 ` [PATCH 11/12] rust/hpet: Convert qdev properties to #property macro Zhao Liu
2025-09-16 10:19   ` Manos Pitsidianakis
2025-09-16  8:55 ` [PATCH 12/12] rust/qdev: Drop declare_properties & define_property macros Zhao Liu
2025-09-16 10:19   ` Manos Pitsidianakis

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20250916085557.2008344-8-zhao1.liu@intel.com \
    --to=zhao1.liu@intel.com \
    --cc=manos.pitsidianakis@linaro.org \
    --cc=pbonzini@redhat.com \
    --cc=qemu-devel@nongnu.org \
    --cc=qemu-rust@nongnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).