On 16.04.21 09:05, Max Reitz wrote:
On 15.04.21 20:46, Vladimir Sementsov-Ogievskiy wrote:
[...]
Note, that if cancelling all in-flight requests on target is wrong on
mirror cancel, we still don't have real bug, as the only
implementation of .bdrv_cancel_in_flight is stopping reconnect waiting
in nbd driver. So, we'll cancel requests only if connection is already
lost anyway.
But that probably means, that correct name of the handler would be
.bdrv_cancel_in_fligth_requests_that_will_most_probably_fail_anyway()..
It’s documentation states that it should cancel all in-flight requests,
so it’s more likely it just isn’t implemented where it could be.
Oh, I now see you added it in the same series. Well, then I suppose
you’re free to change the semantics as you see fit.
But be aware that even cancelling those requests means that you abandon
the target. So it must then fail instead of emitting the COMPLETED
event (AFAIR the mirror job emits COMPLETED when cancelled in READY with
force=false).
If the user wants the mirror job to create a consistent copy and so
cancels it after READY (with force=false), I don’t know whether
cancelling those hanging requests is what we want. If the cancel hangs
and the user sees this, they are still free to decide to cancel again
with force=true, no?
Max