Change in vdsm[master]: vm: remove obfuscated use of errCode
nsoffer at redhat.com
nsoffer at redhat.com
Thu Mar 5 23:48:22 UTC 2015
Nir Soffer has posted comments on this change.
Change subject: vm: remove obfuscated use of errCode
......................................................................
Patch Set 4: Code-Review-1
(1 comment)
https://gerrit.ovirt.org/#/c/38267/4/vdsm/virt/vm.py
File vdsm/virt/vm.py:
Line 3740: diskelem.toxml(), libvirt.VIR_DOMAIN_DEVICE_MODIFY_FORCE)
Line 3741: except Exception:
Line 3742: self.log.debug("updateDeviceFlags failed", exc_info=True)
Line 3743: self.cif.teardownVolumePath(drivespec)
Line 3744: return errCode['changeDisk']
The old code was creating new dict for this error - safe. You return the shared mutable dict so if the caller change the returned dict, the next time you return this error it may be different - unsafe.
Line 3745: if vmDev in self.conf:
Line 3746: self.cif.teardownVolumePath(self.conf[vmDev])
Line 3747:
Line 3748: self.conf[vmDev] = path
--
To view, visit https://gerrit.ovirt.org/38267
To unsubscribe, visit https://gerrit.ovirt.org/settings
Gerrit-MessageType: comment
Gerrit-Change-Id: I5944a3ac9433fa3c85879f4a16b5b6730c2b50b6
Gerrit-PatchSet: 4
Gerrit-Project: vdsm
Gerrit-Branch: master
Gerrit-Owner: Francesco Romani <fromani at redhat.com>
Gerrit-Reviewer: Dan Kenigsberg <danken at redhat.com>
Gerrit-Reviewer: Francesco Romani <fromani at redhat.com>
Gerrit-Reviewer: Nir Soffer <nsoffer at redhat.com>
Gerrit-Reviewer: automation at ovirt.org
Gerrit-Reviewer: oVirt Jenkins CI Server
Gerrit-HasComments: Yes
More information about the vdsm-patches
mailing list