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=202412 header.b=o6o4xAJc; dkim-atps=neutral Received: from mail.ozlabs.org (gandalf.ozlabs.org [150.107.74.76]) by passt.top (Postfix) with ESMTPS id 496F35A061F for ; Thu, 30 Jan 2025 09:33:35 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gibson.dropbear.id.au; s=202412; t=1738226003; bh=lUdTQLvEQ+mmQBlMM5HdGc1DyjR8PvXDLOeMVBf/jdw=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=o6o4xAJc8jfD62hNahsWCRlzULrn9ALNLWsWMKNh458+FX4wwEOXpSJjXnYgvhn05 mAimvTAfkK++o//brgN+5jo9+SLCciTfnOpgifN00asSgekwRMFNtOCC6Rat8cTyWM zn4QQ1NGET83yUksWyO5zOdE2Mg4rVA9ETlCGrG05LF+QGzaOJItmPcT3k5D30WxDi EVdRdWmjcdKBMlVYMddz/8oOItf7rwtbl3q5qBaQw9Mk1eZQv5v5Zn2KLbrSDKkxQk rhNovV7MFPvEXUlxqgorygA1cBKIkVZqdER28Ik5vLqg5xVRpiSHdbFkLfO+a4NfEU k4vt/TnIXLWcQ== Received: by gandalf.ozlabs.org (Postfix, from userid 1007) id 4YkC376yn2z4x5r; Thu, 30 Jan 2025 19:33:23 +1100 (AEDT) From: David Gibson To: passt-dev@passt.top, Stefano Brivio Subject: [PATCH 3/5] migrate: Move repair_sock_init() to vu_init() Date: Thu, 30 Jan 2025 19:33:28 +1100 Message-ID: <20250130083330.917030-4-david@gibson.dropbear.id.au> X-Mailer: git-send-email 2.48.1 In-Reply-To: <20250130083330.917030-1-david@gibson.dropbear.id.au> References: <20250130083330.917030-1-david@gibson.dropbear.id.au> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Message-ID-Hash: N6PXYIT23FEG3MNTSMGZUI3GAMTCYNYX X-Message-ID-Hash: N6PXYIT23FEG3MNTSMGZUI3GAMTCYNYX 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: Currently we call repair_sock_init() immediately before tap_sock_unix_init(). However, this means it will be skipped if the vhost-user control fd is passed with --fd instead of being created at a specific path. We still need the repair socket in that case. Move it, instead, to vu_init(), which has the added advantage of moving all migration related one-time init to the same place. Signed-off-by: David Gibson --- tap.c | 3 --- vhost_user.c | 3 +++ 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/tap.c b/tap.c index 3659aabd..d1a9f522 100644 --- a/tap.c +++ b/tap.c @@ -56,7 +56,6 @@ #include "netlink.h" #include "pasta.h" #include "packet.h" -#include "repair.h" #include "tap.h" #include "log.h" #include "vhost_user.h" @@ -1362,8 +1361,6 @@ void tap_backend_init(struct ctx *c) tap_sock_tun_init(c); break; case MODE_VU: - repair_sock_init(c); - /* fall through */ case MODE_PASST: tap_sock_unix_init(c); diff --git a/vhost_user.c b/vhost_user.c index bbbf504f..5df29c47 100644 --- a/vhost_user.c +++ b/vhost_user.c @@ -44,6 +44,7 @@ #include "tap.h" #include "vhost_user.h" #include "pcap.h" +#include "repair.h" /* vhost-user version we are compatible with */ #define VHOST_USER_VERSION 1 @@ -1106,8 +1107,10 @@ void vu_init(struct ctx *c) } c->vdev->log_table = NULL; c->vdev->log_call_fd = -1; + c->vdev->device_state_fd = -1; c->vdev->device_state_result = -1; + repair_sock_init(c); } -- 2.48.1