[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PATCH v3 05/33] block/nbd: BDRVNBDState: drop unused connect_err and co
From: |
Vladimir Sementsov-Ogievskiy |
Subject: |
[PATCH v3 05/33] block/nbd: BDRVNBDState: drop unused connect_err and connect_status |
Date: |
Fri, 16 Apr 2021 11:08:43 +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>
---
block/nbd.c | 12 ++----------
1 file changed, 2 insertions(+), 10 deletions(-)
diff --git a/block/nbd.c b/block/nbd.c
index 6efa11a185..d67556c7ee 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;
@@ -580,7 +578,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;
@@ -621,14 +618,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;
@@ -643,11 +640,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 v3 00/33] block/nbd: rework client connection, Vladimir Sementsov-Ogievskiy, 2021/04/16
- [PATCH v3 05/33] block/nbd: BDRVNBDState: drop unused connect_err and connect_status,
Vladimir Sementsov-Ogievskiy <=
- [PATCH v3 03/33] block/nbd: ensure ->connection_thread is always valid, Vladimir Sementsov-Ogievskiy, 2021/04/16
- [PATCH v3 06/33] util/async: aio_co_schedule(): support reschedule in same ctx, Vladimir Sementsov-Ogievskiy, 2021/04/16
- [PATCH v3 04/33] block/nbd: nbd_client_handshake(): fix leak of s->ioc, Vladimir Sementsov-Ogievskiy, 2021/04/16
- [PATCH v3 07/33] block/nbd: simplify waking of nbd_co_establish_connection(), Vladimir Sementsov-Ogievskiy, 2021/04/16
- [PATCH v3 08/33] block/nbd: drop thr->state, Vladimir Sementsov-Ogievskiy, 2021/04/16