mirror of
https://github.com/Motorhead1991/qemu.git
synced 2025-07-27 20:33:54 -06:00
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>
This commit is contained in:
parent
5b024b4e73
commit
2537f83098
2 changed files with 34 additions and 15 deletions
|
@ -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()
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue