Hi, v1 cover letter: https://lists.nongnu.org/archive/html/qemu-block/2021-07/msg00705.html
v2 cover letter: https://lists.nongnu.org/archive/html/qemu-block/2021-07/msg00747.html v3 cover letter: https://lists.nongnu.org/archive/html/qemu-block/2021-08/msg00127.html Changes in v4: - Patch 1: Swap the order of aio_context_acquire() and job_unref() to save ourselves from using a local variable here (i.e. do it the same way as job_txn_apply()) - Patch 5: - Do not add a @force parameter to job_cancel_sync_all(): All callers want to force-cancel all jobs when they use this function, because what else would you want to do when you want to “cancel all jobs”. So we don’t need a @force parameter here, and can unconditionally invoke job_cancel_sync() with force=true. - Let the replication block driver force-cancel its backup job (because it doesn’t make a difference, but it’s cleaner to force-cancel jobs that don’t support any other cancellation method). git-backport-diff against v3: 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/12:[0003] [FC] 'job: Context changes in job_completed_txn_abort()' 002/12:[----] [--] 'mirror: Keep s->synced on error' 003/12:[----] [--] 'mirror: Drop s->synced' 004/12:[----] [--] 'job: Force-cancel jobs in a failed transaction' 005/12:[0022] [FC] 'job: @force parameter for job_cancel_sync()' 006/12:[----] [--] 'jobs: Give Job.force_cancel more meaning' 007/12:[----] [--] 'job: Add job_cancel_requested()' 008/12:[----] [--] 'mirror: Use job_is_cancelled()' 009/12:[----] [--] 'mirror: Check job_is_cancelled() earlier' 010/12:[----] [--] 'mirror: Stop active mirroring after force-cancel' 011/12:[----] [--] 'mirror: Do not clear .cancelled' 012/12:[----] [--] 'iotests: Add mirror-ready-cancel-error test' Hanna Reitz (12): job: Context changes in job_completed_txn_abort() mirror: Keep s->synced on error mirror: Drop s->synced job: Force-cancel jobs in a failed transaction job: @force parameter for job_cancel_sync() jobs: Give Job.force_cancel more meaning job: Add job_cancel_requested() mirror: Use job_is_cancelled() mirror: Check job_is_cancelled() earlier mirror: Stop active mirroring after force-cancel mirror: Do not clear .cancelled iotests: Add mirror-ready-cancel-error test include/qemu/job.h | 29 +++- block/backup.c | 3 +- block/mirror.c | 56 ++++--- block/replication.c | 4 +- blockdev.c | 4 +- job.c | 64 ++++++-- 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 +- 11 files changed, 286 insertions(+), 86 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
