cryptospore / rpms / qemu-kvm

Forked from rpms/qemu-kvm 2 years ago
Clone

Blame SOURCES/kvm-net-hub-suppress-warnings-of-no-host-network-for-qte.patch

26ba25
From daf0de96b084099693fd56314d57747b389c7413 Mon Sep 17 00:00:00 2001
26ba25
From: Xiao Wang <jasowang@redhat.com>
26ba25
Date: Fri, 11 Jan 2019 07:59:01 +0000
26ba25
Subject: [PATCH 06/11] net: hub: suppress warnings of no host network for
26ba25
 qtest
26ba25
MIME-Version: 1.0
26ba25
Content-Type: text/plain; charset=UTF-8
26ba25
Content-Transfer-Encoding: 8bit
26ba25
26ba25
RH-Author: Xiao Wang <jasowang@redhat.com>
26ba25
Message-id: <20190111075904.2030-7-jasowang@redhat.com>
26ba25
Patchwork-id: 83982
26ba25
O-Subject: [RHEL8 qemu-kvm PATCH 6/9] net: hub: suppress warnings of no host network for qtest
26ba25
Bugzilla: 1636784
26ba25
RH-Acked-by: Thomas Huth <thuth@redhat.com>
26ba25
RH-Acked-by: Philippe Mathieu-Daudé <philmd@redhat.com>
26ba25
RH-Acked-by: Jens Freimann <jfreimann@redhat.com>
26ba25
RH-Acked-by: Maxime Coquelin <maxime.coquelin@redhat.com>
26ba25
RH-Acked-by: Michael S. Tsirkin <mst@redhat.com>
26ba25
26ba25
Notes: Conflict since we're lacking
26ba25
       442da403ead80525761898ab0d8036a9cd3c6829 ("net: Get rid of
26ba25
       'vlan' terminology and use 'hub' instead in the source files")
26ba25
26ba25
If we want to qtest through hub, it would be much more simpler and
26ba25
safer to configure the hub without host network. So silent this
26ba25
warnings for qtest.
26ba25
26ba25
Signed-off-by: Jason Wang <jasowang@redhat.com>
26ba25
Reviewed-by: Thomas Huth <thuth@redhat.com>
26ba25
Message-id: 20181204035347.6148-3-jasowang@redhat.com
26ba25
Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
26ba25
(cherry picked from commit 56512e1dc1c6a00d37da09baa35981908fb9b5c7)
26ba25
Signed-off-by: Jason Wang <jasowang@redhat.com>
26ba25
Signed-off-by: Danilo C. L. de Paula <ddepaula@redhat.com>
26ba25
---
26ba25
 net/hub.c | 3 ++-
26ba25
 1 file changed, 2 insertions(+), 1 deletion(-)
26ba25
26ba25
diff --git a/net/hub.c b/net/hub.c
26ba25
index 5e84a9a..70a6de2 100644
26ba25
--- a/net/hub.c
26ba25
+++ b/net/hub.c
26ba25
@@ -20,6 +20,7 @@
26ba25
 #include "hub.h"
26ba25
 #include "qemu/iov.h"
26ba25
 #include "qemu/error-report.h"
26ba25
+#include "sysemu/qtest.h"
26ba25
 
26ba25
 /*
26ba25
  * A hub broadcasts incoming packets to all its ports except the source port.
26ba25
@@ -347,7 +348,7 @@ void net_hub_check_clients(void)
26ba25
         if (has_host_dev && !has_nic) {
26ba25
             warn_report("vlan %d with no nics", hub->id);
26ba25
         }
26ba25
-        if (has_nic && !has_host_dev) {
26ba25
+        if (has_nic && !has_host_dev && !qtest_enabled()) {
26ba25
             warn_report("vlan %d is not connected to host network", hub->id);
26ba25
         }
26ba25
     }
26ba25
-- 
26ba25
1.8.3.1
26ba25