On Fri, Oct 24, 2025 at 04:08:39PM +0200, Markus Armbruster wrote:
> Markus Armbruster <[email protected]> writes:
> 
> > Daniel P. Berrangé <[email protected]> writes:
> 
> [...]
> 
> >> But wow, the migrate_add_blocker API design is unpleasant with its
> >> pair of "Error **" parameters - it is practically designed to
> >> maximise confusion & surprise.
> >
> > It's quite a sight, isn't it?
> >
> > I'll give it a quick Friday afternoon try.
> 
> Alright, my confusion has been maximised.  Giving up on this.

Besides the use of two Error** that might be confusing, what is more
confusing (if not wrong..): migrate_add_blocker() will take ownership of
the 1st Error**, no matter whether the helper succeeded or not. However, it
only resets the first Error** if failed.

I think it means if migrate_add_blocker() succeeded, the caller will have a
non-NULL pointer, even if it has lost the ownership of that pointer.

I'm guessing it never caused issue only because we don't usually
error_free() the migration blocker anywhere.. but I think maybe we should
at least do an error_copy() in add_blockers()..

-- 
Peter Xu


Reply via email to