]> git.ipfire.org Git - thirdparty/qemu.git/commitdiff
coroutine: let CoQueue wake up outside a coroutine
authorMarc-André Lureau <marcandre.lureau@redhat.com>
Tue, 27 Oct 2020 13:36:00 +0000 (17:36 +0400)
committerGerd Hoffmann <kraxel@redhat.com>
Wed, 4 Nov 2020 07:02:24 +0000 (08:02 +0100)
The assert() was added in commit b681a1c73e15 ("block: Repair the
throttling code."), when the qemu_co_queue_do_restart() function
required to be running in a coroutine. It was later made unnecessary in
commit a9d9235567e7 ("coroutine-lock: reschedule coroutine on the
AioContext it was running on").

Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com>
Reviewed-by: Kevin Wolf <kwolf@redhat.com>
Reviewed-by: Gerd Hoffmann <kraxel@redhat.com>
Message-id: 20201027133602.3038018-2-marcandre.lureau@redhat.com
Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
util/qemu-coroutine-lock.c

index 36927b5f88d58e96531e0fdd13367f8e1272d08c..5816bf890094d4e87f72808abe0631a0cd5fb26f 100644 (file)
@@ -85,15 +85,13 @@ static bool qemu_co_queue_do_restart(CoQueue *queue, bool single)
     return true;
 }
 
-bool coroutine_fn qemu_co_queue_next(CoQueue *queue)
+bool qemu_co_queue_next(CoQueue *queue)
 {
-    assert(qemu_in_coroutine());
     return qemu_co_queue_do_restart(queue, true);
 }
 
-void coroutine_fn qemu_co_queue_restart_all(CoQueue *queue)
+void qemu_co_queue_restart_all(CoQueue *queue)
 {
-    assert(qemu_in_coroutine());
     qemu_co_queue_do_restart(queue, false);
 }