]> git.ipfire.org Git - thirdparty/qemu.git/blobdiff - util/qemu-coroutine-sleep.c
iotests: Fix cleanup path in some tests
[thirdparty/qemu.git] / util / qemu-coroutine-sleep.c
index ae91b92b6e78dfbb570d5321d282aca4bce52e26..769a76e57df0950de3d9b624836becf08a67a296 100644 (file)
@@ -68,5 +68,12 @@ void coroutine_fn qemu_co_sleep_ns_wakeable(QEMUClockType type, int64_t ns,
     }
     timer_mod(state.ts, qemu_clock_get_ns(type) + ns);
     qemu_coroutine_yield();
+    if (sleep_state) {
+        /*
+         * Note that *sleep_state is cleared during qemu_co_sleep_wake
+         * before resuming this coroutine.
+         */
+        assert(*sleep_state == NULL);
+    }
     timer_free(state.ts);
 }