On Wed, Oct 01, 2025 at 09:52:01AM +0200, Paolo Bonzini wrote:
> Date: Wed,  1 Oct 2025 09:52:01 +0200
> From: Paolo Bonzini <[email protected]>
> Subject: [PATCH 02/11] rust: migration: do not pass raw pointer to
>  VMStateDescription::fields
> X-Mailer: git-send-email 2.51.0
> 
> Pass a slice instead; a function that accepts a raw pointer should
> arguably be declared as unsafe.
> 
> But since it is now much easier to forget vmstate_fields!, validate the
> value (at least to some extent) before passing it to C.  (Unfortunately,
> doing the same for subsections would require const ptr::is_null(), which
> is only stable in Rust 1.84).
> 
> Suggested-by: Zhao Liu <[email protected]>
> Signed-off-by: Paolo Bonzini <[email protected]>
> ---
>  rust/migration/src/vmstate.rs | 9 ++++++---
>  1 file changed, 6 insertions(+), 3 deletions(-)

Reviewed-by: Zhao Liu <[email protected]>


Reply via email to