diff options
author | Peter Maydell | 2017-11-21 18:05:49 +0100 |
---|---|---|
committer | Peter Maydell | 2017-11-21 18:05:49 +0100 |
commit | 64807cd77938885f681a9a18b5736e923ad50b7c (patch) | |
tree | 7785670f2bc440477c5727b73766685017f6feee /include/qemu/coroutine_int.h | |
parent | Merge remote-tracking branch 'remotes/kevin/tags/for-upstream' into staging (diff) | |
parent | qemu-iotest: add test for blockjob coroutine race condition (diff) | |
download | qemu-64807cd77938885f681a9a18b5736e923ad50b7c.tar.gz qemu-64807cd77938885f681a9a18b5736e923ad50b7c.tar.xz qemu-64807cd77938885f681a9a18b5736e923ad50b7c.zip |
Merge remote-tracking branch 'remotes/cody/tags/block-pull-request' into staging
# gpg: Signature made Tue 21 Nov 2017 17:01:33 GMT
# gpg: using RSA key 0xBDBE7B27C0DE3057
# gpg: Good signature from "Jeffrey Cody <jcody@redhat.com>"
# gpg: aka "Jeffrey Cody <jeff@codyprime.org>"
# gpg: aka "Jeffrey Cody <codyprime@gmail.com>"
# Primary key fingerprint: 9957 4B4D 3474 90E7 9D98 D624 BDBE 7B27 C0DE 3057
* remotes/cody/tags/block-pull-request:
qemu-iotest: add test for blockjob coroutine race condition
qemu-iotests: add option in common.qemu for mismatch only
coroutine: abort if we try to schedule or enter a pending coroutine
blockjob: do not allow coroutine double entry or entry-after-completion
Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
Diffstat (limited to 'include/qemu/coroutine_int.h')
-rw-r--r-- | include/qemu/coroutine_int.h | 13 |
1 files changed, 10 insertions, 3 deletions
diff --git a/include/qemu/coroutine_int.h b/include/qemu/coroutine_int.h index cb98892bba..59e8406398 100644 --- a/include/qemu/coroutine_int.h +++ b/include/qemu/coroutine_int.h @@ -46,14 +46,21 @@ struct Coroutine { size_t locks_held; + /* Only used when the coroutine has yielded. */ + AioContext *ctx; + + /* Used to catch and abort on illegal co-routine entry. + * Will contain the name of the function that had first + * scheduled the coroutine. */ + const char *scheduled; + + QSIMPLEQ_ENTRY(Coroutine) co_queue_next; + /* Coroutines that should be woken up when we yield or terminate. * Only used when the coroutine is running. */ QSIMPLEQ_HEAD(, Coroutine) co_queue_wakeup; - /* Only used when the coroutine has yielded. */ - AioContext *ctx; - QSIMPLEQ_ENTRY(Coroutine) co_queue_next; QSLIST_ENTRY(Coroutine) co_scheduled_next; }; |