From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1NDMyn-0007Rz-62 for qemu-devel@nongnu.org; Wed, 25 Nov 2009 13:52:41 -0500 Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1NDMya-0007JQ-R5 for qemu-devel@nongnu.org; Wed, 25 Nov 2009 13:52:34 -0500 Received: from [199.232.76.173] (port=49014 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1NDMyZ-0007Iw-TQ for qemu-devel@nongnu.org; Wed, 25 Nov 2009 13:52:28 -0500 Received: from mx1.redhat.com ([209.132.183.28]:16144) by monty-python.gnu.org with esmtp (Exim 4.60) (envelope-from ) id 1NDMyZ-0000FO-BY for qemu-devel@nongnu.org; Wed, 25 Nov 2009 13:52:27 -0500 Received: from int-mx08.intmail.prod.int.phx2.redhat.com (int-mx08.intmail.prod.int.phx2.redhat.com [10.5.11.21]) by mx1.redhat.com (8.13.8/8.13.8) with ESMTP id nAPIqQqb030558 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK) for ; Wed, 25 Nov 2009 13:52:26 -0500 From: Mark McLoughlin Date: Wed, 25 Nov 2009 18:49:33 +0000 Message-Id: <1259174977-26212-41-git-send-email-markmc@redhat.com> In-Reply-To: <1259174977-26212-1-git-send-email-markmc@redhat.com> References: <1259174977-26212-1-git-send-email-markmc@redhat.com> Subject: [Qemu-devel] [PATCH 40/44] net: print correct error for '-netdev ""' List-Id: qemu-devel.nongnu.org List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: qemu-devel@nongnu.org Cc: Mark McLoughlin Reported-by: Markus Armbruster Signed-off-by: Mark McLoughlin --- net.c | 16 +++++++++++----- 1 files changed, 11 insertions(+), 5 deletions(-) diff --git a/net.c b/net.c index c71699d..13bdbb2 100644 --- a/net.c +++ b/net.c @@ -1055,12 +1055,18 @@ int net_client_init(Monitor *mon, QemuOpts *opts, int is_netdev) int i; type = qemu_opt_get(opts, "type"); - if (!type) { - qemu_error("No type specified for -net\n"); - return -1; - } - if (is_netdev) { + if (!is_netdev) { + if (!type) { + qemu_error("No type specified for -net\n"); + return -1; + } + } else { + if (!type) { + qemu_error("No type specified for -netdev\n"); + return -1; + } + if (strcmp(type, "tap") != 0 && #ifdef CONFIG_SLIRP strcmp(type, "user") != 0 && -- 1.6.5.2