]> git.ipfire.org Git - thirdparty/qemu.git/commit
rust: vmstate: implement VMState for scalar types
authorPaolo Bonzini <pbonzini@redhat.com>
Sun, 29 Dec 2024 10:59:34 +0000 (11:59 +0100)
committerPaolo Bonzini <pbonzini@redhat.com>
Thu, 23 Jan 2025 10:50:53 +0000 (11:50 +0100)
commitf2cb78bdbe5f9ff61366beb216971a8502456c3a
tree2554bfcbaa5bf79e6a5bd9ae703ff5b3b9f97a44
parent2537f8309885013c4b04ae7b2888591ba0cb6ca7
rust: vmstate: implement VMState for scalar types

Scalar types are those that have their own VMStateInfo.  This poses
a problem in that references to VMStateInfo can only be included in
associated consts starting with Rust 1.83.0, when the const_refs_static
was stabilized.  Removing the requirement is done by placing a limited
list of VMStateInfos in an enum, and going from enum to &VMStateInfo
only when building the VMStateField.

The same thing cannot be done with VMS_STRUCT because the set of
VMStateDescriptions extends to structs defined by the devices.
Therefore, structs and cells cannot yet use vmstate_of!.

Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
rust/qemu-api/src/vmstate.rs