]> git.proxmox.com Git - mirror_qemu.git/commit
migration/rdma: Downgrade qemu_rdma_cleanup() errors to warnings
authorMarkus Armbruster <armbru@redhat.com>
Thu, 28 Sep 2023 13:20:17 +0000 (15:20 +0200)
committerJuan Quintela <quintela@redhat.com>
Wed, 11 Oct 2023 09:17:04 +0000 (11:17 +0200)
commit5cec563d0cc4d2ce4983f31c472f022f9fd57d7a
tree4da8b1fc006c58e34c0756d7979544a203d92893
parentb765d21e4aba49dc5c87f3b05532b6b9cc64a2a5
migration/rdma: Downgrade qemu_rdma_cleanup() errors to warnings

Functions that use an Error **errp parameter to return errors should
not also report them to the user, because reporting is the caller's
job.  When the caller does, the error is reported twice.  When it
doesn't (because it recovered from the error), there is no error to
report, i.e. the report is bogus.

qemu_rdma_source_init(), qemu_rdma_connect(),
rdma_start_incoming_migration(), and rdma_start_outgoing_migration()
violate this principle: they call error_report() via
qemu_rdma_cleanup().

Moreover, qemu_rdma_cleanup() can't fail.  It is called on error
paths, and QIOChannel close and finalization.  Are the conditions it
reports really errors?  I doubt it.

Downgrade qemu_rdma_cleanup()'s errors to warnings.

Signed-off-by: Markus Armbruster <armbru@redhat.com>
Reviewed-by: Fabiano Rosas <farosas@suse.de>
Reviewed-by: Juan Quintela <quintela@redhat.com>
Signed-off-by: Juan Quintela <quintela@redhat.com>
Message-ID: <20230928132019.2544702-52-armbru@redhat.com>
migration/rdma.c