rust: bindings: add Send and Sync markers for types that have bindings

This is needed for the MemoryRegionOps<T> to be declared as static;
Rust requires static elements to be Sync.

Reviewed-by: Zhao Liu <zhao1.liu@intel.com>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
This commit is contained in:
Paolo Bonzini 2024-12-13 17:09:35 +01:00
parent 5472a38cb9
commit d449d29a99
2 changed files with 49 additions and 0 deletions

View file

@ -43,6 +43,9 @@ where
_marker: PhantomData<T>,
}
// SAFETY: the implementation asserts via `BqlCell` that the BQL is taken
unsafe impl<T> Sync for InterruptSource<T> where c_int: From<T> {}
impl InterruptSource<bool> {
/// Send a low (`false`) value to the interrupt sink.
pub fn lower(&self) {