summaryrefslogtreecommitdiffstats
path: root/net
diff options
context:
space:
mode:
authorJason Wang2018-12-04 04:53:44 +0100
committerPeter Maydell2018-12-04 12:06:15 +0100
commit56512e1dc1c6a00d37da09baa35981908fb9b5c7 (patch)
treee4228d3106056ea90b92d71e7886cb83b7363cfd /net
parentnet: drop too large packet early (diff)
downloadqemu-56512e1dc1c6a00d37da09baa35981908fb9b5c7.tar.gz
qemu-56512e1dc1c6a00d37da09baa35981908fb9b5c7.tar.xz
qemu-56512e1dc1c6a00d37da09baa35981908fb9b5c7.zip
net: hub: suppress warnings of no host network for qtest
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 <jasowang@redhat.com> Reviewed-by: Thomas Huth <thuth@redhat.com> Message-id: 20181204035347.6148-3-jasowang@redhat.com Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
Diffstat (limited to 'net')
-rw-r--r--net/hub.c3
1 files changed, 2 insertions, 1 deletions
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);
}
}