Comment 34 for bug 1805256

Revision history for this message
Fred Kimmy (kongzizaixian) wrote :

 include/block/aio.h | 3 +++
 qemu-img.c | 4 ++++
 util/async.c | 5 +----
 3 files changed, 8 insertions(+), 4 deletions(-)

diff --git a/include/block/aio.h b/include/block/aio.h
index e9bc04c..9153d87 100644
--- a/include/block/aio.h
+++ b/include/block/aio.h
@@ -89,6 +89,9 @@ struct AioContext {
      */
     uint32_t notify_me;

+ /* force to notify for qemu-img convert */
+ bool notify_for_convert;
+
     /* lock to protect between bh's adders and deleter */
     QemuMutex bh_lock;

diff --git a/qemu-img.c b/qemu-img.c
index 60a2be3..cf037aa 100644
--- a/qemu-img.c
+++ b/qemu-img.c
@@ -2411,6 +2411,10 @@ static int img_convert(int argc, char **argv)
         .wr_in_order = wr_in_order,
         .num_coroutines = num_coroutines,
     };
+
+ AioContext *ctx = qemu_get_aio_context();
+ ctx->notify_for_convert = 1;
+
     ret = convert_do_copy(&state);

 out:
diff --git a/util/async.c b/util/async.c
index 042bf8a..af235fc 100644
--- a/util/async.c
+++ b/util/async.c
@@ -336,12 +336,9 @@ void aio_notify(AioContext *ctx)
      * with atomic_or in aio_ctx_prepare or atomic_add in aio_poll.
      */
     smp_mb();
- if (ctx->notify_me) {
+ if (ctx->notify_me || ctx->notify_for_convert) {
         event_notifier_set(&ctx->notifier);
         atomic_mb_set(&ctx->notified, true);
-#if defined(__aarch64__)
- kill(getpid(), SIGIO);
-#endif
     }
 }

Can you try this aboving patchset to slove it?