On Mon, Sep 08, 2025 at 12:49:40PM +0200, Paolo Bonzini wrote:
> Date: Mon,  8 Sep 2025 12:49:40 +0200
> From: Paolo Bonzini <[email protected]>
> Subject: [PATCH 08/33] rust: vmstate: use const_refs_to_static
> X-Mailer: git-send-email 2.51.0
> 
> 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.
> 
> Signed-off-by: Paolo Bonzini <[email protected]>
> ---
>  docs/devel/rust.rst                  |   5 -
>  rust/hw/char/pl011/src/device.rs     |  19 ++-
>  rust/hw/timer/hpet/src/device.rs     |   8 +-
>  rust/qemu-api/src/assertions.rs      |   4 -
>  rust/qemu-api/src/vmstate.rs         | 229 +++++++--------------------
>  rust/qemu-api/tests/vmstate_tests.rs |  65 +++++---
>  6 files changed, 113 insertions(+), 217 deletions(-)

Good improvement!

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


Reply via email to