On Mon, May 05, 2025 at 11:04:32AM +0200, Paolo Bonzini wrote:
> Date: Mon,  5 May 2025 11:04:32 +0200
> From: Paolo Bonzini <pbonz...@redhat.com>
> Subject: [PATCH 07/11] rust: qom: fix TODO about zeroability of classes
> X-Mailer: git-send-email 2.49.0
> 
> The proposed suggestion is not correct.  First it is not necessary for
> *all* classes to be Zeroable, only for Rust-defined ones; classes
> defined in C never implement ObjectImpl.
> 
> Second, the parent class field need not be Zeroable.  For example,
> ChardevClass's chr_write and chr_be_event fields cannot be NULL,
> therefore ChardevClass cannot be Zeroable.  However, char_class_init()
> initializes them, therefore ChardevClass could be subclassed by Rust code.
> 
> Signed-off-by: Paolo Bonzini <pbonz...@redhat.com>
> ---
>  rust/qemu-api/src/qom.rs | 7 ++++---
>  1 file changed, 4 insertions(+), 3 deletions(-)

Yes, it's clearly explained.

Reviewed-by: Zhao Liu <zhao1....@intel.com>


Reply via email to