From patchwork Tue Dec 4 03:53:44 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jason Wang X-Patchwork-Id: 1007420 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (mailfrom) smtp.mailfrom=nongnu.org (client-ip=2001:4830:134:3::11; helo=lists.gnu.org; envelope-from=qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org; receiver=) Authentication-Results: ozlabs.org; dmarc=fail (p=none dis=none) header.from=redhat.com Received: from lists.gnu.org (lists.gnu.org [IPv6:2001:4830:134:3::11]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 4387LV4vZ7z9s55 for ; Tue, 4 Dec 2018 14:55:30 +1100 (AEDT) Received: from localhost ([::1]:53868 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1gU1o0-0006sf-2q for incoming@patchwork.ozlabs.org; Mon, 03 Dec 2018 22:55:28 -0500 Received: from eggs.gnu.org ([2001:4830:134:3::10]:41246) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1gU1n7-0006q8-UO for qemu-devel@nongnu.org; Mon, 03 Dec 2018 22:54:38 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1gU1n4-0005fp-RZ for qemu-devel@nongnu.org; Mon, 03 Dec 2018 22:54:33 -0500 Received: from mx1.redhat.com ([209.132.183.28]:43604) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1gU1n3-0005Wv-Ss for qemu-devel@nongnu.org; Mon, 03 Dec 2018 22:54:30 -0500 Received: from smtp.corp.redhat.com (int-mx01.intmail.prod.int.phx2.redhat.com [10.5.11.11]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 67E56169751; Tue, 4 Dec 2018 03:54:16 +0000 (UTC) Received: from localhost.localdomain (ovpn-12-125.pek2.redhat.com [10.72.12.125]) by smtp.corp.redhat.com (Postfix) with ESMTP id A5CBB601A6; Tue, 4 Dec 2018 03:54:12 +0000 (UTC) From: Jason Wang To: qemu-devel@nongnu.org, peter.maydell@linaro.org Date: Tue, 4 Dec 2018 11:53:44 +0800 Message-Id: <20181204035347.6148-3-jasowang@redhat.com> In-Reply-To: <20181204035347.6148-1-jasowang@redhat.com> References: <20181204035347.6148-1-jasowang@redhat.com> X-Scanned-By: MIMEDefang 2.79 on 10.5.11.11 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.30]); Tue, 04 Dec 2018 03:54:16 +0000 (UTC) X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] [fuzzy] X-Received-From: 209.132.183.28 Subject: [Qemu-devel] [PATCH V5 for 3.1 2/5] net: hub: suppress warnings of no host network for qtest X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: thuth@redhat.com, mst@redhat.com, liq3ea@163.com, Jason Wang , liq3ea@gmail.com, ppandit@redhat.com, pbonzini@redhat.com Errors-To: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Sender: "Qemu-devel" If we want to qtest through hub, it would be much more simpler and safer to configure the hub without host network. So silent this warnings for qtest. Signed-off-by: Jason Wang Reviewed-by: Thomas Huth --- net/hub.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/net/hub.c b/net/hub.c index 78b671ed95..5795a678ed 100644 --- a/net/hub.c +++ b/net/hub.c @@ -20,6 +20,7 @@ #include "hub.h" #include "qemu/iov.h" #include "qemu/error-report.h" +#include "sysemu/qtest.h" /* * A hub broadcasts incoming packets to all its ports except the source port. @@ -346,7 +347,7 @@ void net_hub_check_clients(void) if (has_host_dev && !has_nic) { warn_report("hub %d with no nics", hub->id); } - if (has_nic && !has_host_dev) { + if (has_nic && !has_host_dev && !qtest_enabled()) { warn_report("hub %d is not connected to host network", hub->id); } }