public inbox for passt-dev@passt.top
 help / color / mirror / code / Atom feed
From: David Gibson <david@gibson.dropbear.id.au>
To: passt-dev@passt.top, Stefano Brivio <sbrivio@redhat.com>
Cc: David Gibson <david@gibson.dropbear.id.au>
Subject: [PATCH v2 2/3] migrate, tcp: Report more error conditions during connection repair
Date: Tue,  4 Feb 2025 16:42:14 +1100	[thread overview]
Message-ID: <20250204054215.644811-3-david@gibson.dropbear.id.au> (raw)
In-Reply-To: <20250204054215.644811-1-david@gibson.dropbear.id.au>

This should help debugging problems with migration.

[This is a candidate to be folded into the earlier patch]

Signed-off-by: David Gibson <david@gibson.dropbear.id.au>
---
 tcp.c | 11 +++++++++--
 1 file changed, 9 insertions(+), 2 deletions(-)

diff --git a/tcp.c b/tcp.c
index 3760e67a..7ce0f4cb 100644
--- a/tcp.c
+++ b/tcp.c
@@ -1011,10 +1011,17 @@ int tcp_flow_repair_connect(struct ctx *c, struct tcp_tap_conn *conn)
 {
 	struct flowside *tgt = &conn->f.side[TGTSIDE];
 	struct tcp_repair_opt opts[2];
+	int rc;
 
-	tcp_flow_repair_seq(c, conn, true);
+	rc = tcp_flow_repair_seq(c, conn, true);
+	if (rc)
+		return rc;
 
-	flowside_connect(c, conn->sock, PIF_HOST, tgt);
+	rc = flowside_connect(c, conn->sock, PIF_HOST, tgt);
+	if (rc) {
+		err("Failed to connect repaired socket: %s", strerror_(errno));
+		return rc;
+	}
 
 	/* FIXME: Fetch those with TCP_REPAIR_OPTIONS and store in migration
 	 * data. These hardcoded values just happen to be good enough.
-- 
@@ -1011,10 +1011,17 @@ int tcp_flow_repair_connect(struct ctx *c, struct tcp_tap_conn *conn)
 {
 	struct flowside *tgt = &conn->f.side[TGTSIDE];
 	struct tcp_repair_opt opts[2];
+	int rc;
 
-	tcp_flow_repair_seq(c, conn, true);
+	rc = tcp_flow_repair_seq(c, conn, true);
+	if (rc)
+		return rc;
 
-	flowside_connect(c, conn->sock, PIF_HOST, tgt);
+	rc = flowside_connect(c, conn->sock, PIF_HOST, tgt);
+	if (rc) {
+		err("Failed to connect repaired socket: %s", strerror_(errno));
+		return rc;
+	}
 
 	/* FIXME: Fetch those with TCP_REPAIR_OPTIONS and store in migration
 	 * data. These hardcoded values just happen to be good enough.
-- 
2.48.1


  parent reply	other threads:[~2025-02-04  5:42 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-02-04  5:42 [PATCH v2 0/3] Further migration fixes David Gibson
2025-02-04  5:42 ` [PATCH v2 1/3] migrate: Fix several errors with passt-repair David Gibson
2025-02-04  8:36   ` Stefano Brivio
2025-02-04  5:42 ` David Gibson [this message]
2025-02-04  5:42 ` [PATCH v2 3/3] tcp: Simplify handling of getsockname() David Gibson
2025-02-04  7:50   ` Stefano Brivio
2025-02-04  8:36   ` Stefano Brivio

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=20250204054215.644811-3-david@gibson.dropbear.id.au \
    --to=david@gibson.dropbear.id.au \
    --cc=passt-dev@passt.top \
    --cc=sbrivio@redhat.com \
    /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
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://passt.top/passt

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 IMAP folder(s).