[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PATCH v4 09/32] block/nbd: BDRVNBDState: drop unused connect_err and co
From: |
Vladimir Sementsov-Ogievskiy |
Subject: |
[PATCH v4 09/32] block/nbd: BDRVNBDState: drop unused connect_err and connect_status |
Date: |
Thu, 10 Jun 2021 13:07:39 +0300 |
These fields are write-only. Drop them.
Signed-off-by: Vladimir Sementsov-Ogievskiy <vsementsov@virtuozzo.com>
Reviewed-by: Roman Kagan <rvkagan@yandex-team.ru>
Reviewed-by: Eric Blake <eblake@redhat.com>
---
block/nbd.c | 12 ++----------
1 file changed, 2 insertions(+), 10 deletions(-)
diff --git a/block/nbd.c b/block/nbd.c
index 77b85ca471..fdfb1ff7a1 100644
--- a/block/nbd.c
+++ b/block/nbd.c
@@ -121,8 +121,6 @@ typedef struct BDRVNBDState {
bool wait_drained_end;
int in_flight;
NBDClientState state;
- int connect_status;
- Error *connect_err;
bool wait_in_flight;
QEMUTimer *reconnect_delay_timer;
@@ -578,7 +576,6 @@ static void
nbd_co_establish_connection_cancel(BlockDriverState *bs)
static coroutine_fn void nbd_reconnect_attempt(BDRVNBDState *s)
{
int ret;
- Error *local_err = NULL;
if (!nbd_client_connecting(s)) {
return;
@@ -619,14 +616,14 @@ static coroutine_fn void
nbd_reconnect_attempt(BDRVNBDState *s)
s->ioc = NULL;
}
- if (nbd_co_establish_connection(s->bs, &local_err) < 0) {
+ if (nbd_co_establish_connection(s->bs, NULL) < 0) {
ret = -ECONNREFUSED;
goto out;
}
bdrv_dec_in_flight(s->bs);
- ret = nbd_client_handshake(s->bs, &local_err);
+ ret = nbd_client_handshake(s->bs, NULL);
if (s->drained) {
s->wait_drained_end = true;
@@ -641,11 +638,6 @@ static coroutine_fn void
nbd_reconnect_attempt(BDRVNBDState *s)
bdrv_inc_in_flight(s->bs);
out:
- s->connect_status = ret;
- error_free(s->connect_err);
- s->connect_err = NULL;
- error_propagate(&s->connect_err, local_err);
-
if (ret >= 0) {
/* successfully connected */
s->state = NBD_CLIENT_CONNECTED;
--
2.29.2
- [PATCH v4 00/32] block/nbd: rework client connection, Vladimir Sementsov-Ogievskiy, 2021/06/10
- [PATCH v4 01/32] co-queue: drop extra coroutine_fn marks, Vladimir Sementsov-Ogievskiy, 2021/06/10
- [PATCH v4 02/32] block/nbd: fix channel object leak, Vladimir Sementsov-Ogievskiy, 2021/06/10
- [PATCH v4 06/32] block/nbd: call socket_address_parse_named_fd() in advance, Vladimir Sementsov-Ogievskiy, 2021/06/10
- [PATCH v4 07/32] block/nbd: ensure ->connection_thread is always valid, Vladimir Sementsov-Ogievskiy, 2021/06/10
- [PATCH v4 08/32] block/nbd: nbd_client_handshake(): fix leak of s->ioc, Vladimir Sementsov-Ogievskiy, 2021/06/10
- [PATCH v4 03/32] block/nbd: fix how state is cleared on nbd_open() failure paths, Vladimir Sementsov-Ogievskiy, 2021/06/10
- [PATCH v4 09/32] block/nbd: BDRVNBDState: drop unused connect_err and connect_status,
Vladimir Sementsov-Ogievskiy <=
- [PATCH v4 04/32] block/nbd: connect_thread_func(): do qio_channel_set_delay(false), Vladimir Sementsov-Ogievskiy, 2021/06/10
- [PATCH v4 10/32] block/nbd: simplify waking of nbd_co_establish_connection(), Vladimir Sementsov-Ogievskiy, 2021/06/10
- [PATCH v4 17/32] nbd: move connection code from block/nbd to nbd/client-connection, Vladimir Sementsov-Ogievskiy, 2021/06/10
- [PATCH v4 12/32] block/nbd: bs-independent interface for nbd_co_establish_connection(), Vladimir Sementsov-Ogievskiy, 2021/06/10
- [PATCH v4 18/32] nbd/client-connection: use QEMU_LOCK_GUARD, Vladimir Sementsov-Ogievskiy, 2021/06/10
- [PATCH v4 19/32] nbd/client-connection: add possibility of negotiation, Vladimir Sementsov-Ogievskiy, 2021/06/10