[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[RFC 11/15] job-qmp: job_query_single_locked: add assertion on job ret
From: |
Vladimir Sementsov-Ogievskiy |
Subject: |
[RFC 11/15] job-qmp: job_query_single_locked: add assertion on job ret |
Date: |
Wed, 13 Mar 2024 18:09:03 +0300 |
job->ret must be always set together with job->err. Let's assert this.
Reproting no-error to the user, when job->err is unset and job->ret is
somehow set would be a bug.
Signed-off-by: Vladimir Sementsov-Ogievskiy <vsementsov@yandex-team.ru>
---
job-qmp.c | 1 +
1 file changed, 1 insertion(+)
diff --git a/job-qmp.c b/job-qmp.c
index 9643c5424d..3e2172c26a 100644
--- a/job-qmp.c
+++ b/job-qmp.c
@@ -163,6 +163,7 @@ static JobInfo *job_query_single_locked(Job *job, Error
**errp)
uint64_t progress_total;
assert(!job_is_internal(job));
+ assert(!job->err == !job->ret);
progress_get_snapshot(&job->progress, &progress_current,
&progress_total);
--
2.34.1
- [RFC 13/15] qapi: move IoStatus to common.json, (continued)
- [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, 2024/03/13
- [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 <=