]> xenbits.xensource.com Git - libvirt.git/commitdiff
conf: Make VIR_DOMAIN_NET_TYPE_ETHERNET not share 'host view'
authorMichal Privoznik <mprivozn@redhat.com>
Thu, 24 Nov 2022 09:28:59 +0000 (10:28 +0100)
committerMichal Privoznik <mprivozn@redhat.com>
Thu, 24 Nov 2022 14:51:34 +0000 (15:51 +0100)
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 <oleg.vasilev@virtuozzo.com>
Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
Reviewed-by: Jiri Denemark <jdenemar@redhat.com>
src/conf/domain_conf.c

index 3790121cf74b5529112391bc3cd943db4cc9fb89..ef930b16871f24acd4786c4f25832e32cbfdfd0f 100644 (file)
@@ -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: