On Thu, 30 Jan 2025 19:33:30 +1100 David Gibson <david(a)gibson.dropbear.id.au> wrote:--- a/migrate.c +++ b/migrate.c @@ -327,26 +327,6 @@ static int migrate_target(struct ctx *c, int fd) return rc; } -/** - * set_migration_watch() - Add the migration file descriptor to epoll - * @c: Execution context - * @fd: File descriptor to add - * @target: Are we the target of the migration? - */ -static void set_migration_watch(const struct ctx *c, int fd, bool target) -{ - union epoll_ref ref = { - .type = EPOLL_TYPE_DEVICE_STATE, - .fd = fd, - }; - struct epoll_event ev = { 0 }; - - ev.data.u64 = ref.u64; - ev.events = target ? EPOLLIN : EPOLLOUT; - - epoll_ctl(c->epollfd, EPOLL_CTL_ADD, ref.fd, &ev);This change should have dropped: epoll_del(c, c->device_state_fd); from migrate_close(). -- Stefano