[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [PATCH 15/26] rust: qom: split ObjectType from ObjectImpl trait
From: |
Zhao Liu |
Subject: |
Re: [PATCH 15/26] rust: qom: split ObjectType from ObjectImpl trait |
Date: |
Wed, 11 Dec 2024 16:41:28 +0800 |
On Mon, Dec 09, 2024 at 01:37:06PM +0100, Paolo Bonzini wrote:
> Date: Mon, 9 Dec 2024 13:37:06 +0100
> From: Paolo Bonzini <pbonzini@redhat.com>
> Subject: [PATCH 15/26] rust: qom: split ObjectType from ObjectImpl trait
> X-Mailer: git-send-email 2.47.1
>
> Define a separate trait for fields that also applies to classes that are
> defined by C code. This makes it possible to add metadata to core classes,
> which has multiple uses:
>
> - it makes it possible to access the parent struct's TYPE_* for types
> that are defined in Rust code, and to avoid repeating it in every subclass
>
> - implementors of ObjectType will be allowed to implement the IsA<> trait and
> therefore to perform typesafe casts from one class to another.
>
> - in the future, an ObjectType could be created with Foo::new() in a type-safe
> manner, without having to pass a TYPE_* constant.
>
> Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
> ---
> rust/hw/char/pl011/src/device.rs | 17 ++++++++++++-----
> rust/qemu-api/src/definitions.rs | 9 ++++++---
> rust/qemu-api/src/device_class.rs | 11 ++++++-----
> rust/qemu-api/src/prelude.rs | 2 ++
> rust/qemu-api/src/sysbus.rs | 10 ++++++++--
> rust/qemu-api/tests/tests.rs | 12 +++++++++---
> 6 files changed, 43 insertions(+), 18 deletions(-)
Reviewed-by: Zhao Liu <zhao1.liu@intel.com>
- [PATCH 14/26] rust: qom: move bridge for TypeInfo functions out of pl011, (continued)
- [PATCH 14/26] rust: qom: move bridge for TypeInfo functions out of pl011, Paolo Bonzini, 2024/12/09
- Re: [PATCH 14/26] rust: qom: move bridge for TypeInfo functions out of pl011, Zhao Liu, 2024/12/10
- 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
- Re: [PATCH 15/26] rust: qom: split ObjectType from ObjectImpl trait,
Zhao Liu <=
[PATCH 24/26] rust: qom: move device_id to PL011 class side, Paolo Bonzini, 2024/12/09
- Re: [PATCH 24/26] rust: qom: move device_id to PL011 class side, Zhao Liu, 2024/12/16
- Re: [PATCH 24/26] rust: qom: move device_id to PL011 class side, Paolo Bonzini, 2024/12/17
- Re: [PATCH 24/26] rust: qom: move device_id to PL011 class side, Zhao Liu, 2024/12/18
- Re: [PATCH 24/26] rust: qom: move device_id to PL011 class side, Paolo Bonzini, 2024/12/18
- Re: [PATCH 24/26] rust: qom: move device_id to PL011 class side, Paolo Bonzini, 2024/12/18
- Re: [PATCH 24/26] rust: qom: move device_id to PL011 class side, Zhao Liu, 2024/12/18
- Re: [PATCH 24/26] rust: qom: move device_id to PL011 class side, Paolo Bonzini, 2024/12/18
Re: [PATCH 24/26] rust: qom: move device_id to PL011 class side, Zhao Liu, 2024/12/18
Re: [PATCH 24/26] rust: qom: move device_id to PL011 class side, Zhao Liu, 2024/12/18