Skip to content
  • Uri Lublin's avatar
    migrate_fd_close: delete associated io-handler before closing the fd · e19252d3
    Uri Lublin authored
    
    
    It may happen that the io-handler is still registered. That causes
    select() to return with EBADF, not calling handlers for other fds.
    
    The io-handler would be registered when (on the source) the whole state
    was written but not yet flushed. For example when using QEMUFileBuffered,
    (tcp-migration) there may be data left in a buffer waiting to be transferred.
    In such a case buffered_close() calls buffered_flush() which calls
    migrate_fd_put_buffer, which may, upon EAGAIN, register migrate_fd_put_notify
    as a handler.
    
    Signed-off-by: default avatarUri Lublin <uril@redhat.com>
    Signed-off-by: default avatarAnthony Liguori <aliguori@us.ibm.com>
    e19252d3