Petr Šebek has uploaded a new change for review.
Change subject: bugfix: UpdateVmDevice QoS
......................................................................
bugfix: UpdateVmDevice QoS
QoS was not handled in method Vm._updateInterfaceDevice.
Change-Id: I43a383b2a9cf96366927beebf63f1344027169fb
Bug-Url:
https://bugzilla.redhat.com/1002300
Signed-off-by: Petr Sebek <psebek(a)redhat.com>
---
M vdsm/vm.py
1 file changed, 17 insertions(+), 2 deletions(-)
git pull ssh://gerrit.ovirt.org:29418/vdsm refs/changes/45/19545/1
diff --git a/vdsm/vm.py b/vdsm/vm.py
index f356c08..0bccd46 100644
--- a/vdsm/vm.py
+++ b/vdsm/vm.py
@@ -3095,12 +3095,13 @@
network = DUMMY_BRIDGE
linkValue = 'down'
custom = params.get('custom')
+ specParams = params.get('specParams')
netsToMirror = params.get('portMirroring',
netConf.get('portMirroring', []))
with self.setLinkAndNetwork(netDev, netConf, linkValue, network,
- custom):
+ custom, specParams):
with self.updatePortMirroring(netConf, netsToMirror):
return {'status': doneCode, 'vmList': self.status()}
except (LookupError,
@@ -3111,7 +3112,19 @@
'message': e.message}}
@contextmanager
- def setLinkAndNetwork(self, dev, conf, linkValue, networkValue, custom):
+ def setLinkAndNetwork(self, dev, conf, linkValue, networkValue, custom,
+ specParams):
+ def updateXMLWithQoS(vnicXML, qos):
+ bandwidth = vnicXML.getElementsByTagName('bandwidth')[0]
+ inbound = bandwidth.getElementsByTagName('inbound')[0]
+ outbound = bandwidth.getElementsByTagName('outbound')[0]
+ if 'inbound' in qos:
+ bandwidth.remove(inbound)
+ bandwidth.appendChildWithArgs('inbound',
**qos['inbound'])
+ if 'outbound' in qos:
+ bandwidth.remove(outbound)
+ bandwidth.appendChildWithArgs('outbound',
**qos['outbound'])
+
vnicXML = dev.getXML()
source = vnicXML.getElementsByTagName('source')[0]
source.setAttribute('bridge', networkValue)
@@ -3121,6 +3134,8 @@
link = xml.dom.minidom.Element('link')
vnicXML.appendChildWithArgs(link)
link.setAttribute('state', linkValue)
+ if specParams:
+ updateXMLWithQoS(vnicXML, specParams)
vnicStrXML = vnicXML.toprettyxml(encoding='utf-8')
try:
try:
--
To view, visit
http://gerrit.ovirt.org/19545
To unsubscribe, visit
http://gerrit.ovirt.org/settings
Gerrit-MessageType: newchange
Gerrit-Change-Id: I43a383b2a9cf96366927beebf63f1344027169fb
Gerrit-PatchSet: 1
Gerrit-Project: vdsm
Gerrit-Branch: master
Gerrit-Owner: Petr Šebek <psebek(a)redhat.com>