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=iOLiYG73; dkim-atps=neutral Received: from mail.ozlabs.org (gandalf.ozlabs.org [150.107.74.76]) by passt.top (Postfix) with ESMTPS id 0C4C45A061B for ; Wed, 12 Feb 2025 08:07:41 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gibson.dropbear.id.au; s=202502; t=1739344044; bh=LvVDQ9911dsZ+aZl6oU2F3zHYZnK7banWFosHf1k0ns=; h=From:To:Subject:Date:In-Reply-To:References:From; b=iOLiYG73WLynzxb2ete1WTMz7FjfVioXb0CfZ6jfWzDHJjFZ4iNdF0I1t8e5jkSlw meD9U38R9BPfBQ7sAm6GeAeEl/nTnhFr0yi3NivluhviGOv3x/mFHKHPNWH02Tj8zE P7daB/q535jK/jDmL4/9g4QDU6L1E3Z4Xj1YrxM5xjGIzzrX/xGS8IiCiEQq939skk oX0LDN8TFvh8mS0msgHh9onL1I8hlKwGwjlvv2g9atSzsKxp5NoIXokHyMg+KQU6eP solIOXX7KId/moMYnQq/HCgYd3wsGfAgipSBvFK4+0LvRs3Dj6k9yM+u3dYgTRMnbG B45/fN2z3PCyg== Received: by gandalf.ozlabs.org (Postfix, from userid 1007) id 4Yt8Ww3gD5z4x21; Wed, 12 Feb 2025 18:07:24 +1100 (AEDT) From: David Gibson To: passt-dev@passt.top, Stefano Brivio Subject: [PATCH v18 4/9] vhost_user: Make source quit after reporting migration state Date: Wed, 12 Feb 2025 18:07:16 +1100 Message-ID: <20250212070721.1746128-5-david@gibson.dropbear.id.au> X-Mailer: git-send-email 2.48.1 In-Reply-To: <20250212070721.1746128-1-david@gibson.dropbear.id.au> References: <20250212070721.1746128-1-david@gibson.dropbear.id.au> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Message-ID-Hash: 54O3APWUTKEETOVZQWCERLPIH5F555UO X-Message-ID-Hash: 54O3APWUTKEETOVZQWCERLPIH5F555UO 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 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: Stefano Brivio This will close all the sockets we currently have open in repair mode, and completes our migration tasks as source. If the hypervisor wants to have us back at this point, somebody needs to restart us. Signed-off-by: Stefano Brivio --- vhost_user.c | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/vhost_user.c b/vhost_user.c index 256c8ab6..7ab13774 100644 --- a/vhost_user.c +++ b/vhost_user.c @@ -1203,4 +1203,11 @@ void vu_control_handler(struct vu_dev *vdev, int fd, uint32_t events) if (reply_requested) vu_send_reply(fd, &msg); + + if (msg.hdr.request == VHOST_USER_CHECK_DEVICE_STATE && + vdev->context->device_state_result == 0 && + !vdev->context->migrate_target) { + info("Migration complete, exiting"); + _exit(EXIT_SUCCESS); + } } -- 2.48.1