aboutsummaryrefslogtreecommitdiff
path: root/rust/qemu-api/src/cell.rs
diff options
context:
space:
mode:
authorMarc-André Lureau <marcandre.lureau@redhat.com>2025-09-08 12:49:47 +0200
committerPaolo Bonzini <pbonzini@redhat.com>2025-09-17 19:00:57 +0200
commita6765c04beac0a3e20032b619df6afbc70b6ef74 (patch)
tree6f139f12f9f8a3d071c12ce6c9eaf0c8854486c3 /rust/qemu-api/src/cell.rs
parent0611dd418abbf5d7c011bd465779cb955cea0f39 (diff)
downloadqemu-a6765c04beac0a3e20032b619df6afbc70b6ef74.zip
qemu-a6765c04beac0a3e20032b619df6afbc70b6ef74.tar.gz
qemu-a6765c04beac0a3e20032b619df6afbc70b6ef74.tar.bz2
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/cell.rs')
-rw-r--r--rust/qemu-api/src/cell.rs6
1 files changed, 5 insertions, 1 deletions
diff --git a/rust/qemu-api/src/cell.rs b/rust/qemu-api/src/cell.rs
index 148a13e..9943d72 100644
--- a/rust/qemu-api/src/cell.rs
+++ b/rust/qemu-api/src/cell.rs
@@ -221,7 +221,7 @@ use std::{
ptr::NonNull,
};
-use crate::bindings;
+use crate::{bindings, impl_vmstate_transparent};
/// An internal function that is used by doctests.
pub fn bql_start_test() {
@@ -456,6 +456,8 @@ impl<T: Default> BqlCell<T> {
}
}
+impl_vmstate_transparent!(crate::cell::BqlCell<T> where T: VMState);
+
/// A mutable memory location with dynamically checked borrow rules,
/// protected by the Big QEMU Lock.
///
@@ -764,6 +766,8 @@ impl<T> From<T> for BqlRefCell<T> {
}
}
+impl_vmstate_transparent!(crate::cell::BqlRefCell<T> where T: VMState);
+
struct BorrowRef<'b> {
borrow: &'b Cell<BorrowFlag>,
}