Am 16.10.2012 08:36, schrieb Paolo Bonzini: > Il 15/10/2012 18:57, Kevin Wolf ha scritto: >> Am 26.09.2012 17:56, schrieb Paolo Bonzini: >>> + >>> + /* We're out of the streaming phase. From now on, if the job >>> + * is cancelled we will actually complete all pending I/O and >>> + * report completion. This way, block-job-cancel will leave >>> + * the target in a consistent state. >>> + */ >> >> Don't we have block_job_complete() for that now? Then I think the job >> can be cancelled immediately, even in an inconsistent state. > > The idea was that block-job-cancel will still leave the target in a > consistent state if executed during the second phase. Otherwise it is > impossible to take a consistent snapshot and keep running on the first > image.
Yes, I noticed that when reading one of the following patches. However, this behaviour didn't seem to be documented very well. IIRC, you do mention it in the QMP documentation for block-job-complete, but wouldn't it make sense to describe what cancel/complete mean in the documentation for drive-mirror as well? I'd also consider putting a comment in the code that explicitly says that we intentionally wait for a consistent state before actually cancelling. This is not the intuitive thing to do with cancel, so it confused me. Kevin