On Fri, Jan 31, 2025 at 06:37:09AM +0100, Stefano Brivio wrote:On Thu, 30 Jan 2025 19:33:30 +1100 David Gibson <david(a)gibson.dropbear.id.au> wrote:Oops, yes. I've fixed it in my local version, in case I need to rebase before you've folded it all in. -- David Gibson (he or they) | I'll have my music baroque, and my code david AT gibson.dropbear.id.au | minimalist, thank you, not the other way | around. http://www.ozlabs.org/~dgibson--- 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().