mirror of
https://gitlab.com/qemu-project/qemu
synced 2024-11-05 20:35:44 +00:00
qemu-option: Make qemu_opts_foreach() accumulate return values
Return the bitwise inclusive or of all return values instead of the last call's value. This lets you find out whether any of the calls returned a non-zero value. No functional change, as existing users either don't care for the value, or pass non-zero abort_on_failure, which breaks the loop on the first non-zero return value. Signed-off-by: Markus Armbruster <armbru@redhat.com> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
This commit is contained in:
parent
f34e568853
commit
4a2594ddd3
1 changed files with 1 additions and 1 deletions
|
@ -814,7 +814,7 @@ int qemu_opts_foreach(QemuOptsList *list, qemu_opts_loopfunc func, void *opaque,
|
|||
int rc = 0;
|
||||
|
||||
QTAILQ_FOREACH(opts, &list->head, next) {
|
||||
rc = func(opts, opaque);
|
||||
rc |= func(opts, opaque);
|
||||
if (abort_on_failure && rc != 0)
|
||||
break;
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue