coroutine: Assert that no locks are held on termination
commit1b7f01d966f97b7820f3cdd471461cf0799a93cc
authorKevin Wolf <kwolf@redhat.com>
Thu, 11 Aug 2016 15:51:59 +0000 (11 17:51 +0200)
committerKevin Wolf <kwolf@redhat.com>
Mon, 5 Sep 2016 17:06:48 +0000 (5 19:06 +0200)
treeaaf94f449ee10f7eb018b5f9987e6f1205036c68
parent0e438cdc932a785de72166af4641aafa103a6670
coroutine: Assert that no locks are held on termination

A coroutine that takes a lock must also release it again. If the
coroutine terminates without having released all its locks, it's buggy
and we'll probably run into a deadlock sooner or later. Make sure that
we don't get such cases.

Signed-off-by: Kevin Wolf <kwolf@redhat.com>
Reviewed-by: Paolo Bonzini <pbonzini@redhat.com>
Reviewed-by: Stefan Hajnoczi <stefanha@redhat.com>
include/qemu/coroutine_int.h
util/qemu-coroutine-lock.c
util/qemu-coroutine.c