From facb1f67ffca12cbe87abb50f1900956624c9774 Mon Sep 17 00:00:00 2001 Message-Id: From: Michal Privoznik Date: Thu, 24 Nov 2022 10:28:59 +0100 Subject: [PATCH] conf: Make VIR_DOMAIN_NET_TYPE_ETHERNET not share 'host view' When setting up QoS for a domain , or when reporting its statistics we may need to swap TX/RX values. This is all explained in comment to virDomainNetTypeSharesHostView(). However, this function claims that VIR_DOMAIN_NET_TYPE_ETHERNET also shares the 'host view', meaning the TX/RX values must be swapped. But that's not true. An easy reproducer is to start a domain with two -s: one type of network, the other of type ethernet and configure the same for both. Reversed setting can then be observed (e.g. via tc). Reported-by: Oleg Vasilev Signed-off-by: Michal Privoznik Reviewed-by: Jiri Denemark (cherry picked from commit 0862cb3ce46253a58ca02d36b2b6a6397a60bfc7) Resolves: https://bugzilla.redhat.com/show_bug.cgi?id=2173976 Signed-off-by: Michal Privoznik --- src/conf/domain_conf.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/conf/domain_conf.c b/src/conf/domain_conf.c index 95afd9226e..b3bc027fd9 100644 --- a/src/conf/domain_conf.c +++ b/src/conf/domain_conf.c @@ -30473,9 +30473,9 @@ virDomainNetTypeSharesHostView(const virDomainNetDef *net) virDomainNetType actualType = virDomainNetGetActualType(net); switch (actualType) { case VIR_DOMAIN_NET_TYPE_DIRECT: - case VIR_DOMAIN_NET_TYPE_ETHERNET: return true; case VIR_DOMAIN_NET_TYPE_USER: + case VIR_DOMAIN_NET_TYPE_ETHERNET: case VIR_DOMAIN_NET_TYPE_VHOSTUSER: case VIR_DOMAIN_NET_TYPE_SERVER: case VIR_DOMAIN_NET_TYPE_CLIENT: -- 2.39.2