summaryrefslogtreecommitdiffstats
path: root/tests/test-coroutine.c
diff options
context:
space:
mode:
authorPeter Maydell2016-09-06 18:18:17 +0200
committerPeter Maydell2016-09-06 18:18:17 +0200
commit2926375cffce464fde6b4dabaed1e133d549af39 (patch)
treeb832cd53fd9a2f2a26fe5c70c4182266c780cc76 /tests/test-coroutine.c
parentMerge remote-tracking branch 'remotes/cohuck/tags/s390x-20160906-v2' into sta... (diff)
parentblock: Allow node name for 'qemu-io' HMP command (diff)
downloadqemu-2926375cffce464fde6b4dabaed1e133d549af39.tar.gz
qemu-2926375cffce464fde6b4dabaed1e133d549af39.tar.xz
qemu-2926375cffce464fde6b4dabaed1e133d549af39.zip
Merge remote-tracking branch 'remotes/kevin/tags/for-upstream' into staging
Block layer patches # gpg: Signature made Tue 06 Sep 2016 11:38:01 BST # gpg: using RSA key 0x7F09B272C88F2FD6 # gpg: Good signature from "Kevin Wolf <kwolf@redhat.com>" # Primary key fingerprint: DC3D EB15 9A9A F95D 3D74 56FE 7F09 B272 C88F 2FD6 * remotes/kevin/tags/for-upstream: (36 commits) block: Allow node name for 'qemu-io' HMP command qemu-iotests: Log QMP traffic in debug mode block jobs: Improve error message for missing job ID coroutine: Assert that no locks are held on termination coroutine: Let CoMutex remember who holds it qcow2: fix iovec size at qcow2_co_pwritev_compressed test-coroutine: Fix coroutine pool corruption qemu-iotests: add vmdk for test backup compression in 055 qemu-iotests: test backup compression in 055 blockdev-backup: added support for data compression drive-backup: added support for data compression block: simplify blockdev-backup block: simplify drive-backup block/io: turn on dirty_bitmaps for the compressed writes block: remove BlockDriver.bdrv_write_compressed qcow: cleanup qcow_co_pwritev_compressed to avoid the recursion qcow: add qcow_co_pwritev_compressed vmdk: add vmdk_co_pwritev_compressed qcow2: cleanup qcow2_co_pwritev_compressed to avoid the recursion qcow2: add qcow2_co_pwritev_compressed ... Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
Diffstat (limited to 'tests/test-coroutine.c')
-rw-r--r--tests/test-coroutine.c7
1 files changed, 7 insertions, 0 deletions
diff --git a/tests/test-coroutine.c b/tests/test-coroutine.c
index ee5e06d327..6431dd6d7c 100644
--- a/tests/test-coroutine.c
+++ b/tests/test-coroutine.c
@@ -139,13 +139,20 @@ static void test_co_queue(void)
{
Coroutine *c1;
Coroutine *c2;
+ Coroutine tmp;
c2 = qemu_coroutine_create(c2_fn, NULL);
c1 = qemu_coroutine_create(c1_fn, c2);
qemu_coroutine_enter(c1);
+
+ /* c1 shouldn't be used any more now; make sure we segfault if it is */
+ tmp = *c1;
memset(c1, 0xff, sizeof(Coroutine));
qemu_coroutine_enter(c2);
+
+ /* Must restore the coroutine now to avoid corrupted pool */
+ *c1 = tmp;
}
/*