aboutgitcodebugslistschat
diff options
context:
space:
mode:
authorStefano Brivio <sbrivio@redhat.com>2025-02-12 18:07:16 +1100
committerStefano Brivio <sbrivio@redhat.com>2025-02-12 19:47:51 +0100
commitf3fe795ff58656c39a39dbfac47fe6769f5ce293 (patch)
tree9dec4b35c64350c6ac205dd20eabd241814dcc2e
parentb899141ad52fb417fe608d9c8cfe66f9572207c7 (diff)
downloadpasst-f3fe795ff58656c39a39dbfac47fe6769f5ce293.tar
passt-f3fe795ff58656c39a39dbfac47fe6769f5ce293.tar.gz
passt-f3fe795ff58656c39a39dbfac47fe6769f5ce293.tar.bz2
passt-f3fe795ff58656c39a39dbfac47fe6769f5ce293.tar.lz
passt-f3fe795ff58656c39a39dbfac47fe6769f5ce293.tar.xz
passt-f3fe795ff58656c39a39dbfac47fe6769f5ce293.tar.zst
passt-f3fe795ff58656c39a39dbfac47fe6769f5ce293.zip
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 <sbrivio@redhat.com>
-rw-r--r--vhost_user.c7
1 files changed, 7 insertions, 0 deletions
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);
+ }
}