[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-block] [PATCH v2 3/6] commit: Fix use of error handling policy
From: |
Kevin Wolf |
Subject: |
[Qemu-block] [PATCH v2 3/6] commit: Fix use of error handling policy |
Date: |
Thu, 30 Jun 2016 16:13:24 +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.
Signed-off-by: Kevin Wolf <address@hidden>
---
block/commit.c | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)
diff --git a/block/commit.c b/block/commit.c
index 379efb7..cb6810d 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] [PATCH v2 0/6] block: Move BB options from blockdev-add to qdev, Kevin Wolf, 2016/06/30
- [Qemu-block] [PATCH v2 1/6] block/qdev: Allow node name for drive properties, Kevin Wolf, 2016/06/30
- [Qemu-block] [PATCH v2 4/6] block/qdev: Allow configuring rerror/werror with qdev properties, Kevin Wolf, 2016/06/30
- [Qemu-block] [PATCH v2 3/6] commit: Fix use of error handling policy,
Kevin Wolf <=
- [Qemu-block] [PATCH v2 2/6] block/qdev: Allow configuring WCE with qdev properties, Kevin Wolf, 2016/06/30
- [Qemu-block] [PATCH v2 6/6] block: Remove BB options from blockdev-add, Kevin Wolf, 2016/06/30
- [Qemu-block] [PATCH v2 5/6] qemu-iotests: Test setting WCE with qdev, Kevin Wolf, 2016/06/30