diff options
Diffstat (limited to 'block/nbd.c')
-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 9f193d1..411435c 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); |