[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PULL 14/36] commit: Expose on-error option in QMP
From: |
Kevin Wolf |
Subject: |
[PULL 14/36] commit: Expose on-error option in QMP |
Date: |
Tue, 18 Feb 2020 15:07:00 +0100 |
Now that the error handling in the common block job is fixed, we can
expose the on-error option in QMP instead of hard-coding it as 'report'
in qmp_block_commit().
This fulfills the promise that the old comment in that function made,
even if a bit later than expected: "This will be part of the QMP
command, if/when the BlockdevOnError change for blkmirror makes it in".
Signed-off-by: Kevin Wolf <address@hidden>
Message-Id: <address@hidden>
Reviewed-by: Ján Tomko <address@hidden>
Signed-off-by: Kevin Wolf <address@hidden>
---
qapi/block-core.json | 4 ++++
blockdev.c | 8 ++++----
2 files changed, 8 insertions(+), 4 deletions(-)
diff --git a/qapi/block-core.json b/qapi/block-core.json
index 1c32158d11..37d7ea7295 100644
--- a/qapi/block-core.json
+++ b/qapi/block-core.json
@@ -1658,6 +1658,9 @@
#
# @speed: the maximum speed, in bytes per second
#
+# @on-error: the action to take on an error. 'ignore' means that the request
+# should be retried. (default: report; Since: 5.0)
+#
# @filter-node-name: the node name that should be assigned to the
# filter driver that the commit job inserts into the graph
# above @top. If this option is not given, a node name is
@@ -1694,6 +1697,7 @@
'data': { '*job-id': 'str', 'device': 'str', '*base-node': 'str',
'*base': 'str', '*top-node': 'str', '*top': 'str',
'*backing-file': 'str', '*speed': 'int',
+ '*on-error': 'BlockdevOnError',
'*filter-node-name': 'str',
'*auto-finalize': 'bool', '*auto-dismiss': 'bool' } }
diff --git a/blockdev.c b/blockdev.c
index c6a727cca9..374189a426 100644
--- a/blockdev.c
+++ b/blockdev.c
@@ -3471,6 +3471,7 @@ void qmp_block_commit(bool has_job_id, const char
*job_id, const char *device,
bool has_top, const char *top,
bool has_backing_file, const char *backing_file,
bool has_speed, int64_t speed,
+ bool has_on_error, BlockdevOnError on_error,
bool has_filter_node_name, const char *filter_node_name,
bool has_auto_finalize, bool auto_finalize,
bool has_auto_dismiss, bool auto_dismiss,
@@ -3481,15 +3482,14 @@ void qmp_block_commit(bool has_job_id, const char
*job_id, const char *device,
BlockDriverState *base_bs, *top_bs;
AioContext *aio_context;
Error *local_err = NULL;
- /* This will be part of the QMP command, if/when the
- * BlockdevOnError change for blkmirror makes it in
- */
- BlockdevOnError on_error = BLOCKDEV_ON_ERROR_REPORT;
int job_flags = JOB_DEFAULT;
if (!has_speed) {
speed = 0;
}
+ if (!has_on_error) {
+ on_error = BLOCKDEV_ON_ERROR_REPORT;
+ }
if (!has_filter_node_name) {
filter_node_name = NULL;
}
--
2.20.1
- [PULL 02/36] mirror: Don't let an operation wait for itself, (continued)
- [PULL 02/36] mirror: Don't let an operation wait for itself, Kevin Wolf, 2020/02/18
- [PULL 05/36] qcow2: update_refcount(): Reset old_table_index after qcow2_cache_put(), Kevin Wolf, 2020/02/18
- [PULL 06/36] qcow2: Fix qcow2_alloc_cluster_abort() for external data file, Kevin Wolf, 2020/02/18
- [PULL 03/36] qcow2: Fix alignment checks in encrypted images, Kevin Wolf, 2020/02/18
- [PULL 01/36] mirror: Store MirrorOp.co for debuggability, Kevin Wolf, 2020/02/18
- [PULL 08/36] block/qcow2-bitmap: Remove unneeded variable assignment, Kevin Wolf, 2020/02/18
- [PULL 07/36] iotests: Test copy offloading with external data file, Kevin Wolf, 2020/02/18
- [PULL 09/36] qapi: Document meaning of 'ignore' BlockdevOnError for jobs, Kevin Wolf, 2020/02/18
- [PULL 12/36] commit: Inline commit_populate(), Kevin Wolf, 2020/02/18
- [PULL 11/36] commit: Fix argument order for block_job_error_action(), Kevin Wolf, 2020/02/18
- [PULL 14/36] commit: Expose on-error option in QMP,
Kevin Wolf <=
- [PULL 10/36] commit: Remove unused bytes_written, Kevin Wolf, 2020/02/18
- [PULL 16/36] block: Remove superfluous semicolons, Kevin Wolf, 2020/02/18
- [PULL 17/36] block/io_uring: Remove superfluous semicolon, Kevin Wolf, 2020/02/18
- [PULL 13/36] commit: Fix is_read for block_job_error_action(), Kevin Wolf, 2020/02/18
- [PULL 19/36] blockdev: Allow resizing everywhere, Kevin Wolf, 2020/02/18
- [PULL 18/36] blockdev: Allow external snapshots everywhere, Kevin Wolf, 2020/02/18
- [PULL 21/36] iotests: Let 041 use -blockdev for quorum children, Kevin Wolf, 2020/02/18
- [PULL 15/36] iotests: Test error handling policies with block-commit, Kevin Wolf, 2020/02/18
- [PULL 22/36] quorum: Fix child permissions, Kevin Wolf, 2020/02/18
- [PULL 23/36] block: Add bdrv_recurse_can_replace(), Kevin Wolf, 2020/02/18