On 24.11.2022 18:10, Michal Privoznik wrote:
When setting up QoS for a domain <interface/>, 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 <interface/>-s:
one type of network, the other of type ethernet and configure the
same <bandwidth/> for both. Reversed setting can then be observed
(e.g. via tc).

Reported-by: Oleg Vasilev <[email protected]>
Signed-off-by: Michal Privoznik <[email protected]>
---
  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 3790121cf7..ef930b1687 100644
--- a/src/conf/domain_conf.c
+++ b/src/conf/domain_conf.c
@@ -29106,9 +29106,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:

Not sure this is much needed, but

Tested-by: Oleg Vasilev <[email protected]>

:)

Reply via email to