Hello Lee Yarwood,
I'd like you to do a code review. Please visit
to review the following change.
Change subject: udev: Race fix- load and trigger dev rule(#891300) ......................................................................
udev: Race fix- load and trigger dev rule(#891300)
The rule file is generated, yet not synch-loaded in memory, so a VM with a with a direct lun fails to start. This patch inroduces two additional udev functions: 1. udevReloadRules() in supervdsmServer.py . This should be called before uderTrigger(). 2. udevSettle() in supervdsmServer.py . This should be called after usedTrigger(). is written but not sync loaded in memory. These functions are now called before and after (in correspondance) udevTrigger() in appropriateDevice() (hsm.py). Also added a check in appropriateDevice() to make sure the mapping is indeed there.
Bug-Url: https://bugzilla.redhat.com/show_bug.cgi?id=891300 Change-Id: If3b2008a3d9df2dcaf54190721c2dd9764338627 Signed-off-by: Lee Yarwood lyarwood@redhat.com Signed-off-by: Vered Volansky vvolansk@redhat.com --- M vdsm/storage/hsm.py M vdsm/supervdsmServer.py 2 files changed, 24 insertions(+), 0 deletions(-)
git pull ssh://gerrit.ovirt.org:29418/vdsm refs/changes/58/10758/1
diff --git a/vdsm/storage/hsm.py b/vdsm/storage/hsm.py index 5584315..d7d44eb 100644 --- a/vdsm/storage/hsm.py +++ b/vdsm/storage/hsm.py @@ -2924,7 +2924,15 @@ Warning: Internal use only. """ supervdsm.getProxy().appropriateDevice(guid, thiefId) + supervdsm.getProxy().udevReloadRules(guid) supervdsm.getProxy().udevTrigger(guid) + supervdsm.getProxy().udevSettle(guid) + try: + devPath = '/dev/mapper/%s' % guid + fileUtils.validateQemuReadable(devPath) + except OSError: + self.log.error("Failed to appropriate device permission") + raise
@public def inappropriateDevices(self, thiefId): diff --git a/vdsm/supervdsmServer.py b/vdsm/supervdsmServer.py index 486471c..ad73fa4 100755 --- a/vdsm/supervdsmServer.py +++ b/vdsm/supervdsmServer.py @@ -226,6 +226,14 @@ return configNetwork.setSafeNetworkConfig()
@logDecorator + def udevReloadRules(self, guid): + cmd = [EXT_UDEVADM, 'control', '--reload-rules'] + rc, out, err = misc.execCmd(cmd, sudo=False) + if rc: + raise OSError(errno.EINVAL, "Could not reload-rules for device \ + %s, out %s\nerr %s" % (guid, out, err)) + + @logDecorator def udevTrigger(self, guid): cmd = [EXT_UDEVADM, 'trigger', '--verbose', '--action', 'change', '--property-match=DM_NAME=%s' % guid] @@ -235,6 +243,14 @@ %s, out %s\nerr %s" % (guid, out, err))
@logDecorator + def udevSettle(self, guid): + cmd = [EXT_UDEVADM, 'settle'] + rc, out, err = misc.execCmd(cmd, sudo=False) + if rc: + raise OSError(errno.EINVAL, "Could not settle for device \ + %s, out %s\nerr %s" % (guid, out, err)) + + @logDecorator def appropriateDevice(self, guid, thiefId): ruleFile = _UDEV_RULE_FILE_NAME % (guid, thiefId) rule = 'SYMLINK=="mapper/%s", OWNER="%s", GROUP="%s"\n' % (guid,
-- To view, visit http://gerrit.ovirt.org/10758 To unsubscribe, visit http://gerrit.ovirt.org/settings
Gerrit-MessageType: newchange Gerrit-Change-Id: If3b2008a3d9df2dcaf54190721c2dd9764338627 Gerrit-PatchSet: 1 Gerrit-Project: vdsm Gerrit-Branch: master Gerrit-Owner: Vered Volansky vvolansk@redhat.com Gerrit-Reviewer: Lee Yarwood lyarwood@redhat.com
oVirt Jenkins CI Server has posted comments on this change.
Change subject: udev: Race fix- load and trigger dev rule(#891300) ......................................................................
Patch Set 1:
Build Started http://jenkins.ovirt.org/job/vdsm_unit_tests_manual_gerrit/633/ (2/2)
-- To view, visit http://gerrit.ovirt.org/10758 To unsubscribe, visit http://gerrit.ovirt.org/settings
Gerrit-MessageType: comment Gerrit-Change-Id: If3b2008a3d9df2dcaf54190721c2dd9764338627 Gerrit-PatchSet: 1 Gerrit-Project: vdsm Gerrit-Branch: master Gerrit-Owner: Vered Volansky vvolansk@redhat.com Gerrit-Reviewer: Lee Yarwood lyarwood@redhat.com Gerrit-Reviewer: oVirt Jenkins CI Server
oVirt Jenkins CI Server has posted comments on this change.
Change subject: udev: Race fix- load and trigger dev rule(#891300) ......................................................................
Patch Set 1:
Build Started http://jenkins.ovirt.org/job/vdsm_pep8_gerrit/598/ (1/2)
-- To view, visit http://gerrit.ovirt.org/10758 To unsubscribe, visit http://gerrit.ovirt.org/settings
Gerrit-MessageType: comment Gerrit-Change-Id: If3b2008a3d9df2dcaf54190721c2dd9764338627 Gerrit-PatchSet: 1 Gerrit-Project: vdsm Gerrit-Branch: master Gerrit-Owner: Vered Volansky vvolansk@redhat.com Gerrit-Reviewer: Lee Yarwood lyarwood@redhat.com Gerrit-Reviewer: oVirt Jenkins CI Server
oVirt Jenkins CI Server has posted comments on this change.
Change subject: udev: Race fix- load and trigger dev rule(#891300) ......................................................................
Patch Set 1:
Build Successful
http://jenkins.ovirt.org/job/vdsm_pep8_gerrit/598/ : SUCCESS
http://jenkins.ovirt.org/job/vdsm_unit_tests_manual_gerrit/633/ : SUCCESS
-- To view, visit http://gerrit.ovirt.org/10758 To unsubscribe, visit http://gerrit.ovirt.org/settings
Gerrit-MessageType: comment Gerrit-Change-Id: If3b2008a3d9df2dcaf54190721c2dd9764338627 Gerrit-PatchSet: 1 Gerrit-Project: vdsm Gerrit-Branch: master Gerrit-Owner: Vered Volansky vvolansk@redhat.com Gerrit-Reviewer: Lee Yarwood lyarwood@redhat.com Gerrit-Reviewer: oVirt Jenkins CI Server
Federico Simoncelli has posted comments on this change.
Change subject: udev: Race fix- load and trigger dev rule(#891300) ......................................................................
Patch Set 1: Looks good to me, approved
-- To view, visit http://gerrit.ovirt.org/10758 To unsubscribe, visit http://gerrit.ovirt.org/settings
Gerrit-MessageType: comment Gerrit-Change-Id: If3b2008a3d9df2dcaf54190721c2dd9764338627 Gerrit-PatchSet: 1 Gerrit-Project: vdsm Gerrit-Branch: master Gerrit-Owner: Vered Volansky vvolansk@redhat.com Gerrit-Reviewer: Federico Simoncelli fsimonce@redhat.com Gerrit-Reviewer: Lee Yarwood lyarwood@redhat.com Gerrit-Reviewer: oVirt Jenkins CI Server
Federico Simoncelli has posted comments on this change.
Change subject: udev: Race fix- load and trigger dev rule(#891300) ......................................................................
Patch Set 1: (1 inline comment)
.................................................... File vdsm/storage/hsm.py Line 2927: supervdsm.getProxy().udevReloadRules(guid) Line 2928: supervdsm.getProxy().udevTrigger(guid) Line 2929: supervdsm.getProxy().udevSettle(guid) Line 2930: try: Line 2931: devPath = '/dev/mapper/%s' % guid I don't like this embedded here but I guess we'll fix this in the future. Line 2932: fileUtils.validateQemuReadable(devPath) Line 2933: except OSError: Line 2934: self.log.error("Failed to appropriate device permission") Line 2935: raise
-- To view, visit http://gerrit.ovirt.org/10758 To unsubscribe, visit http://gerrit.ovirt.org/settings
Gerrit-MessageType: comment Gerrit-Change-Id: If3b2008a3d9df2dcaf54190721c2dd9764338627 Gerrit-PatchSet: 1 Gerrit-Project: vdsm Gerrit-Branch: master Gerrit-Owner: Vered Volansky vvolansk@redhat.com Gerrit-Reviewer: Federico Simoncelli fsimonce@redhat.com Gerrit-Reviewer: Lee Yarwood lyarwood@redhat.com Gerrit-Reviewer: oVirt Jenkins CI Server
Lee Yarwood has posted comments on this change.
Change subject: udev: Race fix- load and trigger dev rule(#891300) ......................................................................
Patch Set 1: Looks good to me, but someone else must approve
-- To view, visit http://gerrit.ovirt.org/10758 To unsubscribe, visit http://gerrit.ovirt.org/settings
Gerrit-MessageType: comment Gerrit-Change-Id: If3b2008a3d9df2dcaf54190721c2dd9764338627 Gerrit-PatchSet: 1 Gerrit-Project: vdsm Gerrit-Branch: master Gerrit-Owner: Vered Volansky vvolansk@redhat.com Gerrit-Reviewer: Federico Simoncelli fsimonce@redhat.com Gerrit-Reviewer: Lee Yarwood lyarwood@redhat.com Gerrit-Reviewer: oVirt Jenkins CI Server
Ayal Baron has posted comments on this change.
Change subject: udev: Race fix- load and trigger dev rule(#891300) ......................................................................
Patch Set 1: I would prefer that you didn't submit this
(3 inline comments)
.................................................... File vdsm/storage/hsm.py Line 2925: """ Line 2926: supervdsm.getProxy().appropriateDevice(guid, thiefId) Line 2927: supervdsm.getProxy().udevReloadRules(guid) Line 2928: supervdsm.getProxy().udevTrigger(guid) Line 2929: supervdsm.getProxy().udevSettle(guid) this can hang for 3 minutes (udev timeout), I'm not sure that's acceptable. Line 2930: try: Line 2931: devPath = '/dev/mapper/%s' % guid Line 2932: fileUtils.validateQemuReadable(devPath) Line 2933: except OSError:
.................................................... File vdsm/supervdsmServer.py Line 225: def setSafeNetworkConfig(self): Line 226: return configNetwork.setSafeNetworkConfig() Line 227: Line 228: @logDecorator Line 229: def udevReloadRules(self, guid): why expose 3 low level functions instead of one? alternatively, if this is in case we want to trigger for multiple devices yet reload and settle once, why pass guid in the API here?
In fact, I'm not sure why all these are not part of appropriateDevice. The point of supervdsm is to minimize the attack surface, not give generic capabilities to do anything on the system. Line 230: cmd = [EXT_UDEVADM, 'control', '--reload-rules'] Line 231: rc, out, err = misc.execCmd(cmd, sudo=False) Line 232: if rc: Line 233: raise OSError(errno.EINVAL, "Could not reload-rules for device \
Line 242: raise OSError(errno.EINVAL, "Could not trigger change for device \ Line 243: %s, out %s\nerr %s" % (guid, out, err)) Line 244: Line 245: @logDecorator Line 246: def udevSettle(self, guid): same as above. Line 247: cmd = [EXT_UDEVADM, 'settle'] Line 248: rc, out, err = misc.execCmd(cmd, sudo=False) Line 249: if rc: Line 250: raise OSError(errno.EINVAL, "Could not settle for device \
-- To view, visit http://gerrit.ovirt.org/10758 To unsubscribe, visit http://gerrit.ovirt.org/settings
Gerrit-MessageType: comment Gerrit-Change-Id: If3b2008a3d9df2dcaf54190721c2dd9764338627 Gerrit-PatchSet: 1 Gerrit-Project: vdsm Gerrit-Branch: master Gerrit-Owner: Vered Volansky vvolansk@redhat.com Gerrit-Reviewer: Ayal Baron abaron@redhat.com Gerrit-Reviewer: Federico Simoncelli fsimonce@redhat.com Gerrit-Reviewer: Lee Yarwood lyarwood@redhat.com Gerrit-Reviewer: oVirt Jenkins CI Server
Royce Lv has posted comments on this change.
Change subject: udev: Race fix- load and trigger dev rule(#891300) ......................................................................
Patch Set 1: I would prefer that you didn't submit this
1.I can't access the bugzilla. 2.As I have explained in https://bugzilla.redhat.com/show_bug.cgi?id=844130: in reload cmd in RHEL udev-173 is : # udevadm control --reload-rules but in fc17-udev-182 is: #udevadm control --reload
Can check the source code here: www.kernel.org/pub/linux/utils/kernel/hotplug/udev-182.tar.bz2 (udevd.c/udev-rules.c) According to changelog 181: The 'udevadm control --reload-rules' option has been renamed to '--reload'. It now also reloads the kernel module configuration. Thought in source code udev-182 it still restores --reload-rules, but did not expose it to man. So I'm afraid there will be some gap of this cmd in the future.
-- To view, visit http://gerrit.ovirt.org/10758 To unsubscribe, visit http://gerrit.ovirt.org/settings
Gerrit-MessageType: comment Gerrit-Change-Id: If3b2008a3d9df2dcaf54190721c2dd9764338627 Gerrit-PatchSet: 1 Gerrit-Project: vdsm Gerrit-Branch: master Gerrit-Owner: Vered Volansky vvolansk@redhat.com Gerrit-Reviewer: Ayal Baron abaron@redhat.com Gerrit-Reviewer: Dan Kenigsberg danken@redhat.com Gerrit-Reviewer: Federico Simoncelli fsimonce@redhat.com Gerrit-Reviewer: Lee Yarwood lyarwood@redhat.com Gerrit-Reviewer: Royce Lv lvroyce@linux.vnet.ibm.com Gerrit-Reviewer: oVirt Jenkins CI Server
Federico Simoncelli has posted comments on this change.
Change subject: udev: Race fix- load and trigger dev rule(#891300) ......................................................................
Patch Set 1: (1 inline comment)
.................................................... File vdsm/supervdsmServer.py Line 225: def setSafeNetworkConfig(self): Line 226: return configNetwork.setSafeNetworkConfig() Line 227: Line 228: @logDecorator Line 229: def udevReloadRules(self, guid): Indeed the first version of this patch did what you're asking (also considering to minimize the number of methods exposed) but the code seemed sloppy and it didn't fit with the whole rest of the file where (nonetheless) each operation is very specific. To improve the situation maybe we can keep the three methods separated (with reload and settle as private methods), and make udevTrigger (accepting multiple guids) call them. Line 230: cmd = [EXT_UDEVADM, 'control', '--reload-rules'] Line 231: rc, out, err = misc.execCmd(cmd, sudo=False) Line 232: if rc: Line 233: raise OSError(errno.EINVAL, "Could not reload-rules for device \
-- To view, visit http://gerrit.ovirt.org/10758 To unsubscribe, visit http://gerrit.ovirt.org/settings
Gerrit-MessageType: comment Gerrit-Change-Id: If3b2008a3d9df2dcaf54190721c2dd9764338627 Gerrit-PatchSet: 1 Gerrit-Project: vdsm Gerrit-Branch: master Gerrit-Owner: Vered Volansky vvolansk@redhat.com Gerrit-Reviewer: Ayal Baron abaron@redhat.com Gerrit-Reviewer: Dan Kenigsberg danken@redhat.com Gerrit-Reviewer: Federico Simoncelli fsimonce@redhat.com Gerrit-Reviewer: Lee Yarwood lyarwood@redhat.com Gerrit-Reviewer: Royce Lv lvroyce@linux.vnet.ibm.com Gerrit-Reviewer: oVirt Jenkins CI Server
Federico Simoncelli has posted comments on this change.
Change subject: udev: Race fix- load and trigger dev rule(#891300) ......................................................................
Patch Set 1: (2 inline comments)
.................................................... File vdsm/storage/hsm.py Line 2925: """ Line 2926: supervdsm.getProxy().appropriateDevice(guid, thiefId) Line 2927: supervdsm.getProxy().udevReloadRules(guid) Line 2928: supervdsm.getProxy().udevTrigger(guid) Line 2929: supervdsm.getProxy().udevSettle(guid) Then we can set a timeout with --timeout=<seconds> Line 2930: try: Line 2931: devPath = '/dev/mapper/%s' % guid Line 2932: fileUtils.validateQemuReadable(devPath) Line 2933: except OSError:
.................................................... File vdsm/supervdsmServer.py Line 226: return configNetwork.setSafeNetworkConfig() Line 227: Line 228: @logDecorator Line 229: def udevReloadRules(self, guid): Line 230: cmd = [EXT_UDEVADM, 'control', '--reload-rules'] We could dynamically use --reload or --reload-rules given the result of "udevadm --version" >= 181. The udevadm version can be cached so that it's done only once (let's assume that we don't support major upgrades without restarting vdsm, and anyway --reload-rules is still working on 182 even if it's not reported by the help). Line 231: rc, out, err = misc.execCmd(cmd, sudo=False) Line 232: if rc: Line 233: raise OSError(errno.EINVAL, "Could not reload-rules for device \ Line 234: %s, out %s\nerr %s" % (guid, out, err))
-- To view, visit http://gerrit.ovirt.org/10758 To unsubscribe, visit http://gerrit.ovirt.org/settings
Gerrit-MessageType: comment Gerrit-Change-Id: If3b2008a3d9df2dcaf54190721c2dd9764338627 Gerrit-PatchSet: 1 Gerrit-Project: vdsm Gerrit-Branch: master Gerrit-Owner: Vered Volansky vvolansk@redhat.com Gerrit-Reviewer: Ayal Baron abaron@redhat.com Gerrit-Reviewer: Dan Kenigsberg danken@redhat.com Gerrit-Reviewer: Federico Simoncelli fsimonce@redhat.com Gerrit-Reviewer: Lee Yarwood lyarwood@redhat.com Gerrit-Reviewer: Royce Lv lvroyce@linux.vnet.ibm.com Gerrit-Reviewer: oVirt Jenkins CI Server
oVirt Jenkins CI Server has posted comments on this change.
Change subject: udev: Race fix- load and trigger dev rule(#891300) ......................................................................
Patch Set 2:
Build Started http://jenkins.ovirt.org/job/vdsm_pep8_gerrit/611/ (2/2)
-- To view, visit http://gerrit.ovirt.org/10758 To unsubscribe, visit http://gerrit.ovirt.org/settings
Gerrit-MessageType: comment Gerrit-Change-Id: If3b2008a3d9df2dcaf54190721c2dd9764338627 Gerrit-PatchSet: 2 Gerrit-Project: vdsm Gerrit-Branch: master Gerrit-Owner: Vered Volansky vvolansk@redhat.com Gerrit-Reviewer: Ayal Baron abaron@redhat.com Gerrit-Reviewer: Dan Kenigsberg danken@redhat.com Gerrit-Reviewer: Federico Simoncelli fsimonce@redhat.com Gerrit-Reviewer: Lee Yarwood lyarwood@redhat.com Gerrit-Reviewer: Royce Lv lvroyce@linux.vnet.ibm.com Gerrit-Reviewer: Vered Volansky vvolansk@redhat.com Gerrit-Reviewer: oVirt Jenkins CI Server
oVirt Jenkins CI Server has posted comments on this change.
Change subject: udev: Race fix- load and trigger dev rule(#891300) ......................................................................
Patch Set 2:
Build Started http://jenkins.ovirt.org/job/vdsm_unit_tests_manual_gerrit/646/ (1/2)
-- To view, visit http://gerrit.ovirt.org/10758 To unsubscribe, visit http://gerrit.ovirt.org/settings
Gerrit-MessageType: comment Gerrit-Change-Id: If3b2008a3d9df2dcaf54190721c2dd9764338627 Gerrit-PatchSet: 2 Gerrit-Project: vdsm Gerrit-Branch: master Gerrit-Owner: Vered Volansky vvolansk@redhat.com Gerrit-Reviewer: Ayal Baron abaron@redhat.com Gerrit-Reviewer: Dan Kenigsberg danken@redhat.com Gerrit-Reviewer: Federico Simoncelli fsimonce@redhat.com Gerrit-Reviewer: Lee Yarwood lyarwood@redhat.com Gerrit-Reviewer: Royce Lv lvroyce@linux.vnet.ibm.com Gerrit-Reviewer: Vered Volansky vvolansk@redhat.com Gerrit-Reviewer: oVirt Jenkins CI Server
Vered Volansky has posted comments on this change.
Change subject: udev: Race fix- load and trigger dev rule(#891300) ......................................................................
Patch Set 2:
Addressed comments, apart settle 180 sec issue. Is setting timeout an acceptable solution? if so, what is an acceptable value?
-- To view, visit http://gerrit.ovirt.org/10758 To unsubscribe, visit http://gerrit.ovirt.org/settings
Gerrit-MessageType: comment Gerrit-Change-Id: If3b2008a3d9df2dcaf54190721c2dd9764338627 Gerrit-PatchSet: 2 Gerrit-Project: vdsm Gerrit-Branch: master Gerrit-Owner: Vered Volansky vvolansk@redhat.com Gerrit-Reviewer: Ayal Baron abaron@redhat.com Gerrit-Reviewer: Dan Kenigsberg danken@redhat.com Gerrit-Reviewer: Federico Simoncelli fsimonce@redhat.com Gerrit-Reviewer: Lee Yarwood lyarwood@redhat.com Gerrit-Reviewer: Royce Lv lvroyce@linux.vnet.ibm.com Gerrit-Reviewer: Vered Volansky vvolansk@redhat.com Gerrit-Reviewer: oVirt Jenkins CI Server
oVirt Jenkins CI Server has posted comments on this change.
Change subject: udev: Race fix- load and trigger dev rule(#891300) ......................................................................
Patch Set 2:
Build Successful
http://jenkins.ovirt.org/job/vdsm_pep8_gerrit/611/ : SUCCESS
http://jenkins.ovirt.org/job/vdsm_unit_tests_manual_gerrit/646/ : SUCCESS
-- To view, visit http://gerrit.ovirt.org/10758 To unsubscribe, visit http://gerrit.ovirt.org/settings
Gerrit-MessageType: comment Gerrit-Change-Id: If3b2008a3d9df2dcaf54190721c2dd9764338627 Gerrit-PatchSet: 2 Gerrit-Project: vdsm Gerrit-Branch: master Gerrit-Owner: Vered Volansky vvolansk@redhat.com Gerrit-Reviewer: Ayal Baron abaron@redhat.com Gerrit-Reviewer: Dan Kenigsberg danken@redhat.com Gerrit-Reviewer: Federico Simoncelli fsimonce@redhat.com Gerrit-Reviewer: Lee Yarwood lyarwood@redhat.com Gerrit-Reviewer: Royce Lv lvroyce@linux.vnet.ibm.com Gerrit-Reviewer: Vered Volansky vvolansk@redhat.com Gerrit-Reviewer: oVirt Jenkins CI Server
oVirt Jenkins CI Server has posted comments on this change.
Change subject: udev: Race fix- load and trigger dev rule(#891300) ......................................................................
Patch Set 3:
Build Started http://jenkins.ovirt.org/job/vdsm_unit_tests_manual_gerrit/649/ (1/2)
-- To view, visit http://gerrit.ovirt.org/10758 To unsubscribe, visit http://gerrit.ovirt.org/settings
Gerrit-MessageType: comment Gerrit-Change-Id: If3b2008a3d9df2dcaf54190721c2dd9764338627 Gerrit-PatchSet: 3 Gerrit-Project: vdsm Gerrit-Branch: master Gerrit-Owner: Vered Volansky vvolansk@redhat.com Gerrit-Reviewer: Ayal Baron abaron@redhat.com Gerrit-Reviewer: Dan Kenigsberg danken@redhat.com Gerrit-Reviewer: Federico Simoncelli fsimonce@redhat.com Gerrit-Reviewer: Lee Yarwood lyarwood@redhat.com Gerrit-Reviewer: Royce Lv lvroyce@linux.vnet.ibm.com Gerrit-Reviewer: Vered Volansky vvolansk@redhat.com Gerrit-Reviewer: oVirt Jenkins CI Server
oVirt Jenkins CI Server has posted comments on this change.
Change subject: udev: Race fix- load and trigger dev rule(#891300) ......................................................................
Patch Set 3:
Build Started http://jenkins.ovirt.org/job/vdsm_pep8_gerrit/614/ (2/2)
-- To view, visit http://gerrit.ovirt.org/10758 To unsubscribe, visit http://gerrit.ovirt.org/settings
Gerrit-MessageType: comment Gerrit-Change-Id: If3b2008a3d9df2dcaf54190721c2dd9764338627 Gerrit-PatchSet: 3 Gerrit-Project: vdsm Gerrit-Branch: master Gerrit-Owner: Vered Volansky vvolansk@redhat.com Gerrit-Reviewer: Ayal Baron abaron@redhat.com Gerrit-Reviewer: Dan Kenigsberg danken@redhat.com Gerrit-Reviewer: Federico Simoncelli fsimonce@redhat.com Gerrit-Reviewer: Lee Yarwood lyarwood@redhat.com Gerrit-Reviewer: Royce Lv lvroyce@linux.vnet.ibm.com Gerrit-Reviewer: Vered Volansky vvolansk@redhat.com Gerrit-Reviewer: oVirt Jenkins CI Server
Vered Volansky has posted comments on this change.
Change subject: udev: Race fix- load and trigger dev rule(#891300) ......................................................................
Patch Set 3:
Also set settle timeout to 30
-- To view, visit http://gerrit.ovirt.org/10758 To unsubscribe, visit http://gerrit.ovirt.org/settings
Gerrit-MessageType: comment Gerrit-Change-Id: If3b2008a3d9df2dcaf54190721c2dd9764338627 Gerrit-PatchSet: 3 Gerrit-Project: vdsm Gerrit-Branch: master Gerrit-Owner: Vered Volansky vvolansk@redhat.com Gerrit-Reviewer: Ayal Baron abaron@redhat.com Gerrit-Reviewer: Dan Kenigsberg danken@redhat.com Gerrit-Reviewer: Federico Simoncelli fsimonce@redhat.com Gerrit-Reviewer: Lee Yarwood lyarwood@redhat.com Gerrit-Reviewer: Royce Lv lvroyce@linux.vnet.ibm.com Gerrit-Reviewer: Vered Volansky vvolansk@redhat.com Gerrit-Reviewer: oVirt Jenkins CI Server
oVirt Jenkins CI Server has posted comments on this change.
Change subject: udev: Race fix- load and trigger dev rule(#891300) ......................................................................
Patch Set 3:
Build Successful
http://jenkins.ovirt.org/job/vdsm_pep8_gerrit/614/ : SUCCESS
http://jenkins.ovirt.org/job/vdsm_unit_tests_manual_gerrit/649/ : SUCCESS
-- To view, visit http://gerrit.ovirt.org/10758 To unsubscribe, visit http://gerrit.ovirt.org/settings
Gerrit-MessageType: comment Gerrit-Change-Id: If3b2008a3d9df2dcaf54190721c2dd9764338627 Gerrit-PatchSet: 3 Gerrit-Project: vdsm Gerrit-Branch: master Gerrit-Owner: Vered Volansky vvolansk@redhat.com Gerrit-Reviewer: Ayal Baron abaron@redhat.com Gerrit-Reviewer: Dan Kenigsberg danken@redhat.com Gerrit-Reviewer: Federico Simoncelli fsimonce@redhat.com Gerrit-Reviewer: Lee Yarwood lyarwood@redhat.com Gerrit-Reviewer: Royce Lv lvroyce@linux.vnet.ibm.com Gerrit-Reviewer: Vered Volansky vvolansk@redhat.com Gerrit-Reviewer: oVirt Jenkins CI Server
Ayal Baron has posted comments on this change.
Change subject: udev: Race fix- load and trigger dev rule(#891300) ......................................................................
Patch Set 3: Looks good to me, but someone else must approve
-- To view, visit http://gerrit.ovirt.org/10758 To unsubscribe, visit http://gerrit.ovirt.org/settings
Gerrit-MessageType: comment Gerrit-Change-Id: If3b2008a3d9df2dcaf54190721c2dd9764338627 Gerrit-PatchSet: 3 Gerrit-Project: vdsm Gerrit-Branch: master Gerrit-Owner: Vered Volansky vvolansk@redhat.com Gerrit-Reviewer: Ayal Baron abaron@redhat.com Gerrit-Reviewer: Dan Kenigsberg danken@redhat.com Gerrit-Reviewer: Federico Simoncelli fsimonce@redhat.com Gerrit-Reviewer: Lee Yarwood lyarwood@redhat.com Gerrit-Reviewer: Royce Lv lvroyce@linux.vnet.ibm.com Gerrit-Reviewer: Vered Volansky vvolansk@redhat.com Gerrit-Reviewer: oVirt Jenkins CI Server
Dan Kenigsberg has posted comments on this change.
Change subject: udev: Race fix- load and trigger dev rule(#891300) ......................................................................
Patch Set 3: I would prefer that you didn't submit this
(3 inline comments)
.................................................... File vdsm/supervdsmServer.py Line 329: Line 330: def __udevVersion(self): Line 331: cmd = [EXT_UDEVADM, '--version'] Line 332: rc, out, err = misc.execCmd(cmd, sudo=False) Line 333: global version please try to avoid global variables. and certainly not with such a generic name.
please take a look at utils.memoize - I think that all you need is to decorate __udevVersion (after returning a value). Line 334: version = rc Line 335: Line 336: Line 337: def __isEnterprise(self):
Line 333: global version Line 334: version = rc Line 335: Line 336: Line 337: def __isEnterprise(self): the name is wrong, since on el7 is going to have __isEnterprise == False. Consider __udevHasReload or something in that spirit. Line 338: if version is None: Line 339: __udevVersion() Line 340: return version < 181 Line 341:
Line 336: Line 337: def __isEnterprise(self): Line 338: if version is None: Line 339: __udevVersion() Line 340: return version < 181 str and int comparison Line 341: Line 342: Line 343: def __pokeParent(parentPid, address, log): Line 344: try:
-- To view, visit http://gerrit.ovirt.org/10758 To unsubscribe, visit http://gerrit.ovirt.org/settings
Gerrit-MessageType: comment Gerrit-Change-Id: If3b2008a3d9df2dcaf54190721c2dd9764338627 Gerrit-PatchSet: 3 Gerrit-Project: vdsm Gerrit-Branch: master Gerrit-Owner: Vered Volansky vvolansk@redhat.com Gerrit-Reviewer: Ayal Baron abaron@redhat.com Gerrit-Reviewer: Dan Kenigsberg danken@redhat.com Gerrit-Reviewer: Federico Simoncelli fsimonce@redhat.com Gerrit-Reviewer: Lee Yarwood lyarwood@redhat.com Gerrit-Reviewer: Royce Lv lvroyce@linux.vnet.ibm.com Gerrit-Reviewer: Vered Volansky vvolansk@redhat.com Gerrit-Reviewer: oVirt Jenkins CI Server
Federico Simoncelli has posted comments on this change.
Change subject: udev: Race fix- load and trigger dev rule(#891300) ......................................................................
Patch Set 3: (3 inline comments)
.................................................... Commit Message Line 3: AuthorDate: 2013-01-08 12:37:07 +0200 Line 4: Commit: Vered Volansky vvolansk@redhat.com Line 5: CommitDate: 2013-01-09 17:01:31 +0200 Line 6: Line 7: udev: Race fix- load and trigger dev rule(#891300) Can you remove the bug citation from here. Bug-Url is enough. Line 8: Line 9: The rule file is generated, yet not synch-loaded in memory, so a VM with Line 10: a with a direct lun fails to start. Line 11: This patch inroduces two additional private udev functions:
.................................................... File vdsm/storage/hsm.py Line 2924: Warning: Internal use only. Line 2925: """ Line 2926: supervdsm.getProxy().appropriateDevice(guid, thiefId) Line 2927: supervdsm.getProxy().udevTrigger(guid) Line 2928: try: Ayal suggested a loop here waiting for fileUtils.validateQemuReadable to succeed (with the same timeout you already used). Maybe you could use "retry" from utils.py. This means that we can get rid of udevadm settle. Line 2929: devPath = '/dev/mapper/%s' % guid Line 2930: fileUtils.validateQemuReadable(devPath) Line 2931: except OSError: Line 2932: self.log.error("Failed to appropriate device permission")
Line 2925: """ Line 2926: supervdsm.getProxy().appropriateDevice(guid, thiefId) Line 2927: supervdsm.getProxy().udevTrigger(guid) Line 2928: try: Line 2929: devPath = '/dev/mapper/%s' % guid Use DMPATH_FORMAT devicemapper.py Line 2930: fileUtils.validateQemuReadable(devPath) Line 2931: except OSError: Line 2932: self.log.error("Failed to appropriate device permission") Line 2933: raise
-- To view, visit http://gerrit.ovirt.org/10758 To unsubscribe, visit http://gerrit.ovirt.org/settings
Gerrit-MessageType: comment Gerrit-Change-Id: If3b2008a3d9df2dcaf54190721c2dd9764338627 Gerrit-PatchSet: 3 Gerrit-Project: vdsm Gerrit-Branch: master Gerrit-Owner: Vered Volansky vvolansk@redhat.com Gerrit-Reviewer: Ayal Baron abaron@redhat.com Gerrit-Reviewer: Dan Kenigsberg danken@redhat.com Gerrit-Reviewer: Federico Simoncelli fsimonce@redhat.com Gerrit-Reviewer: Lee Yarwood lyarwood@redhat.com Gerrit-Reviewer: Royce Lv lvroyce@linux.vnet.ibm.com Gerrit-Reviewer: Vered Volansky vvolansk@redhat.com Gerrit-Reviewer: oVirt Jenkins CI Server
oVirt Jenkins CI Server has posted comments on this change.
Change subject: udev: Race fix- load and trigger dev rule ......................................................................
Patch Set 4:
Build Started http://jenkins.ovirt.org/job/vdsm_pep8_gerrit/624/ (2/2)
-- To view, visit http://gerrit.ovirt.org/10758 To unsubscribe, visit http://gerrit.ovirt.org/settings
Gerrit-MessageType: comment Gerrit-Change-Id: If3b2008a3d9df2dcaf54190721c2dd9764338627 Gerrit-PatchSet: 4 Gerrit-Project: vdsm Gerrit-Branch: master Gerrit-Owner: Vered Volansky vvolansk@redhat.com Gerrit-Reviewer: Ayal Baron abaron@redhat.com Gerrit-Reviewer: Dan Kenigsberg danken@redhat.com Gerrit-Reviewer: Federico Simoncelli fsimonce@redhat.com Gerrit-Reviewer: Lee Yarwood lyarwood@redhat.com Gerrit-Reviewer: Royce Lv lvroyce@linux.vnet.ibm.com Gerrit-Reviewer: Vered Volansky vvolansk@redhat.com Gerrit-Reviewer: oVirt Jenkins CI Server
oVirt Jenkins CI Server has posted comments on this change.
Change subject: udev: Race fix- load and trigger dev rule ......................................................................
Patch Set 4:
Build Started http://jenkins.ovirt.org/job/vdsm_unit_tests_manual_gerrit/659/ (1/2)
-- To view, visit http://gerrit.ovirt.org/10758 To unsubscribe, visit http://gerrit.ovirt.org/settings
Gerrit-MessageType: comment Gerrit-Change-Id: If3b2008a3d9df2dcaf54190721c2dd9764338627 Gerrit-PatchSet: 4 Gerrit-Project: vdsm Gerrit-Branch: master Gerrit-Owner: Vered Volansky vvolansk@redhat.com Gerrit-Reviewer: Ayal Baron abaron@redhat.com Gerrit-Reviewer: Dan Kenigsberg danken@redhat.com Gerrit-Reviewer: Federico Simoncelli fsimonce@redhat.com Gerrit-Reviewer: Lee Yarwood lyarwood@redhat.com Gerrit-Reviewer: Royce Lv lvroyce@linux.vnet.ibm.com Gerrit-Reviewer: Vered Volansky vvolansk@redhat.com Gerrit-Reviewer: oVirt Jenkins CI Server
oVirt Jenkins CI Server has posted comments on this change.
Change subject: udev: Race fix- load and trigger dev rule ......................................................................
Patch Set 4:
Build Successful
http://jenkins.ovirt.org/job/vdsm_pep8_gerrit/624/ : SUCCESS
http://jenkins.ovirt.org/job/vdsm_unit_tests_manual_gerrit/659/ : SUCCESS
-- To view, visit http://gerrit.ovirt.org/10758 To unsubscribe, visit http://gerrit.ovirt.org/settings
Gerrit-MessageType: comment Gerrit-Change-Id: If3b2008a3d9df2dcaf54190721c2dd9764338627 Gerrit-PatchSet: 4 Gerrit-Project: vdsm Gerrit-Branch: master Gerrit-Owner: Vered Volansky vvolansk@redhat.com Gerrit-Reviewer: Ayal Baron abaron@redhat.com Gerrit-Reviewer: Dan Kenigsberg danken@redhat.com Gerrit-Reviewer: Federico Simoncelli fsimonce@redhat.com Gerrit-Reviewer: Lee Yarwood lyarwood@redhat.com Gerrit-Reviewer: Royce Lv lvroyce@linux.vnet.ibm.com Gerrit-Reviewer: Vered Volansky vvolansk@redhat.com Gerrit-Reviewer: oVirt Jenkins CI Server
oVirt Jenkins CI Server has posted comments on this change.
Change subject: udev: Race fix- load and trigger dev rule ......................................................................
Patch Set 5:
Build Started http://jenkins.ovirt.org/job/vdsm_pep8_gerrit/626/ (2/2)
-- To view, visit http://gerrit.ovirt.org/10758 To unsubscribe, visit http://gerrit.ovirt.org/settings
Gerrit-MessageType: comment Gerrit-Change-Id: If3b2008a3d9df2dcaf54190721c2dd9764338627 Gerrit-PatchSet: 5 Gerrit-Project: vdsm Gerrit-Branch: master Gerrit-Owner: Vered Volansky vvolansk@redhat.com Gerrit-Reviewer: Ayal Baron abaron@redhat.com Gerrit-Reviewer: Dan Kenigsberg danken@redhat.com Gerrit-Reviewer: Federico Simoncelli fsimonce@redhat.com Gerrit-Reviewer: Lee Yarwood lyarwood@redhat.com Gerrit-Reviewer: Royce Lv lvroyce@linux.vnet.ibm.com Gerrit-Reviewer: Vered Volansky vvolansk@redhat.com Gerrit-Reviewer: oVirt Jenkins CI Server
oVirt Jenkins CI Server has posted comments on this change.
Change subject: udev: Race fix- load and trigger dev rule ......................................................................
Patch Set 5:
Build Started http://jenkins.ovirt.org/job/vdsm_unit_tests_manual_gerrit/661/ (1/2)
-- To view, visit http://gerrit.ovirt.org/10758 To unsubscribe, visit http://gerrit.ovirt.org/settings
Gerrit-MessageType: comment Gerrit-Change-Id: If3b2008a3d9df2dcaf54190721c2dd9764338627 Gerrit-PatchSet: 5 Gerrit-Project: vdsm Gerrit-Branch: master Gerrit-Owner: Vered Volansky vvolansk@redhat.com Gerrit-Reviewer: Ayal Baron abaron@redhat.com Gerrit-Reviewer: Dan Kenigsberg danken@redhat.com Gerrit-Reviewer: Federico Simoncelli fsimonce@redhat.com Gerrit-Reviewer: Lee Yarwood lyarwood@redhat.com Gerrit-Reviewer: Royce Lv lvroyce@linux.vnet.ibm.com Gerrit-Reviewer: Vered Volansky vvolansk@redhat.com Gerrit-Reviewer: oVirt Jenkins CI Server
Federico Simoncelli has posted comments on this change.
Change subject: udev: Race fix- load and trigger dev rule ......................................................................
Patch Set 5: Looks good to me, but someone else must approve
-- To view, visit http://gerrit.ovirt.org/10758 To unsubscribe, visit http://gerrit.ovirt.org/settings
Gerrit-MessageType: comment Gerrit-Change-Id: If3b2008a3d9df2dcaf54190721c2dd9764338627 Gerrit-PatchSet: 5 Gerrit-Project: vdsm Gerrit-Branch: master Gerrit-Owner: Vered Volansky vvolansk@redhat.com Gerrit-Reviewer: Ayal Baron abaron@redhat.com Gerrit-Reviewer: Dan Kenigsberg danken@redhat.com Gerrit-Reviewer: Federico Simoncelli fsimonce@redhat.com Gerrit-Reviewer: Lee Yarwood lyarwood@redhat.com Gerrit-Reviewer: Royce Lv lvroyce@linux.vnet.ibm.com Gerrit-Reviewer: Vered Volansky vvolansk@redhat.com Gerrit-Reviewer: oVirt Jenkins CI Server
oVirt Jenkins CI Server has posted comments on this change.
Change subject: udev: Race fix- load and trigger dev rule ......................................................................
Patch Set 5:
Build Successful
http://jenkins.ovirt.org/job/vdsm_pep8_gerrit/626/ : SUCCESS
http://jenkins.ovirt.org/job/vdsm_unit_tests_manual_gerrit/661/ : SUCCESS
-- To view, visit http://gerrit.ovirt.org/10758 To unsubscribe, visit http://gerrit.ovirt.org/settings
Gerrit-MessageType: comment Gerrit-Change-Id: If3b2008a3d9df2dcaf54190721c2dd9764338627 Gerrit-PatchSet: 5 Gerrit-Project: vdsm Gerrit-Branch: master Gerrit-Owner: Vered Volansky vvolansk@redhat.com Gerrit-Reviewer: Ayal Baron abaron@redhat.com Gerrit-Reviewer: Dan Kenigsberg danken@redhat.com Gerrit-Reviewer: Federico Simoncelli fsimonce@redhat.com Gerrit-Reviewer: Lee Yarwood lyarwood@redhat.com Gerrit-Reviewer: Royce Lv lvroyce@linux.vnet.ibm.com Gerrit-Reviewer: Vered Volansky vvolansk@redhat.com Gerrit-Reviewer: oVirt Jenkins CI Server
oVirt Jenkins CI Server has posted comments on this change.
Change subject: udev: Race fix- load and trigger dev rule ......................................................................
Patch Set 6:
Build Started http://jenkins.ovirt.org/job/vdsm_pep8_gerrit/629/ (2/2)
-- To view, visit http://gerrit.ovirt.org/10758 To unsubscribe, visit http://gerrit.ovirt.org/settings
Gerrit-MessageType: comment Gerrit-Change-Id: If3b2008a3d9df2dcaf54190721c2dd9764338627 Gerrit-PatchSet: 6 Gerrit-Project: vdsm Gerrit-Branch: master Gerrit-Owner: Vered Volansky vvolansk@redhat.com Gerrit-Reviewer: Ayal Baron abaron@redhat.com Gerrit-Reviewer: Dan Kenigsberg danken@redhat.com Gerrit-Reviewer: Federico Simoncelli fsimonce@redhat.com Gerrit-Reviewer: Lee Yarwood lyarwood@redhat.com Gerrit-Reviewer: Royce Lv lvroyce@linux.vnet.ibm.com Gerrit-Reviewer: Vered Volansky vvolansk@redhat.com Gerrit-Reviewer: oVirt Jenkins CI Server
oVirt Jenkins CI Server has posted comments on this change.
Change subject: udev: Race fix- load and trigger dev rule ......................................................................
Patch Set 6:
Build Started http://jenkins.ovirt.org/job/vdsm_unit_tests_manual_gerrit/664/ (1/2)
-- To view, visit http://gerrit.ovirt.org/10758 To unsubscribe, visit http://gerrit.ovirt.org/settings
Gerrit-MessageType: comment Gerrit-Change-Id: If3b2008a3d9df2dcaf54190721c2dd9764338627 Gerrit-PatchSet: 6 Gerrit-Project: vdsm Gerrit-Branch: master Gerrit-Owner: Vered Volansky vvolansk@redhat.com Gerrit-Reviewer: Ayal Baron abaron@redhat.com Gerrit-Reviewer: Dan Kenigsberg danken@redhat.com Gerrit-Reviewer: Federico Simoncelli fsimonce@redhat.com Gerrit-Reviewer: Lee Yarwood lyarwood@redhat.com Gerrit-Reviewer: Royce Lv lvroyce@linux.vnet.ibm.com Gerrit-Reviewer: Vered Volansky vvolansk@redhat.com Gerrit-Reviewer: oVirt Jenkins CI Server
oVirt Jenkins CI Server has posted comments on this change.
Change subject: udev: Race fix- load and trigger dev rule ......................................................................
Patch Set 6:
Build Successful
http://jenkins.ovirt.org/job/vdsm_pep8_gerrit/629/ : SUCCESS
http://jenkins.ovirt.org/job/vdsm_unit_tests_manual_gerrit/664/ : SUCCESS
-- To view, visit http://gerrit.ovirt.org/10758 To unsubscribe, visit http://gerrit.ovirt.org/settings
Gerrit-MessageType: comment Gerrit-Change-Id: If3b2008a3d9df2dcaf54190721c2dd9764338627 Gerrit-PatchSet: 6 Gerrit-Project: vdsm Gerrit-Branch: master Gerrit-Owner: Vered Volansky vvolansk@redhat.com Gerrit-Reviewer: Ayal Baron abaron@redhat.com Gerrit-Reviewer: Dan Kenigsberg danken@redhat.com Gerrit-Reviewer: Federico Simoncelli fsimonce@redhat.com Gerrit-Reviewer: Lee Yarwood lyarwood@redhat.com Gerrit-Reviewer: Royce Lv lvroyce@linux.vnet.ibm.com Gerrit-Reviewer: Vered Volansky vvolansk@redhat.com Gerrit-Reviewer: oVirt Jenkins CI Server
Federico Simoncelli has posted comments on this change.
Change subject: udev: Race fix- load and trigger dev rule ......................................................................
Patch Set 6: Looks good to me, but someone else must approve
-- To view, visit http://gerrit.ovirt.org/10758 To unsubscribe, visit http://gerrit.ovirt.org/settings
Gerrit-MessageType: comment Gerrit-Change-Id: If3b2008a3d9df2dcaf54190721c2dd9764338627 Gerrit-PatchSet: 6 Gerrit-Project: vdsm Gerrit-Branch: master Gerrit-Owner: Vered Volansky vvolansk@redhat.com Gerrit-Reviewer: Ayal Baron abaron@redhat.com Gerrit-Reviewer: Dan Kenigsberg danken@redhat.com Gerrit-Reviewer: Federico Simoncelli fsimonce@redhat.com Gerrit-Reviewer: Lee Yarwood lyarwood@redhat.com Gerrit-Reviewer: Royce Lv lvroyce@linux.vnet.ibm.com Gerrit-Reviewer: Vered Volansky vvolansk@redhat.com Gerrit-Reviewer: oVirt Jenkins CI Server
Ayal Baron has posted comments on this change.
Change subject: udev: Race fix- load and trigger dev rule ......................................................................
Patch Set 6: Looks good to me, approved
-- To view, visit http://gerrit.ovirt.org/10758 To unsubscribe, visit http://gerrit.ovirt.org/settings
Gerrit-MessageType: comment Gerrit-Change-Id: If3b2008a3d9df2dcaf54190721c2dd9764338627 Gerrit-PatchSet: 6 Gerrit-Project: vdsm Gerrit-Branch: master Gerrit-Owner: Vered Volansky vvolansk@redhat.com Gerrit-Reviewer: Ayal Baron abaron@redhat.com Gerrit-Reviewer: Dan Kenigsberg danken@redhat.com Gerrit-Reviewer: Federico Simoncelli fsimonce@redhat.com Gerrit-Reviewer: Lee Yarwood lyarwood@redhat.com Gerrit-Reviewer: Royce Lv lvroyce@linux.vnet.ibm.com Gerrit-Reviewer: Vered Volansky vvolansk@redhat.com Gerrit-Reviewer: oVirt Jenkins CI Server
Federico Simoncelli has posted comments on this change.
Change subject: udev: Race fix- load and trigger dev rule ......................................................................
Patch Set 6: (5 inline comments)
Few small (and completely optional) enhancement. The logging part should be tested.
.................................................... File vdsm/supervdsmServer.py Line 89: Line 90: Line 91: class _SuperVdsm(object): Line 92: Line 93: UDEV_WITH_RELOAD_VERION = 181 Typo UDEV_WITH_RELOAD_VERSION Line 94: Line 95: @logDecorator Line 96: def ping(self, *args, **kwargs): Line 97: # This method exists for testing purposes
Line 90: Line 91: class _SuperVdsm(object): Line 92: Line 93: UDEV_WITH_RELOAD_VERION = 181 Line 94: We can define a log object here, probably with:
log = logging.getLogger("SuperVdsm.ServerCallback") Line 95: @logDecorator Line 96: def ping(self, *args, **kwargs): Line 97: # This method exists for testing purposes Line 98: return True
Line 234: '--property-match=DM_NAME=%s' % guid] Line 235: rc, out, err = misc.execCmd(cmd, sudo=False) Line 236: if rc: Line 237: raise OSError(errno.EINVAL, "Could not trigger change for device \ Line 238: %s, out %s\nerr %s" % (guid, out, err)) Now that we have the logger we can separate logging and exceptions:
log.error("Udevadm trigger command failed rc=%s, out="%s", err="%s"", rc, out, err) raise OSError(errno.EINVAL, "Could not trigger change for device %s" % guid) Line 239: Line 240: @logDecorator Line 241: def appropriateDevice(self, guid, thiefId): Line 242: ruleFile = _UDEV_RULE_FILE_NAME % (guid, thiefId)
Line 314: cmd = [EXT_UDEVADM, 'control', reload] Line 315: rc, out, err = misc.execCmd(cmd, sudo=False) Line 316: if rc: Line 317: raise OSError(errno.EINVAL, "Could not reload-rules for device \ Line 318: %s, out %s\nerr %s" % (guid, out, err)) Split this in logging/exception as above. Line 319: Line 320: Line 321: @utils.memoized Line 322: def __udevVersion(self):
Line 321: @utils.memoized Line 322: def __udevVersion(self): Line 323: cmd = [EXT_UDEVADM, '--version'] Line 324: rc, out, err = misc.execCmd(cmd, sudo=False) Line 325: if rc: logging for rc, out, err. Line 326: raise RuntimeError("Could not get udev version number") Line 327: return int(out) Line 328: Line 329:
-- To view, visit http://gerrit.ovirt.org/10758 To unsubscribe, visit http://gerrit.ovirt.org/settings
Gerrit-MessageType: comment Gerrit-Change-Id: If3b2008a3d9df2dcaf54190721c2dd9764338627 Gerrit-PatchSet: 6 Gerrit-Project: vdsm Gerrit-Branch: master Gerrit-Owner: Vered Volansky vvolansk@redhat.com Gerrit-Reviewer: Ayal Baron abaron@redhat.com Gerrit-Reviewer: Dan Kenigsberg danken@redhat.com Gerrit-Reviewer: Federico Simoncelli fsimonce@redhat.com Gerrit-Reviewer: Lee Yarwood lyarwood@redhat.com Gerrit-Reviewer: Royce Lv lvroyce@linux.vnet.ibm.com Gerrit-Reviewer: Vered Volansky vvolansk@redhat.com Gerrit-Reviewer: oVirt Jenkins CI Server
oVirt Jenkins CI Server has posted comments on this change.
Change subject: udev: Race fix- load and trigger dev rule ......................................................................
Patch Set 7:
Build Started http://jenkins.ovirt.org/job/vdsm_pep8_gerrit/656/ (1/2)
-- To view, visit http://gerrit.ovirt.org/10758 To unsubscribe, visit http://gerrit.ovirt.org/settings
Gerrit-MessageType: comment Gerrit-Change-Id: If3b2008a3d9df2dcaf54190721c2dd9764338627 Gerrit-PatchSet: 7 Gerrit-Project: vdsm Gerrit-Branch: master Gerrit-Owner: Vered Volansky vvolansk@redhat.com Gerrit-Reviewer: Ayal Baron abaron@redhat.com Gerrit-Reviewer: Dan Kenigsberg danken@redhat.com Gerrit-Reviewer: Federico Simoncelli fsimonce@redhat.com Gerrit-Reviewer: Lee Yarwood lyarwood@redhat.com Gerrit-Reviewer: Royce Lv lvroyce@linux.vnet.ibm.com Gerrit-Reviewer: Vered Volansky vvolansk@redhat.com Gerrit-Reviewer: oVirt Jenkins CI Server
oVirt Jenkins CI Server has posted comments on this change.
Change subject: udev: Race fix- load and trigger dev rule ......................................................................
Patch Set 7:
Build Started http://jenkins.ovirt.org/job/vdsm_unit_tests_manual_gerrit/691/ (2/2)
-- To view, visit http://gerrit.ovirt.org/10758 To unsubscribe, visit http://gerrit.ovirt.org/settings
Gerrit-MessageType: comment Gerrit-Change-Id: If3b2008a3d9df2dcaf54190721c2dd9764338627 Gerrit-PatchSet: 7 Gerrit-Project: vdsm Gerrit-Branch: master Gerrit-Owner: Vered Volansky vvolansk@redhat.com Gerrit-Reviewer: Ayal Baron abaron@redhat.com Gerrit-Reviewer: Dan Kenigsberg danken@redhat.com Gerrit-Reviewer: Federico Simoncelli fsimonce@redhat.com Gerrit-Reviewer: Lee Yarwood lyarwood@redhat.com Gerrit-Reviewer: Royce Lv lvroyce@linux.vnet.ibm.com Gerrit-Reviewer: Vered Volansky vvolansk@redhat.com Gerrit-Reviewer: oVirt Jenkins CI Server
oVirt Jenkins CI Server has posted comments on this change.
Change subject: udev: Race fix- load and trigger dev rule ......................................................................
Patch Set 7:
Build Successful
http://jenkins.ovirt.org/job/vdsm_pep8_gerrit/656/ : SUCCESS
http://jenkins.ovirt.org/job/vdsm_unit_tests_manual_gerrit/691/ : SUCCESS
-- To view, visit http://gerrit.ovirt.org/10758 To unsubscribe, visit http://gerrit.ovirt.org/settings
Gerrit-MessageType: comment Gerrit-Change-Id: If3b2008a3d9df2dcaf54190721c2dd9764338627 Gerrit-PatchSet: 7 Gerrit-Project: vdsm Gerrit-Branch: master Gerrit-Owner: Vered Volansky vvolansk@redhat.com Gerrit-Reviewer: Ayal Baron abaron@redhat.com Gerrit-Reviewer: Dan Kenigsberg danken@redhat.com Gerrit-Reviewer: Federico Simoncelli fsimonce@redhat.com Gerrit-Reviewer: Lee Yarwood lyarwood@redhat.com Gerrit-Reviewer: Royce Lv lvroyce@linux.vnet.ibm.com Gerrit-Reviewer: Vered Volansky vvolansk@redhat.com Gerrit-Reviewer: oVirt Jenkins CI Server
Ayal Baron has posted comments on this change.
Change subject: udev: Race fix- load and trigger dev rule ......................................................................
Patch Set 7: (1 inline comment)
.................................................... File vdsm/supervdsmServer.py Line 235: cmd = [EXT_UDEVADM, 'trigger', '--verbose', '--action', 'change', Line 236: '--property-match=DM_NAME=%s' % guid] Line 237: rc, out, err = misc.execCmd(cmd, sudo=False) Line 238: if rc: Line 239: _SuperVdsm.log.error("Udevadm trigger command failed rc=%s, \ need to use self (everywhere) Line 240: out="%s", err="%s"", rc, out, err) Line 241: raise OSError(errno.EINVAL, "Could not trigger change for device \ Line 242: %s" % guid) Line 243:
-- To view, visit http://gerrit.ovirt.org/10758 To unsubscribe, visit http://gerrit.ovirt.org/settings
Gerrit-MessageType: comment Gerrit-Change-Id: If3b2008a3d9df2dcaf54190721c2dd9764338627 Gerrit-PatchSet: 7 Gerrit-Project: vdsm Gerrit-Branch: master Gerrit-Owner: Vered Volansky vvolansk@redhat.com Gerrit-Reviewer: Ayal Baron abaron@redhat.com Gerrit-Reviewer: Dan Kenigsberg danken@redhat.com Gerrit-Reviewer: Federico Simoncelli fsimonce@redhat.com Gerrit-Reviewer: Lee Yarwood lyarwood@redhat.com Gerrit-Reviewer: Royce Lv lvroyce@linux.vnet.ibm.com Gerrit-Reviewer: Vered Volansky vvolansk@redhat.com Gerrit-Reviewer: oVirt Jenkins CI Server
oVirt Jenkins CI Server has posted comments on this change.
Change subject: udev: Race fix- load and trigger dev rule ......................................................................
Patch Set 8:
Build Started http://jenkins.ovirt.org/job/vdsm_pep8_gerrit/657/ (2/2)
-- To view, visit http://gerrit.ovirt.org/10758 To unsubscribe, visit http://gerrit.ovirt.org/settings
Gerrit-MessageType: comment Gerrit-Change-Id: If3b2008a3d9df2dcaf54190721c2dd9764338627 Gerrit-PatchSet: 8 Gerrit-Project: vdsm Gerrit-Branch: master Gerrit-Owner: Vered Volansky vvolansk@redhat.com Gerrit-Reviewer: Ayal Baron abaron@redhat.com Gerrit-Reviewer: Dan Kenigsberg danken@redhat.com Gerrit-Reviewer: Federico Simoncelli fsimonce@redhat.com Gerrit-Reviewer: Lee Yarwood lyarwood@redhat.com Gerrit-Reviewer: Royce Lv lvroyce@linux.vnet.ibm.com Gerrit-Reviewer: Vered Volansky vvolansk@redhat.com Gerrit-Reviewer: oVirt Jenkins CI Server
oVirt Jenkins CI Server has posted comments on this change.
Change subject: udev: Race fix- load and trigger dev rule ......................................................................
Patch Set 8:
Build Started http://jenkins.ovirt.org/job/vdsm_unit_tests_manual_gerrit/692/ (1/2)
-- To view, visit http://gerrit.ovirt.org/10758 To unsubscribe, visit http://gerrit.ovirt.org/settings
Gerrit-MessageType: comment Gerrit-Change-Id: If3b2008a3d9df2dcaf54190721c2dd9764338627 Gerrit-PatchSet: 8 Gerrit-Project: vdsm Gerrit-Branch: master Gerrit-Owner: Vered Volansky vvolansk@redhat.com Gerrit-Reviewer: Ayal Baron abaron@redhat.com Gerrit-Reviewer: Dan Kenigsberg danken@redhat.com Gerrit-Reviewer: Federico Simoncelli fsimonce@redhat.com Gerrit-Reviewer: Lee Yarwood lyarwood@redhat.com Gerrit-Reviewer: Royce Lv lvroyce@linux.vnet.ibm.com Gerrit-Reviewer: Vered Volansky vvolansk@redhat.com Gerrit-Reviewer: oVirt Jenkins CI Server
oVirt Jenkins CI Server has posted comments on this change.
Change subject: udev: Race fix- load and trigger dev rule ......................................................................
Patch Set 8:
Build Successful
http://jenkins.ovirt.org/job/vdsm_pep8_gerrit/657/ : SUCCESS
http://jenkins.ovirt.org/job/vdsm_unit_tests_manual_gerrit/692/ : SUCCESS
-- To view, visit http://gerrit.ovirt.org/10758 To unsubscribe, visit http://gerrit.ovirt.org/settings
Gerrit-MessageType: comment Gerrit-Change-Id: If3b2008a3d9df2dcaf54190721c2dd9764338627 Gerrit-PatchSet: 8 Gerrit-Project: vdsm Gerrit-Branch: master Gerrit-Owner: Vered Volansky vvolansk@redhat.com Gerrit-Reviewer: Ayal Baron abaron@redhat.com Gerrit-Reviewer: Dan Kenigsberg danken@redhat.com Gerrit-Reviewer: Federico Simoncelli fsimonce@redhat.com Gerrit-Reviewer: Lee Yarwood lyarwood@redhat.com Gerrit-Reviewer: Royce Lv lvroyce@linux.vnet.ibm.com Gerrit-Reviewer: Vered Volansky vvolansk@redhat.com Gerrit-Reviewer: oVirt Jenkins CI Server
Vered Volansky has posted comments on this change.
Change subject: udev: Race fix- load and trigger dev rule ......................................................................
Patch Set 7: (1 inline comment)
.................................................... File vdsm/supervdsmServer.py Line 235: cmd = [EXT_UDEVADM, 'trigger', '--verbose', '--action', 'change', Line 236: '--property-match=DM_NAME=%s' % guid] Line 237: rc, out, err = misc.execCmd(cmd, sudo=False) Line 238: if rc: Line 239: _SuperVdsm.log.error("Udevadm trigger command failed rc=%s, \ Done. Also changed in UDEV_WITH_RELOAD_VERSION use. Line 240: out="%s", err="%s"", rc, out, err) Line 241: raise OSError(errno.EINVAL, "Could not trigger change for device \ Line 242: %s" % guid) Line 243:
-- To view, visit http://gerrit.ovirt.org/10758 To unsubscribe, visit http://gerrit.ovirt.org/settings
Gerrit-MessageType: comment Gerrit-Change-Id: If3b2008a3d9df2dcaf54190721c2dd9764338627 Gerrit-PatchSet: 7 Gerrit-Project: vdsm Gerrit-Branch: master Gerrit-Owner: Vered Volansky vvolansk@redhat.com Gerrit-Reviewer: Ayal Baron abaron@redhat.com Gerrit-Reviewer: Dan Kenigsberg danken@redhat.com Gerrit-Reviewer: Federico Simoncelli fsimonce@redhat.com Gerrit-Reviewer: Lee Yarwood lyarwood@redhat.com Gerrit-Reviewer: Royce Lv lvroyce@linux.vnet.ibm.com Gerrit-Reviewer: Vered Volansky vvolansk@redhat.com Gerrit-Reviewer: oVirt Jenkins CI Server
Dan Kenigsberg has posted comments on this change.
Change subject: udev: Race fix- load and trigger dev rule ......................................................................
Patch Set 8: I would prefer that you didn't submit this
(2 inline comments)
.................................................... File vdsm/supervdsmServer.py Line 236: '--property-match=DM_NAME=%s' % guid] Line 237: rc, out, err = misc.execCmd(cmd, sudo=False) Line 238: if rc: Line 239: self.log.error("Udevadm trigger command failed rc=%s, \ Line 240: out="%s", err="%s"", rc, out, err) underindent would fail pep8 on f18. (here and elsewhere) Line 241: raise OSError(errno.EINVAL, "Could not trigger change for device \ Line 242: %s" % guid) Line 243: Line 244: @logDecorator
Line 317: reload = '--reload' if __udevOperationReload() else '--reload-rules' Line 318: cmd = [EXT_UDEVADM, 'control', reload] Line 319: rc, out, err = misc.execCmd(cmd, sudo=False) Line 320: if rc: Line 321: self.log.error("Udevadm reload-rules command failed rc=%s, \ too many spaces in string (try it out and see).
better break line with
( "Udevadm reload-rules command failed rc=%s, " "out="%s", err="%s"" )
and use single quotes to avoid annoying escaping. Line 322: out="%s", err="%s"", rc, out, err) Line 323: raise OSError(errno.EINVAL, "Could not reload-rules for device \ Line 324: %s" % guid) Line 325:
-- To view, visit http://gerrit.ovirt.org/10758 To unsubscribe, visit http://gerrit.ovirt.org/settings
Gerrit-MessageType: comment Gerrit-Change-Id: If3b2008a3d9df2dcaf54190721c2dd9764338627 Gerrit-PatchSet: 8 Gerrit-Project: vdsm Gerrit-Branch: master Gerrit-Owner: Vered Volansky vvolansk@redhat.com Gerrit-Reviewer: Ayal Baron abaron@redhat.com Gerrit-Reviewer: Dan Kenigsberg danken@redhat.com Gerrit-Reviewer: Federico Simoncelli fsimonce@redhat.com Gerrit-Reviewer: Lee Yarwood lyarwood@redhat.com Gerrit-Reviewer: Royce Lv lvroyce@linux.vnet.ibm.com Gerrit-Reviewer: Vered Volansky vvolansk@redhat.com Gerrit-Reviewer: oVirt Jenkins CI Server
oVirt Jenkins CI Server has posted comments on this change.
Change subject: udev: Race fix- load and trigger dev rule ......................................................................
Patch Set 9:
Build Started http://jenkins.ovirt.org/job/vdsm_pep8_gerrit/661/ (2/2)
-- To view, visit http://gerrit.ovirt.org/10758 To unsubscribe, visit http://gerrit.ovirt.org/settings
Gerrit-MessageType: comment Gerrit-Change-Id: If3b2008a3d9df2dcaf54190721c2dd9764338627 Gerrit-PatchSet: 9 Gerrit-Project: vdsm Gerrit-Branch: master Gerrit-Owner: Vered Volansky vvolansk@redhat.com Gerrit-Reviewer: Ayal Baron abaron@redhat.com Gerrit-Reviewer: Dan Kenigsberg danken@redhat.com Gerrit-Reviewer: Federico Simoncelli fsimonce@redhat.com Gerrit-Reviewer: Lee Yarwood lyarwood@redhat.com Gerrit-Reviewer: Royce Lv lvroyce@linux.vnet.ibm.com Gerrit-Reviewer: Vered Volansky vvolansk@redhat.com Gerrit-Reviewer: oVirt Jenkins CI Server
oVirt Jenkins CI Server has posted comments on this change.
Change subject: udev: Race fix- load and trigger dev rule ......................................................................
Patch Set 9:
Build Started http://jenkins.ovirt.org/job/vdsm_unit_tests_manual_gerrit/696/ (1/2)
-- To view, visit http://gerrit.ovirt.org/10758 To unsubscribe, visit http://gerrit.ovirt.org/settings
Gerrit-MessageType: comment Gerrit-Change-Id: If3b2008a3d9df2dcaf54190721c2dd9764338627 Gerrit-PatchSet: 9 Gerrit-Project: vdsm Gerrit-Branch: master Gerrit-Owner: Vered Volansky vvolansk@redhat.com Gerrit-Reviewer: Ayal Baron abaron@redhat.com Gerrit-Reviewer: Dan Kenigsberg danken@redhat.com Gerrit-Reviewer: Federico Simoncelli fsimonce@redhat.com Gerrit-Reviewer: Lee Yarwood lyarwood@redhat.com Gerrit-Reviewer: Royce Lv lvroyce@linux.vnet.ibm.com Gerrit-Reviewer: Vered Volansky vvolansk@redhat.com Gerrit-Reviewer: oVirt Jenkins CI Server
oVirt Jenkins CI Server has posted comments on this change.
Change subject: udev: Race fix- load and trigger dev rule ......................................................................
Patch Set 9:
Build Successful
http://jenkins.ovirt.org/job/vdsm_pep8_gerrit/661/ : SUCCESS
http://jenkins.ovirt.org/job/vdsm_unit_tests_manual_gerrit/696/ : SUCCESS
-- To view, visit http://gerrit.ovirt.org/10758 To unsubscribe, visit http://gerrit.ovirt.org/settings
Gerrit-MessageType: comment Gerrit-Change-Id: If3b2008a3d9df2dcaf54190721c2dd9764338627 Gerrit-PatchSet: 9 Gerrit-Project: vdsm Gerrit-Branch: master Gerrit-Owner: Vered Volansky vvolansk@redhat.com Gerrit-Reviewer: Ayal Baron abaron@redhat.com Gerrit-Reviewer: Dan Kenigsberg danken@redhat.com Gerrit-Reviewer: Federico Simoncelli fsimonce@redhat.com Gerrit-Reviewer: Lee Yarwood lyarwood@redhat.com Gerrit-Reviewer: Royce Lv lvroyce@linux.vnet.ibm.com Gerrit-Reviewer: Vered Volansky vvolansk@redhat.com Gerrit-Reviewer: oVirt Jenkins CI Server
Vered Volansky has posted comments on this change.
Change subject: udev: Race fix- load and trigger dev rule ......................................................................
Patch Set 9:
This is actually patch #6, which have been acked before. This is the patch being verified d/s. Later changes will be re-added in another patch, including last patch's comments.
-- To view, visit http://gerrit.ovirt.org/10758 To unsubscribe, visit http://gerrit.ovirt.org/settings
Gerrit-MessageType: comment Gerrit-Change-Id: If3b2008a3d9df2dcaf54190721c2dd9764338627 Gerrit-PatchSet: 9 Gerrit-Project: vdsm Gerrit-Branch: master Gerrit-Owner: Vered Volansky vvolansk@redhat.com Gerrit-Reviewer: Ayal Baron abaron@redhat.com Gerrit-Reviewer: Dan Kenigsberg danken@redhat.com Gerrit-Reviewer: Federico Simoncelli fsimonce@redhat.com Gerrit-Reviewer: Lee Yarwood lyarwood@redhat.com Gerrit-Reviewer: Royce Lv lvroyce@linux.vnet.ibm.com Gerrit-Reviewer: Vered Volansky vvolansk@redhat.com Gerrit-Reviewer: oVirt Jenkins CI Server
oVirt Jenkins CI Server has posted comments on this change.
Change subject: udev: Race fix- load and trigger dev rule ......................................................................
Patch Set 10:
Build Started http://jenkins.ovirt.org/job/vdsm_pep8_gerrit/662/ (1/2)
-- To view, visit http://gerrit.ovirt.org/10758 To unsubscribe, visit http://gerrit.ovirt.org/settings
Gerrit-MessageType: comment Gerrit-Change-Id: If3b2008a3d9df2dcaf54190721c2dd9764338627 Gerrit-PatchSet: 10 Gerrit-Project: vdsm Gerrit-Branch: master Gerrit-Owner: Vered Volansky vvolansk@redhat.com Gerrit-Reviewer: Ayal Baron abaron@redhat.com Gerrit-Reviewer: Dan Kenigsberg danken@redhat.com Gerrit-Reviewer: Federico Simoncelli fsimonce@redhat.com Gerrit-Reviewer: Lee Yarwood lyarwood@redhat.com Gerrit-Reviewer: Royce Lv lvroyce@linux.vnet.ibm.com Gerrit-Reviewer: Vered Volansky vvolansk@redhat.com Gerrit-Reviewer: oVirt Jenkins CI Server
oVirt Jenkins CI Server has posted comments on this change.
Change subject: udev: Race fix- load and trigger dev rule ......................................................................
Patch Set 10:
Build Started http://jenkins.ovirt.org/job/vdsm_unit_tests_manual_gerrit/697/ (2/2)
-- To view, visit http://gerrit.ovirt.org/10758 To unsubscribe, visit http://gerrit.ovirt.org/settings
Gerrit-MessageType: comment Gerrit-Change-Id: If3b2008a3d9df2dcaf54190721c2dd9764338627 Gerrit-PatchSet: 10 Gerrit-Project: vdsm Gerrit-Branch: master Gerrit-Owner: Vered Volansky vvolansk@redhat.com Gerrit-Reviewer: Ayal Baron abaron@redhat.com Gerrit-Reviewer: Dan Kenigsberg danken@redhat.com Gerrit-Reviewer: Federico Simoncelli fsimonce@redhat.com Gerrit-Reviewer: Lee Yarwood lyarwood@redhat.com Gerrit-Reviewer: Royce Lv lvroyce@linux.vnet.ibm.com Gerrit-Reviewer: Vered Volansky vvolansk@redhat.com Gerrit-Reviewer: oVirt Jenkins CI Server
oVirt Jenkins CI Server has posted comments on this change.
Change subject: udev: Race fix- load and trigger dev rule ......................................................................
Patch Set 10:
Build Successful
http://jenkins.ovirt.org/job/vdsm_pep8_gerrit/662/ : SUCCESS
http://jenkins.ovirt.org/job/vdsm_unit_tests_manual_gerrit/697/ : SUCCESS
-- To view, visit http://gerrit.ovirt.org/10758 To unsubscribe, visit http://gerrit.ovirt.org/settings
Gerrit-MessageType: comment Gerrit-Change-Id: If3b2008a3d9df2dcaf54190721c2dd9764338627 Gerrit-PatchSet: 10 Gerrit-Project: vdsm Gerrit-Branch: master Gerrit-Owner: Vered Volansky vvolansk@redhat.com Gerrit-Reviewer: Ayal Baron abaron@redhat.com Gerrit-Reviewer: Dan Kenigsberg danken@redhat.com Gerrit-Reviewer: Federico Simoncelli fsimonce@redhat.com Gerrit-Reviewer: Lee Yarwood lyarwood@redhat.com Gerrit-Reviewer: Royce Lv lvroyce@linux.vnet.ibm.com Gerrit-Reviewer: Vered Volansky vvolansk@redhat.com Gerrit-Reviewer: oVirt Jenkins CI Server
Federico Simoncelli has posted comments on this change.
Change subject: udev: Race fix- load and trigger dev rule ......................................................................
Patch Set 10: Looks good to me, but someone else must approve
-- To view, visit http://gerrit.ovirt.org/10758 To unsubscribe, visit http://gerrit.ovirt.org/settings
Gerrit-MessageType: comment Gerrit-Change-Id: If3b2008a3d9df2dcaf54190721c2dd9764338627 Gerrit-PatchSet: 10 Gerrit-Project: vdsm Gerrit-Branch: master Gerrit-Owner: Vered Volansky vvolansk@redhat.com Gerrit-Reviewer: Ayal Baron abaron@redhat.com Gerrit-Reviewer: Dan Kenigsberg danken@redhat.com Gerrit-Reviewer: Federico Simoncelli fsimonce@redhat.com Gerrit-Reviewer: Lee Yarwood lyarwood@redhat.com Gerrit-Reviewer: Royce Lv lvroyce@linux.vnet.ibm.com Gerrit-Reviewer: Vered Volansky vvolansk@redhat.com Gerrit-Reviewer: oVirt Jenkins CI Server
Ayal Baron has posted comments on this change.
Change subject: udev: Race fix- load and trigger dev rule ......................................................................
Patch Set 10: Looks good to me, approved
(2 inline comments)
Minor comments inside (can and should be in a separate patch probably)
.................................................... File vdsm/supervdsmServer.py Line 312: reload = "--reload-rules" Line 313: cmd = [EXT_UDEVADM, 'control', reload] Line 314: rc, out, err = misc.execCmd(cmd, sudo=False) Line 315: if rc: Line 316: self.log.error("Udevadm reload-rules command failed rc=%s, " technically you should replace 'reload-rules' with %s and reload variable from above Line 317: "out="%s", err="%s"", rc, out, err) Line 318: raise OSError(errno.EINVAL, "Could not reload-rules for device " Line 319: "%s" % guid) Line 320:
Line 314: rc, out, err = misc.execCmd(cmd, sudo=False) Line 315: if rc: Line 316: self.log.error("Udevadm reload-rules command failed rc=%s, " Line 317: "out="%s", err="%s"", rc, out, err) Line 318: raise OSError(errno.EINVAL, "Could not reload-rules for device " same or just 'reload rules' Line 319: "%s" % guid) Line 320: Line 321: @utils.memoized Line 322: def __udevVersion(self):
-- To view, visit http://gerrit.ovirt.org/10758 To unsubscribe, visit http://gerrit.ovirt.org/settings
Gerrit-MessageType: comment Gerrit-Change-Id: If3b2008a3d9df2dcaf54190721c2dd9764338627 Gerrit-PatchSet: 10 Gerrit-Project: vdsm Gerrit-Branch: master Gerrit-Owner: Vered Volansky vvolansk@redhat.com Gerrit-Reviewer: Ayal Baron abaron@redhat.com Gerrit-Reviewer: Dan Kenigsberg danken@redhat.com Gerrit-Reviewer: Federico Simoncelli fsimonce@redhat.com Gerrit-Reviewer: Lee Yarwood lyarwood@redhat.com Gerrit-Reviewer: Royce Lv lvroyce@linux.vnet.ibm.com Gerrit-Reviewer: Vered Volansky vvolansk@redhat.com Gerrit-Reviewer: oVirt Jenkins CI Server
Haim Ateya has posted comments on this change.
Change subject: udev: Race fix- load and trigger dev rule ......................................................................
Patch Set 10: Verified
-- To view, visit http://gerrit.ovirt.org/10758 To unsubscribe, visit http://gerrit.ovirt.org/settings
Gerrit-MessageType: comment Gerrit-Change-Id: If3b2008a3d9df2dcaf54190721c2dd9764338627 Gerrit-PatchSet: 10 Gerrit-Project: vdsm Gerrit-Branch: master Gerrit-Owner: Vered Volansky vvolansk@redhat.com Gerrit-Reviewer: Ayal Baron abaron@redhat.com Gerrit-Reviewer: Dan Kenigsberg danken@redhat.com Gerrit-Reviewer: Federico Simoncelli fsimonce@redhat.com Gerrit-Reviewer: Haim Ateya hateya@redhat.com Gerrit-Reviewer: Lee Yarwood lyarwood@redhat.com Gerrit-Reviewer: Royce Lv lvroyce@linux.vnet.ibm.com Gerrit-Reviewer: Vered Volansky vvolansk@redhat.com Gerrit-Reviewer: oVirt Jenkins CI Server
Dan Kenigsberg has submitted this change and it was merged.
Change subject: udev: Race fix- load and trigger dev rule ......................................................................
udev: Race fix- load and trigger dev rule
The rule file is generated, yet not synch-loaded in memory, so a VM with a direct lun fails to start. This patch reloads the rules before triggering using the new private udev functions - udevReloadRules() in supervdsmServer.py . Also added a check in appropriateDevice() (hsm.py) to make sure the mapping is indeed there.
Bug-Url: https://bugzilla.redhat.com/show_bug.cgi?id=891300 Change-Id: If3b2008a3d9df2dcaf54190721c2dd9764338627 Signed-off-by: Lee Yarwood lyarwood@redhat.com Signed-off-by: Vered Volansky vvolansk@redhat.com Signed-off-by: Federico Simoncelli fsimonce@redhat.com --- M vdsm/storage/hsm.py M vdsm/supervdsmServer.py 2 files changed, 38 insertions(+), 0 deletions(-)
Approvals: Ayal Baron: Looks good to me, approved Haim Ateya: Verified Federico Simoncelli: Looks good to me, but someone else must approve Dan Kenigsberg: Looks good to me, approved
-- To view, visit http://gerrit.ovirt.org/10758 To unsubscribe, visit http://gerrit.ovirt.org/settings
Gerrit-MessageType: merged Gerrit-Change-Id: If3b2008a3d9df2dcaf54190721c2dd9764338627 Gerrit-PatchSet: 10 Gerrit-Project: vdsm Gerrit-Branch: master Gerrit-Owner: Vered Volansky vvolansk@redhat.com Gerrit-Reviewer: Ayal Baron abaron@redhat.com Gerrit-Reviewer: Dan Kenigsberg danken@redhat.com Gerrit-Reviewer: Federico Simoncelli fsimonce@redhat.com Gerrit-Reviewer: Haim Ateya hateya@redhat.com Gerrit-Reviewer: Lee Yarwood lyarwood@redhat.com Gerrit-Reviewer: Royce Lv lvroyce@linux.vnet.ibm.com Gerrit-Reviewer: Vered Volansky vvolansk@redhat.com Gerrit-Reviewer: oVirt Jenkins CI Server
Dan Kenigsberg has posted comments on this change.
Change subject: udev: Race fix- load and trigger dev rule ......................................................................
Patch Set 10: Looks good to me, approved
(1 inline comment)
I cannot say that I love this - udevadm stuff should go to their own new module, with its proper unit tests. I'll nag Vered about it instead of blocking.
.................................................... File vdsm/supervdsmServer.py Line 323: cmd = [EXT_UDEVADM, '--version'] Line 324: rc, out, err = misc.execCmd(cmd, sudo=False) Line 325: if rc: Line 326: self.log.error("Udevadm version command failed rc=%s, " Line 327: " out="%s", err="%s"", rc, out, err) double space Line 328: raise RuntimeError("Could not get udev version number") Line 329: return int(out[0]) Line 330: Line 331: def __udevOperationReload(self):
-- To view, visit http://gerrit.ovirt.org/10758 To unsubscribe, visit http://gerrit.ovirt.org/settings
Gerrit-MessageType: comment Gerrit-Change-Id: If3b2008a3d9df2dcaf54190721c2dd9764338627 Gerrit-PatchSet: 10 Gerrit-Project: vdsm Gerrit-Branch: master Gerrit-Owner: Vered Volansky vvolansk@redhat.com Gerrit-Reviewer: Ayal Baron abaron@redhat.com Gerrit-Reviewer: Dan Kenigsberg danken@redhat.com Gerrit-Reviewer: Federico Simoncelli fsimonce@redhat.com Gerrit-Reviewer: Haim Ateya hateya@redhat.com Gerrit-Reviewer: Lee Yarwood lyarwood@redhat.com Gerrit-Reviewer: Royce Lv lvroyce@linux.vnet.ibm.com Gerrit-Reviewer: Vered Volansky vvolansk@redhat.com Gerrit-Reviewer: oVirt Jenkins CI Server
vdsm-patches@lists.fedorahosted.org