On Thu, Jun 09, 2022 at 10:37:25AM -0400, Emanuele Giuseppe Esposito wrote: > Just as done in the block API, mark functions in virtio-blk > that are called also from iothread(s). > > We know such functions are IO because many are blk_* callbacks, > running always in the device iothread, and remaining are propagated > from the leaf IO functions (if a function calls a IO_CODE function, > itself is categorized as IO_CODE too). > > Signed-off-by: Emanuele Giuseppe Esposito <eespo...@redhat.com> > --- > hw/block/dataplane/virtio-blk.c | 4 ++++ > hw/block/virtio-blk.c | 35 +++++++++++++++++++++++++++++++++ > 2 files changed, 39 insertions(+)
The definition of IO_CODE() is: I/O API functions. These functions are thread-safe, and therefore can run in any thread as long as the thread has called aio_context_acquire/release(). I'm not sure it matches with the exact semantics you have in mind. Are they really allowed to be called from any thread and even from multiple threads? Or maybe just from the BlockBackend's AioContext thread? We need to be very careful to define these terms precisely and avoid applying them in cases that are similar but different as that will cause problems in the future. Otherwise: Reviewed-by: Stefan Hajnoczi <stefa...@redhat.com>
signature.asc
Description: PGP signature