render / rpms / libvirt

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