From mboxrd@z Thu Jan 1 00:00:00 1970 Received: by passt.top (Postfix, from userid 1000) id 29B245A061B; Fri, 07 Feb 2025 02:07:25 +0100 (CET) From: Stefano Brivio To: passt-dev@passt.top Subject: [PATCH v11 6/9] migrate: Hack for late migration fixups Date: Fri, 7 Feb 2025 02:07:21 +0100 Message-ID: <20250207010724.3121569-7-sbrivio@redhat.com> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20250207010724.3121569-1-sbrivio@redhat.com> References: <20250207010724.3121569-1-sbrivio@redhat.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Message-ID-Hash: 3HWJSPTIBR3QELOBLVN7G6L3O52KQQRT X-Message-ID-Hash: 3HWJSPTIBR3QELOBLVN7G6L3O52KQQRT 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 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 f93cff4..9deee7a 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 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 9870a4f..8ce22db 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