[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [PATCH 11/26] rust: qdev: move device_class_init! body to generic fu
From: |
Zhao Liu |
Subject: |
Re: [PATCH 11/26] rust: qdev: move device_class_init! body to generic function, ClassInitImpl implementation to macro |
Date: |
Wed, 11 Dec 2024 00:06:07 +0800 |
On Mon, Dec 09, 2024 at 01:37:02PM +0100, Paolo Bonzini wrote:
> Date: Mon, 9 Dec 2024 13:37:02 +0100
> From: Paolo Bonzini <pbonzini@redhat.com>
> Subject: [PATCH 11/26] rust: qdev: move device_class_init! body to generic
> function, ClassInitImpl implementation to macro
> X-Mailer: git-send-email 2.47.1
>
> Use a trait to access the former parameters to device_class_init!.
> This allows hiding the details of the class_init implementation behind
> a generic function and makes higher-level functionality available from
> qemu_api.
>
> The implementation of ClassInitImpl is then the same for all devices and
> is easily macroized. Later on, we can remove the need to implement
> ClassInitImpl by hand for all device types, and stop making
> rust_device_class_init<>() public.
>
> While at it, document the members of DeviceImpl.
>
> Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
> ---
> rust/hw/char/pl011/src/device.rs | 34 +++++-----
> rust/hw/char/pl011/src/device_class.rs | 8 ---
> rust/qemu-api/src/device_class.rs | 87 +++++++++++++++++++++-----
> rust/qemu-api/tests/tests.rs | 30 ++++-----
> 4 files changed, 103 insertions(+), 56 deletions(-)
Rviewed-by: Zhao Liu <zhao1.liu@intel.com>
- Re: [PATCH 14/26] rust: qom: move bridge for TypeInfo functions out of pl011, (continued)
- Re: [PATCH 14/26] rust: qom: move bridge for TypeInfo functions out of pl011, Paolo Bonzini, 2024/12/10
- Re: [PATCH 14/26] rust: qom: move bridge for TypeInfo functions out of pl011, Zhao Liu, 2024/12/11
- Re: [PATCH 14/26] rust: qom: move bridge for TypeInfo functions out of pl011, Paolo Bonzini, 2024/12/11
- Re: [PATCH 14/26] rust: qom: move bridge for TypeInfo functions out of pl011, Zhao Liu, 2024/12/11
- Re: [PATCH 14/26] rust: qom: move bridge for TypeInfo functions out of pl011, Paolo Bonzini, 2024/12/12
- Re: [PATCH 14/26] rust: qom: move bridge for TypeInfo functions out of pl011, Zhao Liu, 2024/12/13
Re: [PATCH 14/26] rust: qom: move bridge for TypeInfo functions out of pl011, Zhao Liu, 2024/12/10
[PATCH 15/26] rust: qom: split ObjectType from ObjectImpl trait, Paolo Bonzini, 2024/12/09
[PATCH 11/26] rust: qdev: move device_class_init! body to generic function, ClassInitImpl implementation to macro, Paolo Bonzini, 2024/12/09
- Re: [PATCH 11/26] rust: qdev: move device_class_init! body to generic function, ClassInitImpl implementation to macro,
Zhao Liu <=
[PATCH 16/26] rust: qom: change the parent type to an associated type, Paolo Bonzini, 2024/12/09
[PATCH 19/26] rust: rename qemu-api modules to follow C code a bit more, Paolo Bonzini, 2024/12/09
[PATCH 24/26] rust: qom: move device_id to PL011 class side, Paolo Bonzini, 2024/12/09