On Wed, Oct 01, 2025 at 09:52:02AM +0200, Paolo Bonzini wrote:
> Date: Wed,  1 Oct 2025 09:52:02 +0200
> From: Paolo Bonzini <[email protected]>
> Subject: [PATCH 03/11] rust: migration: do not store raw pointers into
>  VMStateSubsectionsWrapper
> X-Mailer: git-send-email 2.51.0
> 
> Raw pointers were used to insert a NULL one at the end of the array.
> However, Option<&...> has the same layout and does not remove Sync
> from the type of the array.
> 
> As an extra benefit, this enables validation of the terminator of the
> subsection array, because is_null() in const context would not be stable
> until Rust 1.84.
> 
> Signed-off-by: Paolo Bonzini <[email protected]>
> ---
>  rust/migration/src/vmstate.rs | 29 +++++++++--------------------
>  1 file changed, 9 insertions(+), 20 deletions(-)

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


Reply via email to