Re: [PATCH WIP RFC] rust: add qdev DeviceProperties derive macro

2025-05-28 Thread Paolo Bonzini
On 5/28/25 12:49, Manos Pitsidianakis wrote: It's not too large, overall. #[repr(C)] -#[derive(qemu_api_macros::Object)] +#[derive(qemu_api_macros::Object, qemu_api_macros::DeviceProperties)] Is there more to be derived that is useful for Devices? Maybe the macro can be DeviceState or Devic

Re: [PATCH WIP RFC] rust: add qdev DeviceProperties derive macro

2025-05-28 Thread Manos Pitsidianakis
On Fri, May 23, 2025 at 4:06 PM Paolo Bonzini wrote: > > > > Il gio 22 mag 2025, 10:12 Manos Pitsidianakis > ha scritto: >> >> This is unnecessary though, because once we have the >> const_refs_to_static feature we can introduce a QdevProp trait that >> returns a reference to a type's qdev_prop_

Re: [PATCH WIP RFC] rust: add qdev DeviceProperties derive macro

2025-05-23 Thread Paolo Bonzini
Il gio 22 mag 2025, 10:12 Manos Pitsidianakis < manos.pitsidiana...@linaro.org> ha scritto: > This is unnecessary though, because once we have the > const_refs_to_static feature we can introduce a QdevProp trait that > returns a reference to a type's qdev_prop_* global variable. We cannot > do thi

Re: [PATCH WIP RFC] rust: add qdev DeviceProperties derive macro

2025-05-22 Thread Zhao Liu
On Thu, May 22, 2025 at 11:12:30AM +0300, Manos Pitsidianakis wrote: > Date: Thu, 22 May 2025 11:12:30 +0300 > From: Manos Pitsidianakis > Subject: [PATCH WIP RFC] rust: add qdev DeviceProperties derive macro > X-Mailer: b4 0.14.2 > > Add derive macro for declaring qdev propert

[PATCH WIP RFC] rust: add qdev DeviceProperties derive macro

2025-05-22 Thread Manos Pitsidianakis
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` att