[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-block] [PULL v2 19/34] commit: Fix use of error handling policy
From: |
Kevin Wolf |
Subject: |
[Qemu-block] [PULL v2 19/34] commit: Fix use of error handling policy |
Date: |
Wed, 13 Jul 2016 14:50:26 +0200 |
Commit implemented the 'enospc' policy as 'ignore' if the error was not
ENOSPC. The QAPI documentation promises that it's treated as 'stop'.
Using the common block job error handling function fixes this and also
adds the missing QMP event.
Signed-off-by: Kevin Wolf <address@hidden>
Reviewed-by: Max Reitz <address@hidden>
---
block/commit.c | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)
diff --git a/block/commit.c b/block/commit.c
index 8b534d7..5d11eb6 100644
--- a/block/commit.c
+++ b/block/commit.c
@@ -171,9 +171,9 @@ wait:
bytes_written += n * BDRV_SECTOR_SIZE;
}
if (ret < 0) {
- if (s->on_error == BLOCKDEV_ON_ERROR_STOP ||
- s->on_error == BLOCKDEV_ON_ERROR_REPORT||
- (s->on_error == BLOCKDEV_ON_ERROR_ENOSPC && ret == -ENOSPC)) {
+ BlockErrorAction action =
+ block_job_error_action(&s->common, false, s->on_error, -ret);
+ if (action == BLOCK_ERROR_ACTION_REPORT) {
goto out;
} else {
n = 0;
--
1.8.3.1
- [Qemu-block] [PULL v2 05/34] blockjob: Add 'job_id' parameter to block_job_create(), (continued)
- [Qemu-block] [PULL v2 05/34] blockjob: Add 'job_id' parameter to block_job_create(), Kevin Wolf, 2016/07/13
- [Qemu-block] [PULL v2 10/34] qemu-img: Set the ID of the block job in img_commit(), Kevin Wolf, 2016/07/13
- [Qemu-block] [PULL v2 09/34] commit: Add 'job-id' parameter to 'block-commit', Kevin Wolf, 2016/07/13
- [Qemu-block] [PULL v2 11/34] blockjob: Update description of the 'device' field in the QMP API, Kevin Wolf, 2016/07/13
- [Qemu-block] [PULL v2 13/34] raw-posix: Use qemu_dup, Kevin Wolf, 2016/07/13
- [Qemu-block] [PULL v2 15/34] test-coroutine: prepare for the next patch, Kevin Wolf, 2016/07/13
- [Qemu-block] [PULL v2 12/34] osdep: Introduce qemu_dup, Kevin Wolf, 2016/07/13
- [Qemu-block] [PULL v2 18/34] block/qdev: Allow configuring WCE with qdev properties, Kevin Wolf, 2016/07/13
- [Qemu-block] [PULL v2 17/34] block/qdev: Allow node name for drive properties, Kevin Wolf, 2016/07/13
- [Qemu-block] [PULL v2 19/34] commit: Fix use of error handling policy,
Kevin Wolf <=
- [Qemu-block] [PULL v2 14/34] coroutine: use QSIMPLEQ instead of QTAILQ, Kevin Wolf, 2016/07/13
- [Qemu-block] [PULL v2 22/34] block: Remove BB options from blockdev-add, Kevin Wolf, 2016/07/13
- [Qemu-block] [PULL v2 16/34] coroutine: move entry argument to qemu_coroutine_create, Kevin Wolf, 2016/07/13
- [Qemu-block] [PULL v2 24/34] qcow2: Avoid making the L1 table too big, Kevin Wolf, 2016/07/13
- [Qemu-block] [PULL v2 20/34] block/qdev: Allow configuring rerror/werror with qdev properties, Kevin Wolf, 2016/07/13
- [Qemu-block] [PULL v2 21/34] qemu-iotests: Test setting WCE with qdev, Kevin Wolf, 2016/07/13
- [Qemu-block] [PULL v2 23/34] qemu-img: Use strerror() for generic resize error, Kevin Wolf, 2016/07/13
- [Qemu-block] [PULL v2 25/34] qemu-io: Use correct range limitations, Kevin Wolf, 2016/07/13
- [Qemu-block] [PULL v2 28/34] vmdk: fix metadata write regression, Kevin Wolf, 2016/07/13
- [Qemu-block] [PULL v2 33/34] vvfat: Fix qcow write target driver specification, Kevin Wolf, 2016/07/13