Change in vdsm[master]: vmDevices: add __slots__ to devices
danken at redhat.com
danken at redhat.com
Wed Dec 18 21:27:24 UTC 2013
Dan Kenigsberg has posted comments on this change.
Change subject: vmDevices: add __slots__ to devices
......................................................................
Patch Set 1:
(1 comment)
....................................................
File vdsm/vm.py
Line 1167:
Line 1168: class VmDevice(object):
Line 1169: __slots__ = ['deviceType', 'device', 'alias', 'specParams', 'deviceId']
Line 1170:
Line 1171: def __init__(self, conf, log, **kwargs):
The current state, of dynamic attributes is horrible. Right. But I'm not sure that using __slots__ to enforce it is the right solution. Why we cannot just have
def __init__(self, conf, log, deviceType, device, alias, specParams, deviceId, **kwargs):
we can add __slots__ too (to save memory).
Line 1172: self.specParams = {}
Line 1173: for attr, value in kwargs.iteritems():
Line 1174: try:
Line 1175: setattr(self, attr, value)
--
To view, visit http://gerrit.ovirt.org/21036
To unsubscribe, visit http://gerrit.ovirt.org/settings
Gerrit-MessageType: comment
Gerrit-Change-Id: I6e8dadabdd02d3b44606f215c4bc7b7e306a591a
Gerrit-PatchSet: 1
Gerrit-Project: vdsm
Gerrit-Branch: master
Gerrit-Owner: Martin Polednik <mpoledni at redhat.com>
Gerrit-Reviewer: Dan Kenigsberg <danken at redhat.com>
Gerrit-Reviewer: Federico Simoncelli <fsimonce at redhat.com>
Gerrit-Reviewer: Francesco Romani <fromani at redhat.com>
Gerrit-Reviewer: Martin Polednik <mpoledni at redhat.com>
Gerrit-Reviewer: Michal Skrivanek <michal.skrivanek at redhat.com>
Gerrit-Reviewer: Nir Soffer <nsoffer at redhat.com>
Gerrit-Reviewer: oVirt Jenkins CI Server
Gerrit-HasComments: Yes
More information about the vdsm-patches
mailing list