Skip to content

Commit 5bd69ad

Browse files
committed
Make DeviceIo depend on Sync
Previously DeviceIo depends on Send, but doesn't depend on Sync, which fails to share Arc<IoManager> among vCPU threads. So make DeviceIo depend on Sync too. Signed-off-by: Liu Jiang <[email protected]>
1 parent 2f4c51c commit 5bd69ad

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/lib.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -80,7 +80,7 @@ impl PartialOrd for IoAddress {
8080
/// real concurrent multiple threads handling. For device backend drivers not
8181
/// focusing on high performance, they may use the Mutex<T: DeviceIoMut>
8282
/// adapter to simplify implementation.
83-
pub trait DeviceIo: Send {
83+
pub trait DeviceIo: Send + Sync {
8484
/// Read from the guest physical address `base`, starting at `offset`.
8585
/// Result is placed in `data`.
8686
fn read(&self, base: IoAddress, offset: IoAddress, data: &mut [u8]);

0 commit comments

Comments
 (0)