mirror of
https://github.com/Motorhead1991/qemu.git
synced 2025-07-26 20:03:54 -06:00
vmstate: support varray for vmstate_clock!
Make vmstate_struct and vmstate_clock more similar; they are basically the same thing, except for the clock case having a built-in VMStateDescription. Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
This commit is contained in:
parent
6f8e6aed81
commit
756ea88fff
1 changed files with 10 additions and 3 deletions
|
@ -507,7 +507,7 @@ macro_rules! vmstate_struct {
|
|||
#[doc(alias = "VMSTATE_CLOCK")]
|
||||
#[macro_export]
|
||||
macro_rules! vmstate_clock {
|
||||
($struct_name:ty, $field_name:ident) => {{
|
||||
($struct_name:ty, $field_name:ident $([0 .. $num:ident $(* $factor:expr)?])?) => {{
|
||||
$crate::bindings::VMStateField {
|
||||
name: ::core::concat!(::core::stringify!($field_name), "\0")
|
||||
.as_bytes()
|
||||
|
@ -516,7 +516,7 @@ macro_rules! vmstate_clock {
|
|||
$crate::assert_field_type!(
|
||||
$struct_name,
|
||||
$field_name,
|
||||
$crate::qom::Owned<$crate::qdev::Clock>
|
||||
$crate::qom::Owned<$crate::qdev::Clock> $(, num = $num)?
|
||||
);
|
||||
$crate::offset_of!($struct_name, $field_name)
|
||||
},
|
||||
|
@ -527,7 +527,14 @@ macro_rules! vmstate_clock {
|
|||
),
|
||||
vmsd: unsafe { ::core::ptr::addr_of!($crate::bindings::vmstate_clock) },
|
||||
..$crate::zeroable::Zeroable::ZERO
|
||||
}
|
||||
} $(.with_varray_flag_unchecked(
|
||||
$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