diff options
author | Paolo Bonzini <pbonzini@redhat.com> | 2024-12-29 12:15:36 +0100 |
---|---|---|
committer | Paolo Bonzini <pbonzini@redhat.com> | 2025-01-23 11:50:53 +0100 |
commit | 2537f8309885013c4b04ae7b2888591ba0cb6ca7 (patch) | |
tree | 14c2890c15145b4c8d457bb312f6b7d40bde3b80 /rust/qemu-api/src/vmstate.rs | |
parent | 5b024b4e73f180402fde8485e8d4a51383592940 (diff) | |
download | qemu-2537f8309885013c4b04ae7b2888591ba0cb6ca7.zip qemu-2537f8309885013c4b04ae7b2888591ba0cb6ca7.tar.gz qemu-2537f8309885013c4b04ae7b2888591ba0cb6ca7.tar.bz2 |
rust: vmstate: implement Zeroable for VMStateField
This shortens a bit the constants. Do not bother using it
in the vmstate macros since most of them will go away soon.
Reviewed-by: Zhao Liu <zhao1.liu@intel.com>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
Diffstat (limited to 'rust/qemu-api/src/vmstate.rs')
-rw-r--r-- | rust/qemu-api/src/vmstate.rs | 18 |
1 files changed, 3 insertions, 15 deletions
diff --git a/rust/qemu-api/src/vmstate.rs b/rust/qemu-api/src/vmstate.rs index 2b14d48..7652930 100644 --- a/rust/qemu-api/src/vmstate.rs +++ b/rust/qemu-api/src/vmstate.rs @@ -21,8 +21,8 @@ use core::{marker::PhantomData, mem, ptr::NonNull}; -use crate::bindings::VMStateFlags; pub use crate::bindings::{VMStateDescription, VMStateField}; +use crate::bindings::VMStateFlags; /// This macro is used to call a function with a generic argument bound /// to the type of a field. The function must take a @@ -503,20 +503,8 @@ macro_rules! vmstate_fields { static _FIELDS: &[$crate::bindings::VMStateField] = &[ $($field),*, $crate::bindings::VMStateField { - name: ::core::ptr::null(), - err_hint: ::core::ptr::null(), - offset: 0, - size: 0, - start: 0, - num: 0, - num_offset: 0, - size_offset: 0, - info: ::core::ptr::null(), - flags: VMStateFlags::VMS_END, - vmsd: ::core::ptr::null(), - version_id: 0, - struct_version_id: 0, - field_exists: None, + flags: $crate::bindings::VMStateFlags::VMS_END, + ..$crate::zeroable::Zeroable::ZERO } ]; _FIELDS.as_ptr() |