Peter Xu <pet...@redhat.com> writes: > migrate_set_error() used one error_copy() so it always copy an error. > However that's not the major use case - the major use case is one would > like to pass the error to migrate_set_error() without further touching the > error. > > It can be proved if we see most of the callers are freeing the error > explicitly right afterwards. There're a few outliers (only if when the > caller) where we can use error_copy() explicitly there. > > Drop three call sites where we called migrate_set_error() then following a > error_report_err(): otherwise we need to do error_copy() for them. Since we > already have them stored in MigrationState.error, the error report can be > slightly duplicated. > > Signed-off-by: Peter Xu <pet...@redhat.com>
Reviewed-by: Fabiano Rosas <faro...@suse.de>