From patchwork Wed Nov 25 18:49:33 2009 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Mark McLoughlin X-Patchwork-Id: 39440 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from lists.gnu.org (lists.gnu.org [199.232.76.165]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (Client did not present a certificate) by ozlabs.org (Postfix) with ESMTPS id C46071007D1 for ; Thu, 26 Nov 2009 06:44:45 +1100 (EST) Received: from localhost ([127.0.0.1]:38806 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1NDNn9-0005m9-8s for incoming@patchwork.ozlabs.org; Wed, 25 Nov 2009 14:44:43 -0500 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 Received: from blaa.localdomain (ovpn01.gateway.prod.ext.phx2.redhat.com [10.5.9.1]) by int-mx08.intmail.prod.int.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id nAPIqNOZ031167; Wed, 25 Nov 2009 13:52:25 -0500 Received: by blaa.localdomain (Postfix, from userid 500) id 5C176B0AB; Wed, 25 Nov 2009 18:49:43 +0000 (GMT) From: Mark McLoughlin To: qemu-devel@nongnu.org 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> X-Scanned-By: MIMEDefang 2.67 on 10.5.11.21 X-detected-operating-system: by monty-python.gnu.org: Genre and OS details not recognized. Cc: Mark McLoughlin Subject: [Qemu-devel] [PATCH 40/44] net: print correct error for '-netdev ""' X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: qemu-devel.nongnu.org List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Errors-To: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org 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 &&