Skip to content
  • Fabiano Rosas's avatar
    ee8a7c9c
    migration/multifd: Unify multifd_send_thread error paths · ee8a7c9c
    Fabiano Rosas authored
    
    
    The preferred usage of the Error type is to always set both the return
    code and the error when a failure happens. As all code called from the
    send thread follows this pattern, we'll always have the return code
    and the error set at the same time.
    
    Aside from the convention, in this piece of code this must be the
    case, otherwise the if (ret != 0) would be exiting the thread without
    calling multifd_send_terminate_threads() which is incorrect.
    
    Unify both paths to make it clear that both are taken when there's an
    error.
    
    Signed-off-by: default avatarFabiano Rosas <farosas@suse.de>
    Reviewed-by: default avatarJuan Quintela <quintela@redhat.com>
    Signed-off-by: default avatarJuan Quintela <quintela@redhat.com>
    Message-ID: <20231012134343.23757-3-farosas@suse.de>
    ee8a7c9c
    migration/multifd: Unify multifd_send_thread error paths
    Fabiano Rosas authored
    
    
    The preferred usage of the Error type is to always set both the return
    code and the error when a failure happens. As all code called from the
    send thread follows this pattern, we'll always have the return code
    and the error set at the same time.
    
    Aside from the convention, in this piece of code this must be the
    case, otherwise the if (ret != 0) would be exiting the thread without
    calling multifd_send_terminate_threads() which is incorrect.
    
    Unify both paths to make it clear that both are taken when there's an
    error.
    
    Signed-off-by: default avatarFabiano Rosas <farosas@suse.de>
    Reviewed-by: default avatarJuan Quintela <quintela@redhat.com>
    Signed-off-by: default avatarJuan Quintela <quintela@redhat.com>
    Message-ID: <20231012134343.23757-3-farosas@suse.de>
Loading