rust-vmm / vm-virtio

virtio implementation
Apache License 2.0
366 stars 87 forks source link

Improve the usability of queue interfaces #148

Closed alexandruag closed 2 years ago

alexandruag commented 2 years ago

This RFC suggests a solution addressing the shortcomings mentioned in #144 (there are some very small orthogonal changes that got through as well). Not sure if the choice of naming for the new trait is the best, but the approach is to use that to explicitly gate operations that are only safe/sane when we know for sure accesses are not performed in a multi-threaded context.

lauralt commented 2 years ago

Can you also add some tests? After that, I think it should be ready for merging.

jiangliu commented 2 years ago

This proposal looks good to me, except more work is needed about go_to_previous_position().

alexandruag commented 2 years ago

Rebased and pushed a small fix to address the last outstanding comment. Thank you everyone for the reviews!