From mboxrd@z Thu Jan 1 00:00:00 1970 Authentication-Results: passt.top; dmarc=none (p=none dis=none) header.from=gibson.dropbear.id.au Authentication-Results: passt.top; dkim=pass (2048-bit key; secure) header.d=gibson.dropbear.id.au header.i=@gibson.dropbear.id.au header.a=rsa-sha256 header.s=202502 header.b=eqZqpROE; dkim-atps=neutral Received: from mail.ozlabs.org (mail.ozlabs.org [IPv6:2404:9400:2221:ea00::3]) by passt.top (Postfix) with ESMTPS id 4B98C5A0272 for ; Thu, 06 Feb 2025 06:50:01 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gibson.dropbear.id.au; s=202502; t=1738820984; bh=hEZH/HhY2w+9rrHfdYeIAq2CJTwzfYN6WDuLEFMi2GA=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=eqZqpROEYMJ8p+2YuYqA+VOp5v1OzJoARbQbDpUpXSclANpbPWOq43oTvYuWoxKkK wwSMmLx6FGcUvgP+bVUUTpYXZCvs0c7ATBhjb/InkmPkr+L0H5ny5cja2ZqE2E2qx2 OOOJ/mGMOHsd4kBJeo9HQVQyWttX4tYtPNWHu1d8Yr6HZYkev1xfc9pSt81OesUWcl Sb2bjEXNnMpyYVdunRsSwySvGx075MmWoIhfJxmscFN/PR4IBtuWwbRuWoTXV9A9IG X5OS6Mu5jXJb9ez8GyCZymP5O1SLAK80BFub0MHXV16o1I82Ir79Jt6rnj81Z2Ztm5 tCiwVJp8zNkhg== Received: by gandalf.ozlabs.org (Postfix, from userid 1007) id 4YpR5447V6z4x1V; Thu, 6 Feb 2025 16:49:44 +1100 (AEDT) From: David Gibson To: Stefano Brivio , passt-dev@passt.top Subject: [PATCH v10 07/10] migrate: Hack for late migration fixups Date: Thu, 6 Feb 2025 16:49:48 +1100 Message-ID: <20250206054951.1041610-8-david@gibson.dropbear.id.au> X-Mailer: git-send-email 2.48.1 In-Reply-To: <20250206054951.1041610-1-david@gibson.dropbear.id.au> References: <20250206054951.1041610-1-david@gibson.dropbear.id.au> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Message-ID-Hash: A4P352JTF4ZR7RFMKNLLFFNN4RNK3ER7 X-Message-ID-Hash: A4P352JTF4ZR7RFMKNLLFFNN4RNK3ER7 X-MailFrom: dgibson@gandalf.ozlabs.org X-Mailman-Rule-Misses: dmarc-mitigation; no-senders; approved; emergency; loop; banned-address; member-moderation; nonmember-moderation; administrivia; implicit-dest; max-recipients; max-size; news-moderation; no-subject; digests; suspicious-header CC: David Gibson X-Mailman-Version: 3.3.8 Precedence: list List-Id: Development discussion and patches for passt Archived-At: Archived-At: List-Archive: List-Archive: List-Help: List-Owner: List-Post: List-Subscribe: List-Unsubscribe: Abuse the VHOST_USER_SEND_RARP command to do operations that need to happen very late on the target side migration. Nothing is in there now and with some luck we'll be able to drop this completely before merge. Signed-off-by: Stefano Brivio Signed-off-by: David Gibson Message-ID: <20250205230919.205302-5-sbrivio@redhat.com> Signed-off-by: David Gibson --- migrate.c | 11 +++++++++++ migrate.h | 1 + vhost_user.c | 3 +++ 3 files changed, 15 insertions(+) diff --git a/migrate.c b/migrate.c index f93cff4c..9deee7ad 100644 --- a/migrate.c +++ b/migrate.c @@ -267,3 +267,14 @@ void migrate_handler(struct ctx *c) c->device_state_result = rc; } + +/** + * migrate_finish() - Hack to connect() migrated sockets from "RARP" trigger + * @c: Execution context + */ +void migrate_finish(struct ctx *c) +{ + (void)c; + + /* HACK RARP: flow_migrate_target_post(c); */ +} diff --git a/migrate.h b/migrate.h index a5861120..5311f0e0 100644 --- a/migrate.h +++ b/migrate.h @@ -52,5 +52,6 @@ void migrate_init(struct ctx *c); void migrate_close(struct ctx *c); void migrate_request(struct ctx *c, int fd, bool target); void migrate_handler(struct ctx *c); +void migrate_finish(struct ctx *c); #endif /* MIGRATE_H */ diff --git a/vhost_user.c b/vhost_user.c index 9870a4f4..8ce22db7 100644 --- a/vhost_user.c +++ b/vhost_user.c @@ -995,6 +995,9 @@ static bool vu_send_rarp_exec(struct vu_dev *vdev, eth_ntop((unsigned char *)&msg->payload.u64, macstr, sizeof(macstr))); + /* Abuse this as trigger to finally connect() migrated sockets */ + migrate_finish(vdev->context); + return false; } -- 2.48.1