diff mbox series

[RFC,v2,18/25] block/coroutines: I/O API

Message ID 20211005143215.29500-19-eesposit@redhat.com (mailing list archive)
State New, archived
Headers show
Series block layer: split block APIs in global state and I/O | expand

Commit Message

Emanuele Giuseppe Esposito Oct. 5, 2021, 2:32 p.m. UTC
block coroutines functions run in different aiocontext, and are
not protected by the BQL. Therefore are I/O.

Signed-off-by: Emanuele Giuseppe Esposito <eesposit@redhat.com>
---
 block/coroutines.h | 6 ++++++
 1 file changed, 6 insertions(+)

Comments

Paolo Bonzini Oct. 7, 2021, 11:52 a.m. UTC | #1
On 05/10/21 16:32, Emanuele Giuseppe Esposito wrote:
> block coroutines functions run in different aiocontext, and are
> not protected by the BQL. Therefore are I/O.
> 
> Signed-off-by: Emanuele Giuseppe Esposito <eesposit@redhat.com>
> ---
>   block/coroutines.h | 6 ++++++
>   1 file changed, 6 insertions(+)
> 
> diff --git a/block/coroutines.h b/block/coroutines.h
> index 514d169d23..105e0ce2a9 100644
> --- a/block/coroutines.h
> +++ b/block/coroutines.h
> @@ -27,6 +27,12 @@
>   
>   #include "block/block_int.h"
>   
> +/*
> + * I/O API functions. These functions are thread-safe, and therefore
> + * can run in any thread as long as they have called
> + * aio_context_acquire/release().
> + */
> +
>   int coroutine_fn bdrv_co_check(BlockDriverState *bs,
>                                  BdrvCheckResult *res, BdrvCheckMode fix);
>   int coroutine_fn bdrv_co_invalidate_cache(BlockDriverState *bs, Error **errp);
> 

Reviewed-by: Paolo Bonzini <pbonzini@redhat.com>

except for the same comment about "they" that was in patch 2.

Paolo
Stefan Hajnoczi Oct. 7, 2021, 2:47 p.m. UTC | #2
On Tue, Oct 05, 2021 at 10:32:08AM -0400, Emanuele Giuseppe Esposito wrote:
> block coroutines functions run in different aiocontext, and are
> not protected by the BQL. Therefore are I/O.
> 
> Signed-off-by: Emanuele Giuseppe Esposito <eesposit@redhat.com>
> ---
>  block/coroutines.h | 6 ++++++
>  1 file changed, 6 insertions(+)

Reviewed-by: Stefan Hajnoczi <stefanha@redhat.com>
diff mbox series

Patch

diff --git a/block/coroutines.h b/block/coroutines.h
index 514d169d23..105e0ce2a9 100644
--- a/block/coroutines.h
+++ b/block/coroutines.h
@@ -27,6 +27,12 @@ 
 
 #include "block/block_int.h"
 
+/*
+ * I/O API functions. These functions are thread-safe, and therefore
+ * can run in any thread as long as they have called
+ * aio_context_acquire/release().
+ */
+
 int coroutine_fn bdrv_co_check(BlockDriverState *bs,
                                BdrvCheckResult *res, BdrvCheckMode fix);
 int coroutine_fn bdrv_co_invalidate_cache(BlockDriverState *bs, Error **errp);