[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PULL 3/8] block/nbd: correctly use qio_channel_detach_aio_context when
From: |
Eric Blake |
Subject: |
[PULL 3/8] block/nbd: correctly use qio_channel_detach_aio_context when needed |
Date: |
Thu, 8 Oct 2020 13:59:46 -0500 |
From: Vladimir Sementsov-Ogievskiy <vsementsov@virtuozzo.com>
Don't use nbd_client_detach_aio_context() driver handler where we want
to finalize the connection. We should directly use
qio_channel_detach_aio_context() in such cases. Driver handler may (and
will) contain another things, unrelated to the qio channel.
Signed-off-by: Vladimir Sementsov-Ogievskiy <vsementsov@virtuozzo.com>
Message-Id: <20200903190301.367620-3-vsementsov@virtuozzo.com>
Reviewed-by: Eric Blake <eblake@redhat.com>
Signed-off-by: Eric Blake <eblake@redhat.com>
---
block/nbd.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/block/nbd.c b/block/nbd.c
index 912ea27be7d8..a495ad7ddff8 100644
--- a/block/nbd.c
+++ b/block/nbd.c
@@ -549,7 +549,7 @@ static coroutine_fn void nbd_reconnect_attempt(BDRVNBDState
*s)
/* Finalize previous connection if any */
if (s->ioc) {
- nbd_client_detach_aio_context(s->bs);
+ qio_channel_detach_aio_context(QIO_CHANNEL(s->ioc));
object_unref(OBJECT(s->sioc));
s->sioc = NULL;
object_unref(OBJECT(s->ioc));
@@ -707,7 +707,7 @@ static coroutine_fn void nbd_connection_entry(void *opaque)
s->connection_co = NULL;
if (s->ioc) {
- nbd_client_detach_aio_context(s->bs);
+ qio_channel_detach_aio_context(QIO_CHANNEL(s->ioc));
object_unref(OBJECT(s->sioc));
s->sioc = NULL;
object_unref(OBJECT(s->ioc));
--
2.28.0
- [PULL 0/8] NBD patches through 2020-10-08, Eric Blake, 2020/10/08
- [PULL 4/8] block/nbd: fix reconnect-delay, Eric Blake, 2020/10/08
- [PULL 2/8] block/nbd: fix drain dead-lock because of nbd reconnect-delay, Eric Blake, 2020/10/08
- [PULL 5/8] block/nbd: nbd_co_reconnect_loop(): don't connect if drained, Eric Blake, 2020/10/08
- [PULL 3/8] block/nbd: correctly use qio_channel_detach_aio_context when needed,
Eric Blake <=
- [PULL 7/8] nbd/server: Reject embedded NUL in NBD strings, Eric Blake, 2020/10/08
- [PULL 1/8] nbd: silence maybe-uninitialized warnings, Eric Blake, 2020/10/08
- [PULL 6/8] qemu-nbd: Honor SIGINT and SIGHUP, Eric Blake, 2020/10/08
- [PULL 8/8] nbd: Simplify meta-context parsing, Eric Blake, 2020/10/08
- Re: [PULL 0/8] NBD patches through 2020-10-08, Peter Maydell, 2020/10/09