summaryrefslogtreecommitdiff
path: root/qemu-option.c
diff options
context:
space:
mode:
authorMarkus Armbruster <armbru@redhat.com>2010-01-29 19:48:56 +0100
committerAnthony Liguori <aliguori@us.ibm.com>2010-02-03 12:39:01 -0600
commit4a2594ddd35de7ae7c8cd9c6828cfe72245e6dc5 (patch)
tree864775d3bbcdf7a8bc4d472146649974f2f3491e /qemu-option.c
parentf34e5688536839d9f43da36beb9f330d802ece09 (diff)
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>
Diffstat (limited to 'qemu-option.c')
-rw-r--r--qemu-option.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/qemu-option.c b/qemu-option.c
index 24392fcb4c..a52a4c4a08 100644
--- a/qemu-option.c
+++ b/qemu-option.c
@@ -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;
}