summaryrefslogtreecommitdiffstats
path: root/block
diff options
context:
space:
mode:
authorVladimir Sementsov-Ogievskiy2020-09-03 21:03:01 +0200
committerEric Blake2020-10-09 22:04:32 +0200
commit99d72dba1c96c3a498d935a54081e226b262641a (patch)
tree9bde473a223df972052ead41065aa23c773de14b /block
parentblock/nbd: fix reconnect-delay (diff)
downloadqemu-99d72dba1c96c3a498d935a54081e226b262641a.tar.gz
qemu-99d72dba1c96c3a498d935a54081e226b262641a.tar.xz
qemu-99d72dba1c96c3a498d935a54081e226b262641a.zip
block/nbd: nbd_co_reconnect_loop(): don't connect if drained
In a recent commit 12c75e20a269ac we've improved nbd_co_reconnect_loop() to not make drain wait for additional sleep. Similarly, we shouldn't try to connect, if previous sleep was interrupted by drain begin, otherwise drain_begin will have to wait for the whole connection attempt. Signed-off-by: Vladimir Sementsov-Ogievskiy <vsementsov@virtuozzo.com> Message-Id: <20200903190301.367620-5-vsementsov@virtuozzo.com> Reviewed-by: Eric Blake <eblake@redhat.com> Signed-off-by: Eric Blake <eblake@redhat.com>
Diffstat (limited to 'block')
-rw-r--r--block/nbd.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/block/nbd.c b/block/nbd.c
index caae0e6d31..4548046cd7 100644
--- a/block/nbd.c
+++ b/block/nbd.c
@@ -661,6 +661,9 @@ static coroutine_fn void nbd_co_reconnect_loop(BDRVNBDState *s)
} else {
qemu_co_sleep_ns_wakeable(QEMU_CLOCK_REALTIME, timeout,
&s->connection_co_sleep_ns_state);
+ if (s->drained) {
+ continue;
+ }
if (timeout < max_timeout) {
timeout *= 2;
}