diff options
| author | Marc-André Lureau <marcandre.lureau@redhat.com> | 2025-09-08 12:49:47 +0200 |
|---|---|---|
| committer | Paolo Bonzini <pbonzini@redhat.com> | 2025-09-17 19:00:57 +0200 |
| commit | a6765c04beac0a3e20032b619df6afbc70b6ef74 (patch) | |
| tree | 6f139f12f9f8a3d071c12ce6c9eaf0c8854486c3 /rust/qemu-api/src/vmstate.rs | |
| parent | 0611dd418abbf5d7c011bd465779cb955cea0f39 (diff) | |
| download | focaccia-qemu-a6765c04beac0a3e20032b619df6afbc70b6ef74.tar.gz focaccia-qemu-a6765c04beac0a3e20032b619df6afbc70b6ef74.zip | |
rust: move Cell vmstate impl
This will allow to split vmstate to a standalone crate next. Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com> Link: https://lore.kernel.org/r/20250827104147.717203-10-marcandre.lureau@redhat.com 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 | 14 |
1 files changed, 7 insertions, 7 deletions
diff --git a/rust/qemu-api/src/vmstate.rs b/rust/qemu-api/src/vmstate.rs index 4e1086779a..ce42b031bc 100644 --- a/rust/qemu-api/src/vmstate.rs +++ b/rust/qemu-api/src/vmstate.rs @@ -124,7 +124,8 @@ pub const fn vmstate_varray_flag<T: VMState>(_: PhantomData<T>) -> VMStateFlags /// * scalar types (integer and `bool`) /// * the C struct `QEMUTimer` /// * a transparent wrapper for any of the above (`Cell`, `UnsafeCell`, -/// [`BqlCell`], [`BqlRefCell`] +/// [`BqlCell`](crate::cell::BqlCell), +/// [`BqlRefCell`](crate::cell::BqlRefCell)), /// * a raw pointer to any of the above /// * a `NonNull` pointer, a `Box` or an [`Owned`](crate::qom::Owned) for any of /// the above @@ -254,14 +255,15 @@ macro_rules! impl_vmstate_forward { // Transparent wrappers: just use the internal type +#[macro_export] macro_rules! impl_vmstate_transparent { ($type:ty where $base:tt: VMState $($where:tt)*) => { - unsafe impl<$base> VMState for $type where $base: VMState $($where)* { - const BASE: VMStateField = VMStateField { + unsafe impl<$base> $crate::vmstate::VMState for $type where $base: $crate::vmstate::VMState $($where)* { + const BASE: $crate::vmstate::VMStateField = $crate::vmstate::VMStateField { size: mem::size_of::<$type>(), - ..<$base as VMState>::BASE + ..<$base as $crate::vmstate::VMState>::BASE }; - const VARRAY_FLAG: VMStateFlags = <$base as VMState>::VARRAY_FLAG; + const VARRAY_FLAG: $crate::bindings::VMStateFlags = <$base as $crate::vmstate::VMState>::VARRAY_FLAG; } }; } @@ -269,8 +271,6 @@ macro_rules! impl_vmstate_transparent { impl_vmstate_transparent!(std::cell::Cell<T> where T: VMState); impl_vmstate_transparent!(std::cell::UnsafeCell<T> where T: VMState); impl_vmstate_transparent!(std::pin::Pin<T> where T: VMState); -impl_vmstate_transparent!(crate::cell::BqlCell<T> where T: VMState); -impl_vmstate_transparent!(crate::cell::BqlRefCell<T> where T: VMState); impl_vmstate_transparent!(crate::cell::Opaque<T> where T: VMState); #[macro_export] |