On Mon, Sep 08, 2025 at 12:49:38PM +0200, Paolo Bonzini wrote:
> Date: Mon,  8 Sep 2025 12:49:38 +0200
> From: Paolo Bonzini <[email protected]>
> Subject: [PATCH 06/33] rust: add qdev Device derive macro
> X-Mailer: git-send-email 2.51.0
> 
> From: Manos Pitsidianakis <[email protected]>
> 
> Add derive macro for declaring qdev properties directly above the field
> definitions. To do this, we split DeviceImpl::properties method on a
> separate trait so we can implement only that part in the derive macro
> expansion (we cannot partially implement the DeviceImpl trait).
> 
> Adding a `property` attribute above the field declaration will generate
> a `qemu_api::bindings::Property` array member in the device's property
> list.
> 
> Signed-off-by: Manos Pitsidianakis <[email protected]>
> Link: 
> https://lore.kernel.org/r/[email protected]
> Signed-off-by: Paolo Bonzini <[email protected]>
> ---
>  rust/hw/char/pl011/src/device.rs  |  31 +-----
>  rust/hw/timer/hpet/src/device.rs  |   6 +-
>  rust/qemu-api-macros/src/lib.rs   | 152 +++++++++++++++++++++++++++++-
>  rust/qemu-api-macros/src/tests.rs | 111 ++++++++++++++++++++++
>  rust/qemu-api/src/qdev.rs         |  70 ++++++++++++--
>  rust/qemu-api/tests/tests.rs      |  24 +----
>  6 files changed, 336 insertions(+), 58 deletions(-)

Reviewed-by: Zhao Liu <[email protected]>


Reply via email to