diff options
author | Zhao Liu <zhao1.liu@intel.com> | 2025-04-14 22:49:35 +0800 |
---|---|---|
committer | Paolo Bonzini <pbonzini@redhat.com> | 2025-05-02 17:37:46 +0200 |
commit | 6f8e6aed81277ec14d5a5dcafdd00dadf7ac465c (patch) | |
tree | c2b21b2a6923c2db3e2d04476eca7bc0920022ee /rust/qemu-api-macros | |
parent | 5134cf9b5d3aee4475fe7e1c1c11b093731073cf (diff) | |
download | qemu-6f8e6aed81277ec14d5a5dcafdd00dadf7ac465c.zip qemu-6f8e6aed81277ec14d5a5dcafdd00dadf7ac465c.tar.gz qemu-6f8e6aed81277ec14d5a5dcafdd00dadf7ac465c.tar.bz2 |
rust/vmstate: Add support for field_exists checks
Unfortunately, at present it's not possible to have a const
"with_exist_check" method to append test_fn after vmstate_struct (due
to error on "constant functions cannot evaluate destructors" for `F`).
Before the vmstate builder, the only way to support "test_fn" is to
extend vmstate_struct macro to add the such new optional member (and
fortunately, Rust can still parse the current expansion!).
Abstract the previous callback implementation of vmstate_validate into
a separate macro, and moves it before vmstate_struct for vmstate_struct
to call.
Note that there's no need to add any extra flag for a new test_fn added
in the VMStateField.
Signed-off-by: Zhao Liu <zhao1.liu@intel.com>
Link: https://lore.kernel.org/r/20250414144943.1112885-2-zhao1.liu@intel.com
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
Diffstat (limited to 'rust/qemu-api-macros')
0 files changed, 0 insertions, 0 deletions