qemu-rust.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: Manos Pitsidianakis <manos.pitsidianakis@linaro.org>
To: Zhao Liu <zhao1.liu@intel.com>
Cc: Paolo Bonzini <pbonzini@redhat.com>,
	qemu-devel@nongnu.org, qemu-rust@nongnu.org
Subject: Re: [PATCH 12/12] rust/qdev: Drop declare_properties & define_property macros
Date: Tue, 16 Sep 2025 13:19:51 +0300	[thread overview]
Message-ID: <CAAjaMXaNCc2hE-n+TwxfGauhT+f+5rj2tL9j1iDbf0bOLdgWfw@mail.gmail.com> (raw)
In-Reply-To: <20250916085557.2008344-13-zhao1.liu@intel.com>

On Tue, Sep 16, 2025 at 11:34 AM Zhao Liu <zhao1.liu@intel.com> wrote:
>
> After HPET's #property conversion, there's no use case for
> declare_properties & define_property. So get rid of them for now.
>
> In future, if there's something that #property really cannot resolve,
> they can be brought back.
>
> Signed-off-by: Zhao Liu <zhao1.liu@intel.com>
> ---

Reviewed-by: Manos Pitsidianakis <manos.pitsidianakis@linaro.org>

>  rust/hw/core/src/qdev.rs | 53 ----------------------------------------
>  1 file changed, 53 deletions(-)
>
> diff --git a/rust/hw/core/src/qdev.rs b/rust/hw/core/src/qdev.rs
> index a8cd9e3c2fd5..a32ada4c175e 100644
> --- a/rust/hw/core/src/qdev.rs
> +++ b/rust/hw/core/src/qdev.rs
> @@ -248,59 +248,6 @@ pub fn class_init<T: DeviceImpl>(&mut self) {
>      }
>  }
>
> -#[macro_export]
> -macro_rules! define_property {
> -    ($name:expr, $state:ty, $field:ident, $prop:expr, $type:ty, bit = $bitnr:expr, default = $defval:expr$(,)*) => {
> -        $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 = $defval:expr$(,)*) => {
> -        $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$(,)*) => {
> -        $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),*$(,)*) => {
> -        pub static $ident: [$crate::bindings::Property; {
> -            let mut len = 0;
> -            $({
> -                _ = stringify!($prop);
> -                len += 1;
> -            })*
> -            len
> -        }] = [
> -            $($prop),*,
> -        ];
> -    };
> -}
> -
>  unsafe impl ObjectType for DeviceState {
>      type Class = DeviceClass;
>      const TYPE_NAME: &'static CStr =
> --
> 2.34.1
>


      reply	other threads:[~2025-09-16 10:20 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 ` [PATCH 07/12] rust/qdev: Rename PropertyInfo field from VALUE to BASE_INFO Zhao Liu
2025-09-16 10:10   ` 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 [this message]

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=CAAjaMXaNCc2hE-n+TwxfGauhT+f+5rj2tL9j1iDbf0bOLdgWfw@mail.gmail.com \
    --to=manos.pitsidianakis@linaro.org \
    --cc=pbonzini@redhat.com \
    --cc=qemu-devel@nongnu.org \
    --cc=qemu-rust@nongnu.org \
    --cc=zhao1.liu@intel.com \
    /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).