]> git.ipfire.org Git - thirdparty/qemu.git/commit
rust: migration: do not store raw pointers into VMStateSubsectionsWrapper
authorPaolo Bonzini <pbonzini@redhat.com>
Thu, 25 Sep 2025 08:32:23 +0000 (10:32 +0200)
committerPaolo Bonzini <pbonzini@redhat.com>
Tue, 14 Oct 2025 09:03:59 +0000 (11:03 +0200)
commit64bce66d6f142272415de5807f38c2b8a884c4c2
tree2c22e03eb21cad31f72e94761cbc46b8bd9e7c61
parent5c776a767703f9f6cd6ee87752e794d2cbab1165
rust: migration: do not store raw pointers into VMStateSubsectionsWrapper

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.

Reviewed-by: Zhao Liu <zhao1.liu@intel.com>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
rust/migration/src/vmstate.rs