summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--util/qemu-option.c12
1 files changed, 4 insertions, 8 deletions
diff --git a/util/qemu-option.c b/util/qemu-option.c
index 412c425518..2715f27e41 100644
--- a/util/qemu-option.c
+++ b/util/qemu-option.c
@@ -706,16 +706,12 @@ QemuOpts *qemu_opts_find(QemuOptsList *list, const char *id)
QemuOpts *opts;
QTAILQ_FOREACH(opts, &list->head, next) {
- if (!opts->id) {
- if (!id) {
- return opts;
- }
- continue;
+ if (!opts->id && !id) {
+ return opts;
}
- if (strcmp(opts->id, id) != 0) {
- continue;
+ if (opts->id && id && !strcmp(opts->id, id)) {
+ return opts;
}
- return opts;
}
return NULL;
}