aboutsummaryrefslogtreecommitdiff
path: root/block
diff options
context:
space:
mode:
Diffstat (limited to 'block')
-rw-r--r--block/nbd.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/block/nbd.c b/block/nbd.c
index 5cfb749..3cbee76 100644
--- a/block/nbd.c
+++ b/block/nbd.c
@@ -150,6 +150,7 @@ static void nbd_recv_coroutines_wake_all(BDRVNBDState *s)
NBDClientRequest *req = &s->requests[i];
if (req->coroutine && req->receiving) {
+ req->receiving = false;
aio_co_wake(req->coroutine);
}
}
@@ -548,6 +549,7 @@ static coroutine_fn void nbd_connection_entry(void *opaque)
* connection_co happens through a bottom half, which can only
* run after we yield.
*/
+ s->requests[i].receiving = false;
aio_co_wake(s->requests[i].coroutine);
qemu_coroutine_yield();
}
@@ -934,7 +936,7 @@ static coroutine_fn int nbd_co_do_receive_one_chunk(
/* Wait until we're woken up by nbd_connection_entry. */
s->requests[i].receiving = true;
qemu_coroutine_yield();
- s->requests[i].receiving = false;
+ assert(!s->requests[i].receiving);
if (!nbd_client_connected(s)) {
error_setg(errp, "Connection closed");
return -EIO;