mirror of
https://github.com/Motorhead1991/qemu.git
synced 2025-07-27 04:13:53 -06:00
rust/vmstate: Fix "cannot infer type" error in vmstate_struct
Rust cannot infer the type (it should be VMStateField) after Zeroable::ZERO, which cause the compiling error. To fix this error, call with_varray_flag() after VMStateField's initialization. Signed-off-by: Zhao Liu <zhao1.liu@intel.com> Link: https://lore.kernel.org/r/20250318130219.1799170-7-zhao1.liu@intel.com Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
This commit is contained in:
parent
618258256e
commit
42c814b139
1 changed files with 9 additions and 7 deletions
|
@ -453,13 +453,15 @@ macro_rules! vmstate_struct {
|
|||
size: ::core::mem::size_of::<$type>(),
|
||||
flags: $crate::bindings::VMStateFlags::VMS_STRUCT,
|
||||
vmsd: $vmsd,
|
||||
..$crate::zeroable::Zeroable::ZERO $(
|
||||
.with_varray_flag($crate::call_func_with_field!(
|
||||
$crate::vmstate::vmstate_varray_flag,
|
||||
$struct_name,
|
||||
$num))
|
||||
$(.with_varray_multiply($factor))?)?
|
||||
}
|
||||
..$crate::zeroable::Zeroable::ZERO
|
||||
} $(.with_varray_flag(
|
||||
$crate::call_func_with_field!(
|
||||
$crate::vmstate::vmstate_varray_flag,
|
||||
$struct_name,
|
||||
$num
|
||||
)
|
||||
)
|
||||
$(.with_varray_multiply($factor))?)?
|
||||
};
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue