qemu-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Qemu-devel] [PATCH v2 07/14] cmdline: accept NULL opts in qemu_opt_find


From: Paolo Bonzini
Subject: [Qemu-devel] [PATCH v2 07/14] cmdline: accept NULL opts in qemu_opt_find
Date: Wed, 11 Apr 2012 23:34:34 +0200

This simplifies the code in cases where we process the options without
qemu_opts_foreach.  One example is -machine, the next patch will rely
on this.

Signed-off-by: Paolo Bonzini <address@hidden>
---
 qemu-option.c |    4 ++++
 1 files changed, 4 insertions(+), 0 deletions(-)

diff --git a/qemu-option.c b/qemu-option.c
index 55cbee8..7a89eeb 100644
--- a/qemu-option.c
+++ b/qemu-option.c
@@ -511,6 +511,10 @@ static QemuOpt *qemu_opt_find(QemuOpts *opts, const char 
*name)
 {
     QemuOpt *opt;
 
+    if (!opts) {
+        return NULL;
+    }
+
     QTAILQ_FOREACH_REVERSE(opt, &opts->head, QemuOptHead, next) {
         if (strcmp(opt->name, name) != 0)
             continue;
-- 
1.7.9.1





reply via email to

[Prev in Thread] Current Thread [Next in Thread]