aboutsummaryrefslogtreecommitdiff
path: root/block/sheepdog.c
diff options
context:
space:
mode:
authorMORITA Kazutaka <morita.kazutaka@lab.ntt.co.jp>2012-01-31 02:10:06 +0900
committerKevin Wolf <kwolf@redhat.com>2012-02-09 16:17:51 +0100
commit6d1acda8f16d1f2d0b05cfbf9ce54d05849cb016 (patch)
treed599e4aaec47997afabded247f57659ee0a1c642 /block/sheepdog.c
parentc9b308d20b642c106048f088ccc31f2aa7cf59ba (diff)
downloadqemu-6d1acda8f16d1f2d0b05cfbf9ce54d05849cb016.zip
qemu-6d1acda8f16d1f2d0b05cfbf9ce54d05849cb016.tar.gz
qemu-6d1acda8f16d1f2d0b05cfbf9ce54d05849cb016.tar.bz2
sheepdog: fix co_recv coroutine context
The co_recv coroutine has two things that will try to enter it: 1. The select(2) read callback on the sheepdog socket. 2. The aio_add_request() blocking operations, including a coroutine mutex. This patch fixes it by setting NULL to co_recv before sending data. In future, we should make the sheepdog driver fully coroutine-based and simplify request handling. Signed-off-by: MORITA Kazutaka <morita.kazutaka@lab.ntt.co.jp> Signed-off-by: Kevin Wolf <kwolf@redhat.com>
Diffstat (limited to 'block/sheepdog.c')
-rw-r--r--block/sheepdog.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/block/sheepdog.c b/block/sheepdog.c
index 9416400..00276f6f 100644
--- a/block/sheepdog.c
+++ b/block/sheepdog.c
@@ -629,6 +629,9 @@ static void coroutine_fn aio_read_response(void *opaque)
switch (acb->aiocb_type) {
case AIOCB_WRITE_UDATA:
+ /* this coroutine context is no longer suitable for co_recv
+ * because we may send data to update vdi objects */
+ s->co_recv = NULL;
if (!is_data_obj(aio_req->oid)) {
break;
}