]> git.ipfire.org Git - thirdparty/qemu.git/commit
rust: vmstate: use const_refs_to_static
authorPaolo Bonzini <pbonzini@redhat.com>
Mon, 8 Sep 2025 10:49:40 +0000 (12:49 +0200)
committerPaolo Bonzini <pbonzini@redhat.com>
Wed, 17 Sep 2025 17:00:56 +0000 (19:00 +0200)
commitdcdee1e718f9400a2bf523f2b009fb936370ae4b
tree583754ab489c93da6c32a8cd3cd0563e3eabe7f4
parent7da9ee9207c55a783567eb46c71fa89cb5b43461
rust: vmstate: use const_refs_to_static

The VMStateDescriptionBuilder already needs const_refs_static, so
use it to remove the need for vmstate_clock! and vmstate_struct!,
as well as to simplify the implementation for scalars.

If the consts in the VMState trait can reference to static
VMStateDescription, scalars do not need the info_enum_to_ref!
indirection and structs can implement the VMState trait themselves.

Reviewed-by: Zhao Liu <zhao1.liu@intel.com>
Link: https://lore.kernel.org/r/20250908105005.2119297-9-pbonzini@redhat.com
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
docs/devel/rust.rst
rust/hw/char/pl011/src/device.rs
rust/hw/timer/hpet/src/device.rs
rust/qemu-api/src/assertions.rs
rust/qemu-api/src/vmstate.rs
rust/qemu-api/tests/vmstate_tests.rs