qemu-block
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[PATCH 03/11] block/block-gen.h: bind monitor


From: Vladimir Sementsov-Ogievskiy
Subject: [PATCH 03/11] block/block-gen.h: bind monitor
Date: Sat, 24 Apr 2021 00:40:25 +0300

If we have current monitor, let's bind it to wrapper coroutine too.

Signed-off-by: Vladimir Sementsov-Ogievskiy <vsementsov@virtuozzo.com>
---
 block/block-gen.h | 10 ++++++++++
 1 file changed, 10 insertions(+)

diff --git a/block/block-gen.h b/block/block-gen.h
index c1fd3f40de..61f055a8cc 100644
--- a/block/block-gen.h
+++ b/block/block-gen.h
@@ -27,6 +27,7 @@
 #define BLOCK_BLOCK_GEN_H
 
 #include "block/block_int.h"
+#include "monitor/monitor.h"
 
 /* Base structure for argument packing structures */
 typedef struct AioPollCo {
@@ -38,11 +39,20 @@ typedef struct AioPollCo {
 
 static inline int aio_poll_co(AioPollCo *s)
 {
+    Monitor *mon = monitor_cur();
     assert(!qemu_in_coroutine());
 
+    if (mon) {
+        monitor_set_cur(s->co, mon);
+    }
+
     aio_co_enter(s->ctx, s->co);
     AIO_WAIT_WHILE(s->ctx, s->in_progress);
 
+    if (mon) {
+        monitor_set_cur(s->co, NULL);
+    }
+
     return s->ret;
 }
 
-- 
2.29.2




reply via email to

[Prev in Thread] Current Thread [Next in Thread]