qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: Vladimir Sementsov-Ogievskiy <vsementsov@virtuozzo.com>
To: qemu-block@nongnu.org
Cc: qemu-devel@nongnu.org, mreitz@redhat.com, kwolf@redhat.com,
	vsementsov@virtuozzo.com, eblake@redhat.com,
	rvkagan@yandex-team.ru, den@openvz.org
Subject: [PATCH 02/14] block/nbd: nbd_co_establish_connection(): drop unused errp
Date: Wed,  7 Apr 2021 13:46:25 +0300	[thread overview]
Message-ID: <20210407104637.36033-3-vsementsov@virtuozzo.com> (raw)
In-Reply-To: <20210407104637.36033-1-vsementsov@virtuozzo.com>

We are going to refactor connection logic to make it more
understandable. Every bit that we can simplify in advance will help.
Drop errp for now, it's unused anyway. We'll probably reimplement it in
future.

Signed-off-by: Vladimir Sementsov-Ogievskiy <vsementsov@virtuozzo.com>
---
 block/nbd.c | 9 ++++-----
 1 file changed, 4 insertions(+), 5 deletions(-)

diff --git a/block/nbd.c b/block/nbd.c
index a47d6cfea3..29c33338bf 100644
--- a/block/nbd.c
+++ b/block/nbd.c
@@ -145,7 +145,7 @@ typedef struct BDRVNBDState {
 
 static int nbd_establish_connection(BlockDriverState *bs, SocketAddress *saddr,
                                     Error **errp);
-static int nbd_co_establish_connection(BlockDriverState *bs, Error **errp);
+static int nbd_co_establish_connection(BlockDriverState *bs);
 static void nbd_co_establish_connection_cancel(BlockDriverState *bs,
                                                bool detach);
 static int nbd_client_handshake(BlockDriverState *bs, Error **errp);
@@ -435,7 +435,7 @@ static void *connect_thread_func(void *opaque)
 }
 
 static int coroutine_fn
-nbd_co_establish_connection(BlockDriverState *bs, Error **errp)
+nbd_co_establish_connection(BlockDriverState *bs)
 {
     int ret;
     QemuThread thread;
@@ -491,7 +491,7 @@ nbd_co_establish_connection(BlockDriverState *bs, Error **errp)
     case CONNECT_THREAD_SUCCESS:
     case CONNECT_THREAD_FAIL:
         thr->state = CONNECT_THREAD_NONE;
-        error_propagate(errp, thr->err);
+        error_free(thr->err);
         thr->err = NULL;
         s->sioc = thr->sioc;
         thr->sioc = NULL;
@@ -509,7 +509,6 @@ nbd_co_establish_connection(BlockDriverState *bs, Error **errp)
          * result may be used for next connection attempt.
          */
         ret = -1;
-        error_setg(errp, "Connection attempt cancelled by other operation");
         break;
 
     case CONNECT_THREAD_NONE:
@@ -617,7 +616,7 @@ static coroutine_fn void nbd_reconnect_attempt(BDRVNBDState *s)
         s->ioc = NULL;
     }
 
-    if (nbd_co_establish_connection(s->bs, NULL) < 0) {
+    if (nbd_co_establish_connection(s->bs) < 0) {
         ret = -ECONNREFUSED;
         goto out;
     }
-- 
2.29.2



  parent reply	other threads:[~2021-04-07 10:49 UTC|newest]

Thread overview: 21+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-04-07 10:46 [PATCH 00/14] nbd: move reconnect-thread to separate file Vladimir Sementsov-Ogievskiy
2021-04-07 10:46 ` [PATCH 01/14] block/nbd: BDRVNBDState: drop unused connect_err Vladimir Sementsov-Ogievskiy
2021-04-07 11:13   ` Roman Kagan
2021-04-07 10:46 ` Vladimir Sementsov-Ogievskiy [this message]
2021-04-07 11:28   ` [PATCH 02/14] block/nbd: nbd_co_establish_connection(): drop unused errp Roman Kagan
2021-04-07 10:46 ` [PATCH 03/14] block/nbd: drop unused NBDConnectThread::err field Vladimir Sementsov-Ogievskiy
2021-04-07 11:42   ` Roman Kagan
2021-04-07 11:55     ` Vladimir Sementsov-Ogievskiy
2021-04-07 10:46 ` [PATCH 04/14] block/nbd: split connect_thread_cb() out of connect_thread_func() Vladimir Sementsov-Ogievskiy
2021-04-07 10:46 ` [PATCH 05/14] block/nbd: rename NBDConnectThread to NBDConnectCB Vladimir Sementsov-Ogievskiy
2021-04-07 10:46 ` [PATCH 06/14] block/nbd: further segregation of connect-thread Vladimir Sementsov-Ogievskiy
2021-04-08 10:44   ` Roman Kagan
2021-04-07 10:46 ` [PATCH 07/14] block/nbd: drop nbd_free_connect_thread() Vladimir Sementsov-Ogievskiy
2021-04-07 10:46 ` [PATCH 08/14] block/nbd: move nbd connect-thread to nbd/client-connect.c Vladimir Sementsov-Ogievskiy
2021-04-07 10:46 ` [PATCH 09/14] block/nbd: NBDConnectCB: drop bh_* fields Vladimir Sementsov-Ogievskiy
2021-04-07 10:46 ` [PATCH 10/14] block/nbd: move wait_connect field under mutex protection Vladimir Sementsov-Ogievskiy
2021-04-07 10:46 ` [PATCH 11/14] block/nbd: refactor connect_bh() Vladimir Sementsov-Ogievskiy
2021-04-07 10:46 ` [PATCH 12/14] block/nbd: refactor nbd_co_establish_connection Vladimir Sementsov-Ogievskiy
2021-04-07 10:46 ` [PATCH 13/14] block/nbd: nbd_co_establish_connection_cancel(): rename wake to do_wake Vladimir Sementsov-Ogievskiy
2021-04-07 10:46 ` [PATCH 14/14] block/nbd: drop thr->state Vladimir Sementsov-Ogievskiy
2021-04-08 10:03 ` DROP THIS Re: [PATCH 00/14] nbd: move reconnect-thread to separate file Vladimir Sementsov-Ogievskiy

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20210407104637.36033-3-vsementsov@virtuozzo.com \
    --to=vsementsov@virtuozzo.com \
    --cc=den@openvz.org \
    --cc=eblake@redhat.com \
    --cc=kwolf@redhat.com \
    --cc=mreitz@redhat.com \
    --cc=qemu-block@nongnu.org \
    --cc=qemu-devel@nongnu.org \
    --cc=rvkagan@yandex-team.ru \
    --subject='Re: [PATCH 02/14] block/nbd: nbd_co_establish_connection(): drop unused errp' \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).