qemu-option: Drop dead assertion
PATCH 1/1 qemu-option: Drop dead assertion
Commit c6ecec43b2 "qemu-option: Check return value instead of @err where convenient" simplified
opts = qemu_opts_create(list, qdict_get_try_str(qdict, "id"), 1,
&local_err);
if (local_err) {
error_propagate(errp, local_err);
return NULL;
}to
opts = qemu_opts_create(list, qdict_get_try_str(qdict, "id"), 1, errp);
if (!opts) {
return NULL;
}but neglected to delete
assert(opts != NULL);
Do that now.
--- util/qemu-option.c | 2 -- 1 file changed, 2 deletions(-)
util/qemu-option.c +0 -2
@@ -1028,8 +1028,6 @@ QemuOpts *qemu_opts_from_qdict(QemuOptsList *list, const QDict *qdict,return NULL ; } -assert (opts !=NULL ); -for (entry =qdict_first (qdict); entry; entry =qdict_next (qdict, entry)) {
Signature · 1 line
2.31.1
Quoted 34 lines · Markus Armbruster
Commit
c6ecec43b2"qemu-option: Check return value instead of @err where convenient" simplifiedopts = qemu_opts_create(list, qdict_get_try_str(qdict, "id"), 1, &local_err); if (local_err) { error_propagate(errp, local_err); return NULL; }to
opts = qemu_opts_create(list, qdict_get_try_str(qdict, "id"), 1, errp); if (!opts) { return NULL; }but neglected to delete
assert(opts != NULL);Do that now.
Signed-off-by Markus Armbruster <[email protected]>--- util/qemu-option.c | 2 -- 1 file changed, 2 deletions(-)util/qemu-option.c +0
-0
util/qemu-option.c QemuOpts *qemu_opts_from_qdict(QemuOptsList *list, const QDict *qdict, · line 1033
Quoted 8 lines
util/qemu-option.c +0
-2@@ -1028,8 +1028,6 @@ QemuOpts *qemu_opts_from_qdict(QemuOptsList *list, const QDict *qdict,return NULL ; } -assert (opts !=NULL ); -for (entry =qdict_first (qdict); entry; entry =qdict_next (qdict, entry)) {
Laurent Vivier
AppliedLe 10/06/2021 à 11:29, Thomas Huth a écrit :
Quoted 29 lines · Markus Armbruster
Quoted 28 lines
Commit
c6ecec43b2"qemu-option: Check return value instead of @err where convenient" simplifiedopts =
qemu_opts_create(list, qdict_get_try_str(qdict, "id"), 1, &local_err);
if (local_err) {
error_propagate(errp, local_err);
return NULL;
}to
opts =
qemu_opts_create(list, qdict_get_try_str(qdict, "id"), 1, errp); if (!opts) {
return NULL;
}but neglected to delete
assert(opts != NULL);
Do that now.
Signed-off-by Markus Armbruster <[email protected]>---
util/qemu-option.c| 2 --1 file changed, 2 deletions(-)
Quoted 17 lines
util/qemu-option.c QemuOpts *qemu_opts_from_qdict(QemuOptsList *list, const QDict *qdict, · line 1033
Quoted 13 lines
util/qemu-option.c +0
-1@@ -1028,8 +1028,6 @@ QemuOpts *qemu_opts_from_qdict(QemuOptsList *list, const QDict *qdict, return NULL; } - assert(opts != NULL); - for (entry = qdict_first(qdict); entry; entry = qdict_next(qdict, entry)) {Reviewed-by Thomas Huth <[email protected]>
Applied to my trivial-patches branch.
Thanks,
Laurent