Change in vdsm[master]: [WIP] lvm: Add an option to replace locking type 4
ewarszaw at redhat.com
ewarszaw at redhat.com
Sun Feb 23 09:45:34 UTC 2014
Eduardo has posted comments on this change.
Change subject: [WIP] lvm: Add an option to replace locking type 4
......................................................................
Patch Set 2: Code-Review-1
(4 comments)
http://gerrit.ovirt.org/#/c/23645/2/vdsm/storage/lvm.py
File vdsm/storage/lvm.py:
Line 256: self._filterStale = False
Line 257:
Line 258: return self._extraCfg
Line 259:
Line 260: def _addExtraCfg(self, cmd, devices=tuple(), safe):
Safe should have a default value or be before devices.
Line 261: newcmd = [constants.EXT_LVM, cmd[0]]
Line 262: if devices:
Line 263: conf = _buildConfig(devices)
Line 264: else:
Line 291: self._pvs = {}
Line 292: self._vgs = {}
Line 293: self._lvs = {}
Line 294:
Line 295: def cmd(self, cmd, devices=tuple(), safe=True):
May be better (TM) to change safe=True for lvm cluster safe commands?
(Inverting the value semantics.)
Line 296: """
Line 297: Use safe as False only for lvm cluster safe commands.
Line 298: These are cmds that don't change metadata of an existing VG.
Line 299: """
Line 945: cmd = ["vgcreate"] + options + [vgName] + pvs
Line 946: rc, out, err = _lvminfo.cmd(cmd, tuple(pvs), False)
Line 947: if rc == 0:
Line 948: _lvminfo._invalidatepvs(pvs)
Line 949: _lvminfo._invalidatevgs(vgName)
May be worth to add stubs instead invalidating the whole cache since this operations are now orthogonal to any value already present in the caches.
Anyway this is a different patch.
Line 950: log.debug("Cache after createvg %s", _lvminfo._vgs)
Line 951: else:
Line 952: raise se.VolumeGroupCreateError(vgName, pvs)
Line 953:
Line 946: rc, out, err = _lvminfo.cmd(cmd, tuple(pvs), False)
Line 947: if rc == 0:
Line 948: _lvminfo._invalidatepvs(pvs)
Line 949: _lvminfo._invalidatevgs(vgName)
Line 950: log.debug("Cache after createvg %s", _lvminfo._vgs)
This log should be removed in production code.
Line 951: else:
Line 952: raise se.VolumeGroupCreateError(vgName, pvs)
Line 953:
Line 954:
--
To view, visit http://gerrit.ovirt.org/23645
To unsubscribe, visit http://gerrit.ovirt.org/settings
Gerrit-MessageType: comment
Gerrit-Change-Id: I9a67a7fa20145763d8ab5cdbf293a9c3eb070067
Gerrit-PatchSet: 2
Gerrit-Project: vdsm
Gerrit-Branch: master
Gerrit-Owner: Yeela Kaplan <ykaplan at redhat.com>
Gerrit-Reviewer: Eduardo <ewarszaw at redhat.com>
Gerrit-Reviewer: oVirt Jenkins CI Server
Gerrit-HasComments: Yes
More information about the vdsm-patches
mailing list