Change in vdsm[ovirt-3.5]: libvirt: QoS is not supported by Network XML

phoracek at redhat.com phoracek at redhat.com
Tue Oct 21 10:15:49 UTC 2014


Petr Horáček has uploaded a new change for review.

Change subject: libvirt: QoS is not supported by Network XML
......................................................................

libvirt: QoS is not supported by Network XML

libvirt 1.2.9 does not handle QoS Inbound Outbound in Network XML
anymore.

Traceback:
  File "/usr/lib64/python2.7/site-packages/libvirt.py", line 3881, in
networkDefineXML
    if ret is None:raise libvirtError('virNetworkDefineXML() failed',
conn=self)
libvirtError: unsupported configuration: Unsupported network-wide
<bandwidth> element in network vdsm-test-network with forward
mode='bridge'

createLibvirtNetwork now does not accept qos kwargs.

Change-Id: If5d5913a305cd2062468fed9fe83263dcd0267ea
Signed-off-by: Petr Horáček <phoracek at redhat.com>
---
M tests/functional/networkTests.py
M vdsm/network/configurators/__init__.py
M vdsm/network/configurators/ifcfg.py
M vdsm/network/configurators/iproute2.py
M vdsm/network/configurators/libvirt.py
5 files changed, 7 insertions(+), 51 deletions(-)


  git pull ssh://gerrit.ovirt.org:29418/vdsm refs/changes/99/34299/1

diff --git a/tests/functional/networkTests.py b/tests/functional/networkTests.py
index 2f1e035..158d5ab 100644
--- a/tests/functional/networkTests.py
+++ b/tests/functional/networkTests.py
@@ -603,32 +603,6 @@
             self.assertEqual(status, SUCCESS, msg)
 
     @cleanupNet
-    @RequireDummyMod
-    @ValidateRunningAsRoot
-    def testQosNetwork(self):
-        def testNetQoS(qos):
-            status, msg = self.vdsm_net.addNetwork(NETWORK_NAME, nics=nics,
-                                                   opts=qos)
-            self.assertEqual(status, SUCCESS, msg)
-
-            qosInbound, qosOutbound = self.vdsm_net.networkQos(NETWORK_NAME)
-            self.assertEqual(qos.get('qosInbound', {}), qosInbound)
-            self.assertEqual(qos.get('qosOutbound', {}), qosOutbound)
-
-            status, msg = self.vdsm_net.delNetwork(NETWORK_NAME)
-            self.assertEqual(status, SUCCESS, msg)
-
-        with dummyIf(1) as nics:
-            qosComplete = {'qosInbound': {'average': 1024, 'burst': 2048,
-                                          'peak': 42},
-                           'qosOutbound': {'average': 2400, 'burst': 2048,
-                                           'peak': 100}}
-            testNetQoS(qosComplete)
-
-            qosInbOnly = {'qosInbound': {'average': 1024}}
-            testNetQoS(qosInbOnly)
-
-    @cleanupNet
     @permutations([[True], [False]])
     @RequireDummyMod
     @ValidateRunningAsRoot
diff --git a/vdsm/network/configurators/__init__.py b/vdsm/network/configurators/__init__.py
index 2923290..6e2f969 100644
--- a/vdsm/network/configurators/__init__.py
+++ b/vdsm/network/configurators/__init__.py
@@ -102,13 +102,10 @@
     def removeSourceRoute(self, routes, rules, device):
         raise NotImplementedError
 
-    def configureLibvirtNetwork(self, network, iface, qosInbound=None,
-                                qosOutbound=None):
+    def configureLibvirtNetwork(self, network, iface):
         self.configApplier.createLibvirtNetwork(network,
                                                 isinstance(iface, Bridge),
-                                                iface.name,
-                                                qosInbound=qosInbound,
-                                                qosOutbound=qosOutbound)
+                                                iface.name)
         self._libvirtAdded.add(network)
 
     def removeLibvirtNetwork(self, network):
diff --git a/vdsm/network/configurators/ifcfg.py b/vdsm/network/configurators/ifcfg.py
index 2b60253..5dbe9c1 100644
--- a/vdsm/network/configurators/ifcfg.py
+++ b/vdsm/network/configurators/ifcfg.py
@@ -281,11 +281,8 @@
         logging.debug("Removed file %s", filename)
 
     def createLibvirtNetwork(self, network, bridged=True, iface=None,
-                             skipBackup=False, qosInbound=None,
-                             qosOutbound=None):
-        netXml = libvirt.createNetworkDef(network, bridged, iface,
-                                          qosInbound=qosInbound,
-                                          qosOutbound=qosOutbound)
+                             skipBackup=False):
+        netXml = libvirt.createNetworkDef(network, bridged, iface)
         if not skipBackup:
             self._networkBackup(network)
         libvirt.createNetwork(netXml)
diff --git a/vdsm/network/configurators/iproute2.py b/vdsm/network/configurators/iproute2.py
index 2b9aca1..b06e0ad 100644
--- a/vdsm/network/configurators/iproute2.py
+++ b/vdsm/network/configurators/iproute2.py
@@ -326,10 +326,8 @@
             with open(netinfo.BONDING_OPT % (bond.name, key), 'w') as f:
                 f.write(value)
 
-    def createLibvirtNetwork(self, network, bridged, iface, qosInbound=None,
-                             qosOutbound=None):
-        netXml = libvirt.createNetworkDef(network, bridged, iface,
-                                          qosInbound, qosOutbound)
+    def createLibvirtNetwork(self, network, bridged, iface):
+        netXml = libvirt.createNetworkDef(network, bridged, iface)
         libvirt.createNetwork(netXml)
 
     def removeLibvirtNetwork(self, network):
diff --git a/vdsm/network/configurators/libvirt.py b/vdsm/network/configurators/libvirt.py
index f378641..5bc188d 100644
--- a/vdsm/network/configurators/libvirt.py
+++ b/vdsm/network/configurators/libvirt.py
@@ -51,8 +51,7 @@
         raise
 
 
-def createNetworkDef(network, bridged=True, iface=None,
-                     qosInbound=None, qosOutbound=None):
+def createNetworkDef(network, bridged=True, iface=None):
     """
     Creates Network Xml e.g.:
     <network>
@@ -96,15 +95,6 @@
         root.appendChild(XmlElement('bridge', name=network))
     else:
         forwardElem.appendChild(XmlElement('interface', dev=iface))
-
-    if qosInbound or qosOutbound:
-        bandwidthElem = XmlElement('bandwidth')
-        if qosInbound:
-            bandwidthElem.appendChild(XmlElement('inbound', **qosInbound))
-        if qosOutbound:
-            bandwidthElem.appendChild(XmlElement('outbound',
-                                                 **qosOutbound))
-        root.appendChild(bandwidthElem)
 
     return root.toxml()
 


-- 
To view, visit http://gerrit.ovirt.org/34299
To unsubscribe, visit http://gerrit.ovirt.org/settings

Gerrit-MessageType: newchange
Gerrit-Change-Id: If5d5913a305cd2062468fed9fe83263dcd0267ea
Gerrit-PatchSet: 1
Gerrit-Project: vdsm
Gerrit-Branch: ovirt-3.5
Gerrit-Owner: Petr Horáček <phoracek at redhat.com>


More information about the vdsm-patches mailing list