Received: from eggs.gnu.org ([208.118.235.92]:57117) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1UIeHh-0008IU-Ji for qemu-devel@nongnu.org; Thu, 21 Mar 2013 08:07:59 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1UIeHc-0006qp-00 for qemu-devel@nongnu.org; Thu, 21 Mar 2013 08:07:53 -0400 Received: from [2a02:248:0:30:223:aeff:fefe:7f1c] (port=51945 helo=dns.kamp-intra.net) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1UIeHb-0006qF-IT for qemu-devel@nongnu.org; Thu, 21 Mar 2013 08:07:47 -0400 From: Peter Lieven Date: Thu, 21 Mar 2013 13:07:11 +0100 Message-Id: <1363867631-5859-2-git-send-email-pl@kamp.de> In-Reply-To: <1363867631-5859-1-git-send-email-pl@kamp.de> References: <1363867631-5859-1-git-send-email-pl@kamp.de> Subject: [Qemu-devel] [PATCH 2/2] vl.c: throw an error if iscsi is not supported List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: qemu-devel@nongnu.org Cc: Peter Lieven 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 --- 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