Skip to content

Commit 107111b

Browse files
author
Markus Armbruster
committed
qapi job: Elide redundant has_FOO in generated C
The has_FOO for pointer-valued FOO are redundant, except for arrays. They are also a nuisance to work with. Recent commit "qapi: Start to elide redundant has_FOO in generated C" provided the means to elide them step by step. This is the step for qapi/job.json. Said commit explains the transformation in more detail. The invariant violations mentioned there do not occur here. Cc: John Snow <[email protected]> Cc: Vladimir Sementsov-Ogievskiy <[email protected]> Cc: [email protected] Signed-off-by: Markus Armbruster <[email protected]> Reviewed-by: Vladimir Sementsov-Ogievskiy <[email protected]> Message-Id: <[email protected]>
1 parent d4f8bdc commit 107111b

File tree

2 files changed

+1
-3
lines changed

2 files changed

+1
-3
lines changed

job-qmp.c

+1-2
Original file line numberDiff line numberDiff line change
@@ -156,8 +156,7 @@ static JobInfo *job_query_single_locked(Job *job, Error **errp)
156156
.status = job->status,
157157
.current_progress = progress_current,
158158
.total_progress = progress_total,
159-
.has_error = !!job->err,
160-
.error = job->err ? \
159+
.error = job->err ?
161160
g_strdup(error_get_pretty(job->err)) : NULL,
162161
};
163162

scripts/qapi/schema.py

-1
Original file line numberDiff line numberDiff line change
@@ -759,7 +759,6 @@ def need_has(self):
759759
assert self.type
760760
# Temporary hack to support dropping the has_FOO in reviewable chunks
761761
opt_out = [
762-
'qapi/job.json',
763762
'qapi/machine.json',
764763
'qapi/machine-target.json',
765764
'qapi/migration.json',

0 commit comments

Comments
 (0)