[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [PATCH 10/26] rust: qom: move ClassInitImpl to the instance side
From: |
Zhao Liu |
Subject: |
Re: [PATCH 10/26] rust: qom: move ClassInitImpl to the instance side |
Date: |
Wed, 11 Dec 2024 00:03:31 +0800 |
On Mon, Dec 09, 2024 at 01:37:01PM +0100, Paolo Bonzini wrote:
> Date: Mon, 9 Dec 2024 13:37:01 +0100
> From: Paolo Bonzini <pbonzini@redhat.com>
> Subject: [PATCH 10/26] rust: qom: move ClassInitImpl to the instance side
> X-Mailer: git-send-email 2.47.1
>
> Put all traits on the instance struct, which makes it possible to reuse
> class structs if no new virtual methods or class fields are added.
> This is almost always the case for devices (because they are leaf
> classes), which is the primary use case for Rust.
>
> This is also simpler: soon we will find the implemented methods without
> macros, and this removes the need to go from the class struct to the
> instance struct to find the implementation of the *Impl traits.
>
> Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
> ---
> rust/hw/char/pl011/src/device.rs | 4 ++--
> rust/qemu-api/src/definitions.rs | 8 ++++----
> rust/qemu-api/tests/tests.rs | 2 +-
> 3 files changed, 7 insertions(+), 7 deletions(-)
Reviewed-by: Zhao Liu <zhao1.liu@intel.com>
- [PATCH 07/26] rust: qom: add default definitions for ObjectImpl, (continued)
- [PATCH 07/26] rust: qom: add default definitions for ObjectImpl, Paolo Bonzini, 2024/12/09
- [PATCH 04/26] rust: define prelude, Paolo Bonzini, 2024/12/09
- [PATCH 08/26] rust: qom: rename Class trait to ClassInitImpl, Paolo Bonzini, 2024/12/09
- [PATCH 06/26] rust: add a bit operation module, Paolo Bonzini, 2024/12/09
- [PATCH 10/26] rust: qom: move ClassInitImpl to the instance side, Paolo Bonzini, 2024/12/09
- Re: [PATCH 10/26] rust: qom: move ClassInitImpl to the instance side,
Zhao Liu <=
- [PATCH 09/26] rust: qom: convert type_info! macro to an associated const, Paolo Bonzini, 2024/12/09
- [PATCH 12/26] rust: qdev: move bridge for realize and reset functions out of pl011, Paolo Bonzini, 2024/12/09
- [PATCH 13/26] rust: qom: automatically use Drop trait to implement instance_finalize, Paolo Bonzini, 2024/12/09
- [PATCH 14/26] rust: qom: move bridge for TypeInfo functions out of pl011, Paolo Bonzini, 2024/12/09