From mboxrd@z Thu Jan 1 00:00:00 1970 Received: by passt.top (Postfix, from userid 1000) id A69C55A0622; Thu, 06 Feb 2025 00:03:14 +0100 (CET) From: Stefano Brivio To: passt-dev@passt.top Subject: [PATCH v8 4/6] migrate: Hack for late migration fixups Date: Thu, 6 Feb 2025 00:03:12 +0100 Message-ID: <20250205230314.203396-5-sbrivio@redhat.com> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20250205230314.203396-1-sbrivio@redhat.com> References: <20250205230314.203396-1-sbrivio@redhat.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Message-ID-Hash: Y42HYWNM6HPTDNQ6PZRFRJWEX362LCGU X-Message-ID-Hash: Y42HYWNM6HPTDNQ6PZRFRJWEX362LCGU X-MailFrom: sbrivio@passt.top 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: From: David Gibson 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 --- migrate.c | 11 +++++++++++ migrate.h | 1 + vhost_user.c | 3 +++ 3 files changed, 15 insertions(+) diff --git a/migrate.c b/migrate.c index fa79f78..5cc0019 100644 --- a/migrate.c +++ b/migrate.c @@ -275,3 +275,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 a586112..5311f0e 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 4906e2a..1ca799d 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.43.0