[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PATCH 12/12] rust: bindings: remove more unnecessary Send/Sync impls
From: |
Paolo Bonzini |
Subject: |
[PATCH 12/12] rust: bindings: remove more unnecessary Send/Sync impls |
Date: |
Thu, 27 Feb 2025 15:22:19 +0100 |
Send and Sync are now implemented on the opaque wrappers. Remove them
from the bindings module, unless the structs are pure data containers
and/or have no C functions defined on them.
Reviewed-by: Zhao Liu <zhao1.liu@intel.com>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
---
rust/qemu-api/src/bindings.rs | 8 ++------
1 file changed, 2 insertions(+), 6 deletions(-)
diff --git a/rust/qemu-api/src/bindings.rs b/rust/qemu-api/src/bindings.rs
index c3f36108bd5..3c1d297581e 100644
--- a/rust/qemu-api/src/bindings.rs
+++ b/rust/qemu-api/src/bindings.rs
@@ -25,15 +25,11 @@
// SAFETY: these are implemented in C; the bindings need to assert that the
// BQL is taken, either directly or via `BqlCell` and `BqlRefCell`.
-unsafe impl Send for BusState {}
-unsafe impl Sync for BusState {}
-
+// When bindings for character devices are introduced, this can be
+// moved to the Opaque<> wrapper in src/chardev.rs.
unsafe impl Send for CharBackend {}
unsafe impl Sync for CharBackend {}
-unsafe impl Send for ObjectClass {}
-unsafe impl Sync for ObjectClass {}
-
// SAFETY: this is a pure data struct
unsafe impl Send for CoalescedMemoryRange {}
unsafe impl Sync for CoalescedMemoryRange {}
--
2.48.1
- [PATCH 01/12] rust: cell: add wrapper for FFI types, (continued)
- [PATCH 01/12] rust: cell: add wrapper for FFI types, Paolo Bonzini, 2025/02/27
- [PATCH 04/12] rust: timer: wrap QEMUTimer with Opaque<> and express pinning requirements, Paolo Bonzini, 2025/02/27
- [PATCH 06/12] rust: qom: wrap Object with Opaque<>, Paolo Bonzini, 2025/02/27
- [PATCH 05/12] rust: irq: wrap IRQState with Opaque<>, Paolo Bonzini, 2025/02/27
- [PATCH 09/12] rust: sysbus: wrap SysBusDevice with Opaque<>, Paolo Bonzini, 2025/02/27
- [PATCH 11/12] rust: chardev: wrap Chardev with Opaque<>, Paolo Bonzini, 2025/02/27
- [PATCH 07/12] rust: qdev: wrap Clock and DeviceState with Opaque<>, Paolo Bonzini, 2025/02/27
- [PATCH 08/12] rust: hpet: do not access fields of SysBusDevice, Paolo Bonzini, 2025/02/27
- [PATCH 10/12] rust: memory: wrap MemoryRegion with Opaque<>, Paolo Bonzini, 2025/02/27
- [PATCH 02/12] rust: qemu_api_macros: add Wrapper derive macro, Paolo Bonzini, 2025/02/27
- [PATCH 12/12] rust: bindings: remove more unnecessary Send/Sync impls,
Paolo Bonzini <=