qemu-devel
[Top][All Lists]
Advanced

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

[Qemu-devel] [PATCH 2/2] vl.c: throw an error if iscsi is not supported


From: Peter Lieven
Subject: [Qemu-devel] [PATCH 2/2] vl.c: throw an error if iscsi is not supported
Date: Thu, 21 Mar 2013 13:07:11 +0100

this patch adds a check for qemu_find_opts("iscsi") returning
NULL instead of blindly passing the result to qemu_opts_parse().

Signed-off-by: Peter Lieven <address@hidden>
---
 vl.c |    9 ++++++---
 1 file changed, 6 insertions(+), 3 deletions(-)

diff --git a/vl.c b/vl.c
index 315d43d..69babbf 100644
--- a/vl.c
+++ b/vl.c
@@ -3224,14 +3224,17 @@ int main(int argc, char **argv, char **envp)
                     exit(1);
                 }
                 break;
-#ifdef CONFIG_LIBISCSI
             case QEMU_OPTION_iscsi:
-                opts = qemu_opts_parse(qemu_find_opts("iscsi"), optarg, 0);
+                olist = qemu_find_opts("iscsi");
+                if (!olist) {
+                    fprintf(stderr, "iscsi is not supported by this qemu 
build.\n");
+                    exit(1);
+                }
+                opts = qemu_opts_parse(olist, optarg, 0);
                 if (!opts) {
                     exit(1);
                 }
                 break;
-#endif
 #ifdef CONFIG_SLIRP
             case QEMU_OPTION_tftp:
                 legacy_tftp_prefix = optarg;
-- 
1.7.9.5




reply via email to

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