[PATCH 1/2] conf: Parse bandwidth.floor for interface type='bridge' too

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



When users want to update an interface of a running domain, they
are supposed to take whatever XML 'virsh dumpxml' produces, do
all the tweaks and feed libvirt back with the new XML. This is
exactly how 'virsh domif-setlink' works. Except after 518026e1595
an interface type='network' will become type='bridge' in live
XML. And if the interface has some bandwidth with floor set we
fail to parse it because floor is allowed only for type network.

Signed-off-by: Michal Privoznik <mprivozn@xxxxxxxxxx>
---
 src/conf/domain_conf.c | 7 ++++---
 1 file changed, 4 insertions(+), 3 deletions(-)

diff --git a/src/conf/domain_conf.c b/src/conf/domain_conf.c
index 6331424635..e23ea7a939 100644
--- a/src/conf/domain_conf.c
+++ b/src/conf/domain_conf.c
@@ -11631,9 +11631,10 @@ virDomainNetDefParseXML(virDomainXMLOptionPtr xmlopt,
                     goto error;
                 }
             } else if (virXMLNodeNameEqual(cur, "bandwidth")) {
-                if (virNetDevBandwidthParse(&def->bandwidth,
-                                            cur,
-                                            def->type == VIR_DOMAIN_NET_TYPE_NETWORK) < 0)
+                bool allowFloor =
+                    def->type == VIR_DOMAIN_NET_TYPE_NETWORK ||
+                    def->type == VIR_DOMAIN_NET_TYPE_BRIDGE;
+                if (virNetDevBandwidthParse(&def->bandwidth, cur, allowFloor) < 0)
                     goto error;
             } else if (virXMLNodeNameEqual(cur, "vlan")) {
                 if (virNetDevVlanParse(cur, ctxt, &def->vlan) < 0)
-- 
2.21.0

--
libvir-list mailing list
libvir-list@xxxxxxxxxx
https://www.redhat.com/mailman/listinfo/libvir-list



[Index of Archives]     [Virt Tools]     [Libvirt Users]     [Lib OS Info]     [Fedora Users]     [Fedora Desktop]     [Fedora SELinux]     [Big List of Linux Books]     [Yosemite News]     [KDE Users]     [Fedora Tools]

  Powered by Linux