From f3fe795ff58656c39a39dbfac47fe6769f5ce293 Mon Sep 17 00:00:00 2001 From: Stefano Brivio Date: Wed, 12 Feb 2025 18:07:16 +1100 Subject: vhost_user: Make source quit after reporting migration state 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 256c8ab..7ab1377 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); + } } -- cgit v1.2.3