On Tue, Feb 27, 2024 at 11:00:44AM -0300, Fabiano Rosas wrote: > I don't really like the interleaving of file and socket logic at > multifd_recv_sync_main(), but I can live with it.
The idea was to share the "wait" part and the semaphore. If you don't like the form of it, an alternative is we can provide three helpers (file_kick, wait, socket_kick), then: if (file) { file_kick(); wait(); } else { wait(); socket_kick(); } > > Waiting on multifd_recv_state->sem_sync is problematic because if the > thread has an error, that will hang forever. > > Actually, I don't even see this being handled in _current_ code > anywhere, we probably have a bug there. I guess we need to add one more > "post this sem just because" somewhere. multifd_recv_kick_main probably. Might because dest qemu is even less of a concern? As if something wrong on dest, then src is probably already failing the migration, then libvirt or upper layer can directly kill dest qemu (while we can't do that to src). But yeah we should still fix it at some point.. to make dest qemu quit gracefully in error cases, and it'll also help more in the future if multifd will support postcopy, then both src/dst can't be killed. -- Peter Xu