Change in vdsm[master]: virt: clientIF: extract vmContainer into a module

mzamazal at redhat.com mzamazal at redhat.com
Tue Mar 8 12:43:54 UTC 2016


Milan Zamazal has posted comments on this change.

Change subject: virt: clientIF: extract vmContainer into a module
......................................................................


Patch Set 6: Code-Review-1

(1 comment)

https://gerrit.ovirt.org/#/c/53101/6/lib/vdsm/virt/vmdict.py
File lib/vdsm/virt/vmdict.py:

Line 84:     with _lock:
Line 85:         if vm.id in _vms:
Line 86:             del _vms[vm.id]
Line 87:         else:
Line 88:             raise UnknownVM()
> You have a point here, but we this 'dict' thingy has to be a singleton, and
I agree with Martin, (re)implementing dictionary this way is not a good idea. And I don't agree this is the most pythonic way to define a singleton. Martin's suggestion to make the dictionary class private and export just its (single) instance created here is the simplest way to get the singleton. Using metaclasses or decorators/wrappers are other options, depending on circumstances.
Line 89: 
Line 90: 
Line 91: @utils.traceback()
Line 92: def dispatch_eio_cont(libvirt_vms, sdUUID):


-- 
To view, visit https://gerrit.ovirt.org/53101
To unsubscribe, visit https://gerrit.ovirt.org/settings

Gerrit-MessageType: comment
Gerrit-Change-Id: Iacd2ae6c5e9ca6a73c0fed978c78c9ebb001c46d
Gerrit-PatchSet: 6
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: Jenkins CI
Gerrit-Reviewer: Martin Polednik <mpolednik at redhat.com>
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