Change in vdsm[master]: vm: return full copy of the conf data on status()

nsoffer at redhat.com nsoffer at redhat.com
Thu Nov 6 11:05:27 UTC 2014


Nir Soffer has posted comments on this change.

Change subject: vm: return full copy of the conf data on status()
......................................................................


Patch Set 4:

(1 comment)

http://gerrit.ovirt.org/#/c/34147/4/vdsm/virt/vm.py
File vdsm/virt/vm.py:

Line 2210:         # used by API.Global.getVMList
Line 2211:         self.conf['status'] = self.lastStatus
Line 2212:         with self._confLock:
Line 2213:             # Filter out any internal keys
Line 2214:             status = dict((k, v) for k, v in self.conf.iteritems()
> Come to think:
One deepcopy will be faster, since the copy is done in C, compared with calling multiple functions in Python.

Don't waste your time on benchmarking this. The difference is insignificant, as N is small, and we do not do this in a tight loop.

The current code is better because it is simpler, safer and probably faster.
Line 2215:                           if not k.startswith("_"))
Line 2216:             status['guestDiskMapping'] = self.guestAgent.guestDiskMapping
Line 2217:             return deepcopy(status)
Line 2218: 


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

Gerrit-MessageType: comment
Gerrit-Change-Id: I604f8534c9380d289633df4a8151699ab0d97e34
Gerrit-PatchSet: 4
Gerrit-Project: vdsm
Gerrit-Branch: master
Gerrit-Owner: Francesco Romani <fromani at redhat.com>
Gerrit-Reviewer: Adam Litke <alitke at redhat.com>
Gerrit-Reviewer: Francesco Romani <fromani at redhat.com>
Gerrit-Reviewer: Michal Skrivanek <michal.skrivanek 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