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 <sbrivio(a)redhat.com> Message-ID: <20250209222005.1640077-5-sbrivio(a)redhat.com> Signed-off-by: David Gibson <david(a)gibson.dropbear.id.au> Message-ID: <20250211012034.1898337-8-sbrivio(a)redhat.com> --- 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); + } } -- 2.43.0