[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-block] [PULL 09/12] blockjob: fix user pause in block_job_error_ac
From: |
Kevin Wolf |
Subject: |
[Qemu-block] [PULL 09/12] blockjob: fix user pause in block_job_error_action |
Date: |
Tue, 19 Mar 2019 16:46:17 +0100 |
From: Vladimir Sementsov-Ogievskiy <address@hidden>
Job (especially mirror) may call block_job_error_action several
times before actual pause if it has several in-flight requests.
block_job_error_action will call job_pause more than once in this case,
which lead to following block-job-resume qmp command can't actually
resume the job.
Fix it by do not increase pause level in block_job_error_action if
user_paused already set.
Signed-off-by: Vladimir Sementsov-Ogievskiy <address@hidden>
Signed-off-by: Kevin Wolf <address@hidden>
---
blockjob.c | 8 +++++---
1 file changed, 5 insertions(+), 3 deletions(-)
diff --git a/blockjob.c b/blockjob.c
index 58de8cb024..730101d282 100644
--- a/blockjob.c
+++ b/blockjob.c
@@ -501,9 +501,11 @@ BlockErrorAction block_job_error_action(BlockJob *job,
BlockdevOnError on_err,
action);
}
if (action == BLOCK_ERROR_ACTION_STOP) {
- job_pause(&job->job);
- /* make the pause user visible, which will be resumed from QMP. */
- job->job.user_paused = true;
+ if (!job->job.user_paused) {
+ job_pause(&job->job);
+ /* make the pause user visible, which will be resumed from QMP. */
+ job->job.user_paused = true;
+ }
block_job_iostatus_set_err(job, error);
}
return action;
--
2.20.1
- [Qemu-block] [PULL 00/12] Block layer patches, Kevin Wolf, 2019/03/19
- [Qemu-block] [PULL 03/12] qapi: fix block-latency-histogram-set description and examples, Kevin Wolf, 2019/03/19
- [Qemu-block] [PULL 01/12] mirror: Confirm we're quiesced only if the job is paused or cancelled, Kevin Wolf, 2019/03/19
- [Qemu-block] [PULL 06/12] iotests: 153: Wait for an answer to QMP commands, Kevin Wolf, 2019/03/19
- [Qemu-block] [PULL 05/12] block: Silence Coverity in bdrv_drop_intermediate(), Kevin Wolf, 2019/03/19
- [Qemu-block] [PULL 07/12] vl: Fix to create migration object before block backends again, Kevin Wolf, 2019/03/19
- [Qemu-block] [PULL 02/12] qcow2: Fix data file error condition in qcow2_co_create(), Kevin Wolf, 2019/03/19
- [Qemu-block] [PULL 04/12] vmdk: Support version=3 in VMDK descriptor files, Kevin Wolf, 2019/03/19
- [Qemu-block] [PULL 09/12] blockjob: fix user pause in block_job_error_action,
Kevin Wolf <=
- [Qemu-block] [PULL 08/12] qemu-iotests: Fix 232 for non-qcow2, Kevin Wolf, 2019/03/19
- [Qemu-block] [PULL 12/12] qemu-iotests: Treat custom TEST_DIR in 051, Kevin Wolf, 2019/03/19
- [Qemu-block] [PULL 10/12] block: Make bdrv_{copy_on_read, crypto_luks, replication} static, Kevin Wolf, 2019/03/19
- [Qemu-block] [PULL 11/12] blockdev: Check @replaces in blockdev_mirror_common, Kevin Wolf, 2019/03/19
- Re: [Qemu-block] [PULL 00/12] Block layer patches, Peter Maydell, 2019/03/19