]> git.proxmox.com Git - mirror_qemu.git/commit
migration/multifd: Unify multifd_send_thread error paths
authorFabiano Rosas <farosas@suse.de>
Thu, 12 Oct 2023 13:43:42 +0000 (10:43 -0300)
committerJuan Quintela <quintela@redhat.com>
Tue, 17 Oct 2023 07:25:14 +0000 (09:25 +0200)
commitee8a7c9c46b8f06969a975ac3fd3fd30491611a7
tree119c97ec11a974d0223a17e6228611344c0d6352
parent0e92f6444834a84aefab8f31b4f6a04c0dfed801
migration/multifd: Unify multifd_send_thread error paths

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: Fabiano Rosas <farosas@suse.de>
Reviewed-by: Juan Quintela <quintela@redhat.com>
Signed-off-by: Juan Quintela <quintela@redhat.com>
Message-ID: <20231012134343.23757-3-farosas@suse.de>
migration/multifd.c