Change in vdsm[master]: virt: Fix of uninitialized variable access in Vm.setLinkAndN...
mzamazal at redhat.com
mzamazal at redhat.com
Wed Feb 3 17:12:12 UTC 2016
Milan Zamazal has posted comments on this change.
Change subject: virt: Fix of uninitialized variable access in Vm.setLinkAndNetwork()
......................................................................
Patch Set 1:
(1 comment)
https://gerrit.ovirt.org/#/c/53061/1/vdsm/virt/vm.py
File vdsm/virt/vm.py:
Line 2145: source.setAttribute('bridge', networkValue)
Line 2146: try:
Line 2147: link = vnicXML.getElementsByTagName('link')[0]
Line 2148: except IndexError:
Line 2149: link = vnicXML.appendChildWithArgs('link')
> Yes, this change seems correct. But I wonder why this didn't explode before
I just spotted it when doing other changes. I can only trigger the bug artificially (e.g. by testing code). I tried to create a test but it was too difficult (it was possible to trigger the bug but not easy to make the test pass through whole setLinkAndNetwork after the fix).
Line 2150: link.setAttribute('state', linkValue)
Line 2151: if (specParams and
Line 2152: ('inbound' in specParams or 'outbound' in specParams)):
Line 2153: oldBandwidths = vnicXML.getElementsByTagName('bandwidth')
--
To view, visit https://gerrit.ovirt.org/53061
To unsubscribe, visit https://gerrit.ovirt.org/settings
Gerrit-MessageType: comment
Gerrit-Change-Id: I04b44a1599593e825cc83f8df6edd4965ff43707
Gerrit-PatchSet: 1
Gerrit-Project: vdsm
Gerrit-Branch: master
Gerrit-Owner: Milan Zamazal <mzamazal at redhat.com>
Gerrit-Reviewer: Francesco Romani <fromani at redhat.com>
Gerrit-Reviewer: Jenkins CI
Gerrit-Reviewer: Milan Zamazal <mzamazal at redhat.com>
Gerrit-Reviewer: gerrit-hooks <automation at ovirt.org>
Gerrit-HasComments: Yes
More information about the vdsm-patches
mailing list