File tree Expand file tree Collapse file tree 1 file changed +8
-5
lines changed Expand file tree Collapse file tree 1 file changed +8
-5
lines changed Original file line number Diff line number Diff line change @@ -44,9 +44,12 @@ pub(crate) struct KvmDirtyLogRing {
4444 use_acq_rel : bool ,
4545}
4646
47- // SAFETY: TBD
48- unsafe impl Send for KvmDirtyLogRing { }
49- unsafe impl Sync for KvmDirtyLogRing { }
47+ // // SAFETY: For each vcpu we only allow creating a single instance of the KvmDirtyLogRing,
48+ // // therefore ownership can safely be transferred between threads (`Send`).
49+ // unsafe impl Send for KvmDirtyLogRing {}
50+
51+ // // SAFETY: TBD
52+ // unsafe impl Sync for KvmDirtyLogRing {}
5053impl KvmDirtyLogRing {
5154 /// Maps the KVM dirty log ring from the vCPU file descriptor.
5255 ///
@@ -132,7 +135,7 @@ impl Iterator for KvmDirtyLogRing {
132135
133136 if gfn. flags & KVM_DIRTY_GFN_F_DIRTY == 0 {
134137 // next_dirty stays the same, it will become the next dirty element
135- return None ;
138+ None
136139 } else {
137140 self . next_dirty += 1 ;
138141 let mut updated_gfn = gfn;
@@ -144,7 +147,7 @@ impl Iterator for KvmDirtyLogRing {
144147 if self . use_acq_rel {
145148 fence ( Ordering :: Release ) ;
146149 }
147- return Some ( ( gfn. slot , gfn. offset ) ) ;
150+ Some ( ( gfn. slot , gfn. offset ) )
148151 }
149152 }
150153}
You can’t perform that action at this time.
0 commit comments