Hi, v1 cover letter: https://lists.nongnu.org/archive/html/qemu-block/2021-07/msg00705.html
Changes in v2: - Added patch 2 (as suggested by Vladimir) - Patch 4 (ex. 3): Rebase conflicts because of patch 2 - Patch 5 (ex. 4): - Rebase conflicts because of patch 2 - Do not use job_cancel_requested() to determine how a soft-cancelled job should be completed: A soft-cancelled job should end with COMPLETED, not CANCELLED, and so job_is_cancelled() is the appropriate condition there. git-backport-diff against v1: Key: [----] : patches are identical [####] : number of functional differences between upstream/downstream patch [down] : patch is downstream-only The flags [FC] indicate (F)unctional and (C)ontextual differences, respectively 001/7:[----] [--] 'mirror: Keep s->synced on error' 002/7:[down] 'mirror: Drop s->synced' 003/7:[----] [--] 'job: @force parameter for job_cancel_sync{,_all}()' 004/7:[0006] [FC] 'jobs: Give Job.force_cancel more meaning' 005/7:[0011] [FC] 'job: Add job_cancel_requested()' 006/7:[----] [-C] 'mirror: Check job_is_cancelled() earlier' 007/7:[----] [--] 'iotests: Add mirror-ready-cancel-error test' Max Reitz (7): mirror: Keep s->synced on error mirror: Drop s->synced job: @force parameter for job_cancel_sync{,_all}() jobs: Give Job.force_cancel more meaning job: Add job_cancel_requested() mirror: Check job_is_cancelled() earlier iotests: Add mirror-ready-cancel-error test include/qemu/job.h | 29 +++- block/backup.c | 3 +- block/mirror.c | 47 +++--- block/replication.c | 4 +- blockdev.c | 4 +- job.c | 40 ++++- qemu-nbd.c | 2 +- softmmu/runstate.c | 2 +- storage-daemon/qemu-storage-daemon.c | 2 +- tests/unit/test-block-iothread.c | 2 +- tests/unit/test-blockjob.c | 2 +- tests/qemu-iotests/109.out | 60 +++----- .../tests/mirror-ready-cancel-error | 143 ++++++++++++++++++ .../tests/mirror-ready-cancel-error.out | 5 + tests/qemu-iotests/tests/qsd-jobs.out | 2 +- 15 files changed, 264 insertions(+), 83 deletions(-) create mode 100755 tests/qemu-iotests/tests/mirror-ready-cancel-error create mode 100644 tests/qemu-iotests/tests/mirror-ready-cancel-error.out -- 2.31.1