yeahuh / 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

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