[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[RFC 04/15] qapi: block-job-change: make copy-mode parameter optional
From: |
Vladimir Sementsov-Ogievskiy |
Subject: |
[RFC 04/15] qapi: block-job-change: make copy-mode parameter optional |
Date: |
Wed, 13 Mar 2024 18:08:56 +0300 |
We are going to add more parameters to change. We want to make possible
to change only one or any subset of available options. So all the
options should be optional.
Signed-off-by: Vladimir Sementsov-Ogievskiy <vsementsov@yandex-team.ru>
---
block/mirror.c | 5 +++++
qapi/block-core.json | 2 +-
2 files changed, 6 insertions(+), 1 deletion(-)
diff --git a/block/mirror.c b/block/mirror.c
index a177502e4f..2d0cd22c06 100644
--- a/block/mirror.c
+++ b/block/mirror.c
@@ -1265,6 +1265,11 @@ static void mirror_change(BlockJob *job,
JobChangeOptions *opts,
GLOBAL_STATE_CODE();
+ if (!change_opts->has_copy_mode) {
+ /* Nothing to do */
+ return;
+ }
+
if (qatomic_read(&s->copy_mode) == change_opts->copy_mode) {
return;
}
diff --git a/qapi/block-core.json b/qapi/block-core.json
index 67dd0ef038..6041e7bd8f 100644
--- a/qapi/block-core.json
+++ b/qapi/block-core.json
@@ -3071,7 +3071,7 @@
# Since: 8.2
##
{ 'struct': 'JobChangeOptionsMirror',
- 'data': { 'copy-mode' : 'MirrorCopyMode' } }
+ 'data': { '*copy-mode' : 'MirrorCopyMode' } }
##
# @JobChangeOptions:
--
2.34.1
- [RFC 03/15] blockjob: block_job_change_locked(): check job type, (continued)
- [RFC 03/15] blockjob: block_job_change_locked(): check job type, Vladimir Sementsov-Ogievskiy, 2024/03/13
- [RFC 07/15] qapi: add job-change, Vladimir Sementsov-Ogievskiy, 2024/03/13
- [RFC 12/15] qapi: rename BlockDeviceIoStatus to IoStatus, Vladimir Sementsov-Ogievskiy, 2024/03/13
- [RFC 13/15] qapi: move IoStatus to common.json, Vladimir Sementsov-Ogievskiy, 2024/03/13
- [RFC 08/15] qapi: job-change: support speed parameter, Vladimir Sementsov-Ogievskiy, 2024/03/13
- [RFC 09/15] qapi: job-complete: introduce no-block-replace option for mirror, Vladimir Sementsov-Ogievskiy, 2024/03/13
- [RFC 02/15] qapi: rename BlockJobChangeOptions to JobChangeOptions, Vladimir Sementsov-Ogievskiy, 2024/03/13
- [RFC 06/15] blockjob: move change action implementation to job from block-job, Vladimir Sementsov-Ogievskiy, 2024/03/13
- [RFC 10/15] qapi: query-jobs: add information specific for job type, Vladimir Sementsov-Ogievskiy, 2024/03/13
- [RFC 14/15] qapi: query-job: add block-job specific information, Vladimir Sementsov-Ogievskiy, 2024/03/13
- [RFC 04/15] qapi: block-job-change: make copy-mode parameter optional,
Vladimir Sementsov-Ogievskiy <=
- [RFC 15/15] qapi/block-core: derpecate block-job- APIs, Vladimir Sementsov-Ogievskiy, 2024/03/13
- [RFC 05/15] qapi: JobChangeOptions: make type member optional and deprecated, Vladimir Sementsov-Ogievskiy, 2024/03/13
- [RFC 11/15] job-qmp: job_query_single_locked: add assertion on job ret, Vladimir Sementsov-Ogievskiy, 2024/03/13