diff options
author | Vladimir Sementsov-Ogievskiy | 2021-06-10 12:07:56 +0200 |
---|---|---|
committer | Eric Blake | 2021-06-18 19:20:53 +0200 |
commit | 43cb34dede464c2e9a51ea33bc246b40db5d68d4 (patch) | |
tree | b7615e2527419f62b44a5b705644143a01def90a /block | |
parent | block/nbd: drop BDRVNBDState::sioc (diff) | |
download | qemu-43cb34dede464c2e9a51ea33bc246b40db5d68d4.tar.gz qemu-43cb34dede464c2e9a51ea33bc246b40db5d68d4.tar.xz qemu-43cb34dede464c2e9a51ea33bc246b40db5d68d4.zip |
nbd/client-connection: return only one io channel
block/nbd doesn't need underlying sioc channel anymore. So, we can
update nbd/client-connection interface to return only one top-most io
channel, which is more straight forward.
Signed-off-by: Vladimir Sementsov-Ogievskiy <vsementsov@virtuozzo.com>
Reviewed-by: Eric Blake <eblake@redhat.com>
Message-Id: <20210610100802.5888-27-vsementsov@virtuozzo.com>
[eblake: squash in Vladimir's fixes for uninit usage caught by clang]
Signed-off-by: Eric Blake <eblake@redhat.com>
Diffstat (limited to 'block')
-rw-r--r-- | block/nbd.c | 13 |
1 files changed, 2 insertions, 11 deletions
diff --git a/block/nbd.c b/block/nbd.c index 9f193d130b..411435c155 100644 --- a/block/nbd.c +++ b/block/nbd.c @@ -360,7 +360,6 @@ static coroutine_fn void nbd_reconnect_attempt(BDRVNBDState *s) { int ret; AioContext *aio_context = bdrv_get_aio_context(s->bs); - QIOChannelSocket *sioc; if (!nbd_client_connecting(s)) { return; @@ -399,20 +398,12 @@ static coroutine_fn void nbd_reconnect_attempt(BDRVNBDState *s) s->ioc = NULL; } - sioc = nbd_co_establish_connection(s->conn, &s->info, &s->ioc, NULL); - if (!sioc) { + s->ioc = nbd_co_establish_connection(s->conn, &s->info, NULL); + if (!s->ioc) { ret = -ECONNREFUSED; goto out; } - if (s->ioc) { - /* sioc is referenced by s->ioc */ - object_unref(OBJECT(sioc)); - } else { - s->ioc = QIO_CHANNEL(sioc); - } - sioc = NULL; - qio_channel_set_blocking(QIO_CHANNEL(s->ioc), false, NULL); qio_channel_attach_aio_context(QIO_CHANNEL(s->ioc), aio_context); |