qemu-rust.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: Zhao Liu <zhao1.liu@intel.com>
To: Paolo Bonzini <pbonzini@redhat.com>
Cc: qemu-devel@nongnu.org, manos.pitsidianakis@linaro.org,
	qemu-rust@nongnu.org
Subject: Re: [PATCH 07/11] rust: qom: fix TODO about zeroability of classes
Date: Tue, 6 May 2025 16:01:06 +0800	[thread overview]
Message-ID: <aBnBwlhkS23VwULI@intel.com> (raw)
In-Reply-To: <20250505090438.24992-8-pbonzini@redhat.com>

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 <pbonzini@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 <pbonzini@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.liu@intel.com>



  parent reply	other threads:[~2025-05-06  7:40 UTC|newest]

Thread overview: 26+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-05-05  9:04 [PATCH 00/11] rust: allow minimum version of 1.77 Paolo Bonzini
2025-05-05  9:04 ` [PATCH 01/11] lcitool: use newer Rust for Debian and Ubuntu Paolo Bonzini
2025-05-05  9:04 ` [PATCH 02/11] meson, cargo: require Rust 1.77.0 Paolo Bonzini
2025-05-05  9:29   ` Manos Pitsidianakis
2025-05-06  7:39   ` Zhao Liu
2025-05-05  9:04 ` [PATCH 03/11] rust: use std::ffi instead of std::os::raw Paolo Bonzini
2025-05-06  7:40   ` Zhao Liu
2025-05-05  9:04 ` [PATCH 04/11] rust: let bilge use "let ... else" Paolo Bonzini
2025-05-06  7:41   ` Zhao Liu
2025-05-05  9:04 ` [PATCH 05/11] rust: qemu_api_macros: make pattern matching more readable and efficient Paolo Bonzini
2025-05-06  7:48   ` Zhao Liu
2025-05-05  9:04 ` [PATCH 06/11] rust: use MaybeUninit::zeroed() in const context Paolo Bonzini
2025-05-06  7:56   ` Zhao Liu
2025-05-05  9:04 ` [PATCH 07/11] rust: qom: fix TODO about zeroability of classes Paolo Bonzini
2025-05-05  9:32   ` Manos Pitsidianakis
2025-05-06  8:01   ` Zhao Liu [this message]
2025-05-05  9:04 ` [PATCH 08/11] rust: enable clippy::ptr_cast_constness Paolo Bonzini
2025-05-06  8:04   ` Zhao Liu
2025-05-05  9:04 ` [PATCH 09/11] rust: remove offset_of replacement Paolo Bonzini
2025-05-05  9:34   ` Manos Pitsidianakis
2025-05-06  8:32   ` Zhao Liu
2025-05-05  9:04 ` [PATCH 10/11] rust: replace c_str! with c"" literals Paolo Bonzini
2025-05-06  8:34   ` Zhao Liu
2025-05-05  9:04 ` [PATCH 11/11] docs: rust: update for newer minimum supported version Paolo Bonzini
2025-05-05  9:35   ` Manos Pitsidianakis
2025-05-06  8:38   ` Zhao Liu

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=aBnBwlhkS23VwULI@intel.com \
    --to=zhao1.liu@intel.com \
    --cc=manos.pitsidianakis@linaro.org \
    --cc=pbonzini@redhat.com \
    --cc=qemu-devel@nongnu.org \
    --cc=qemu-rust@nongnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).