Change in vdsm[ovirt-3.3]: iscsi: Iscsi rescan cleanup

2014-01-12 Thread oVirt Jenkins CI Server
oVirt Jenkins CI Server has posted comments on this change.

Change subject: iscsi: Iscsi rescan cleanup
..


Patch Set 2:

Build Failed 

http://jenkins.ovirt.org/job/vdsm_3.3_install_rpm_sanity_gerrit/331/ : FAILURE

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

Gerrit-MessageType: comment
Gerrit-Change-Id: I842eb37cea3bd5e8cd357a310dd966081b242abd
Gerrit-PatchSet: 2
Gerrit-Project: vdsm
Gerrit-Branch: ovirt-3.3
Gerrit-Owner: Saggi Mizrahi 
Gerrit-Reviewer: Barak Azulay 
Gerrit-Reviewer: Dan Kenigsberg 
Gerrit-Reviewer: Haim Ateya 
Gerrit-Reviewer: Saggi Mizrahi 
Gerrit-Reviewer: Yaniv Bronhaim 
Gerrit-Reviewer: automat...@ovirt.org
Gerrit-Reviewer: oVirt Jenkins CI Server
Gerrit-HasComments: No
___
vdsm-patches mailing list
vdsm-patches@lists.fedorahosted.org
https://lists.fedorahosted.org/mailman/listinfo/vdsm-patches


Change in vdsm[ovirt-3.3]: iscsi: Iscsi rescan cleanup

2014-01-12 Thread ybronhei
Yaniv Bronhaim has submitted this change and it was merged.

Change subject: iscsi: Iscsi rescan cleanup
..


iscsi: Iscsi rescan cleanup

* Remove forceIscsiScan(): iscsiadm already does that when refreshing
  sessions
* Cleanup iscsi.rescan(): Replace complex logic with a simpler
  implementation since new iscsiadm takes care of all of this itself
* Make iscsi.rescan() more testable
* Test confusing timeout semantics of iscsi.rescan()

Bug-Url: https://bugzilla.redhat.com/964595
Change-Id: I842eb37cea3bd5e8cd357a310dd966081b242abd
Signed-off-by: Saggi Mizrahi 
Reviewed-on: http://gerrit.ovirt.org/21136
Reviewed-by: Dan Kenigsberg 
Reviewed-by: Yaniv Bronhaim 
---
M tests/Makefile.am
A tests/iscsiTests.py
M vdsm.spec.in
M vdsm/storage/iscsi.py
M vdsm/storage/iscsiadm.py
M vdsm/storage/multipath.py
M vdsm/supervdsmServer
7 files changed, 111 insertions(+), 62 deletions(-)

Approvals:
  Yaniv Bronhaim: Looks good to me, approved
  Saggi Mizrahi: Verified
  Dan Kenigsberg: Looks good to me, approved



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

Gerrit-MessageType: merged
Gerrit-Change-Id: I842eb37cea3bd5e8cd357a310dd966081b242abd
Gerrit-PatchSet: 2
Gerrit-Project: vdsm
Gerrit-Branch: ovirt-3.3
Gerrit-Owner: Saggi Mizrahi 
Gerrit-Reviewer: Barak Azulay 
Gerrit-Reviewer: Dan Kenigsberg 
Gerrit-Reviewer: Haim Ateya 
Gerrit-Reviewer: Saggi Mizrahi 
Gerrit-Reviewer: Yaniv Bronhaim 
Gerrit-Reviewer: automat...@ovirt.org
___
vdsm-patches mailing list
vdsm-patches@lists.fedorahosted.org
https://lists.fedorahosted.org/mailman/listinfo/vdsm-patches


Change in vdsm[ovirt-3.3]: iscsi: Iscsi rescan cleanup

2014-01-12 Thread ybronhei
Yaniv Bronhaim has posted comments on this change.

Change subject: iscsi: Iscsi rescan cleanup
..


Patch Set 1: Code-Review+2

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

Gerrit-MessageType: comment
Gerrit-Change-Id: I842eb37cea3bd5e8cd357a310dd966081b242abd
Gerrit-PatchSet: 1
Gerrit-Project: vdsm
Gerrit-Branch: ovirt-3.3
Gerrit-Owner: Saggi Mizrahi 
Gerrit-Reviewer: Barak Azulay 
Gerrit-Reviewer: Dan Kenigsberg 
Gerrit-Reviewer: Haim Ateya 
Gerrit-Reviewer: Saggi Mizrahi 
Gerrit-Reviewer: Yaniv Bronhaim 
Gerrit-Reviewer: automat...@ovirt.org
Gerrit-HasComments: No
___
vdsm-patches mailing list
vdsm-patches@lists.fedorahosted.org
https://lists.fedorahosted.org/mailman/listinfo/vdsm-patches


Change in vdsm[ovirt-3.3]: iscsi: Iscsi rescan cleanup

2014-01-10 Thread danken
Dan Kenigsberg has posted comments on this change.

Change subject: iscsi: Iscsi rescan cleanup
..


Patch Set 1: Code-Review+2

I'm confident about taking this in now.

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

Gerrit-MessageType: comment
Gerrit-Change-Id: I842eb37cea3bd5e8cd357a310dd966081b242abd
Gerrit-PatchSet: 1
Gerrit-Project: vdsm
Gerrit-Branch: ovirt-3.3
Gerrit-Owner: Saggi Mizrahi 
Gerrit-Reviewer: Barak Azulay 
Gerrit-Reviewer: Dan Kenigsberg 
Gerrit-Reviewer: Haim Ateya 
Gerrit-Reviewer: Saggi Mizrahi 
Gerrit-Reviewer: Yaniv Bronhaim 
Gerrit-Reviewer: automat...@ovirt.org
Gerrit-HasComments: No
___
vdsm-patches mailing list
vdsm-patches@lists.fedorahosted.org
https://lists.fedorahosted.org/mailman/listinfo/vdsm-patches


Change in vdsm[ovirt-3.3]: iscsi: Iscsi rescan cleanup

2013-12-08 Thread ybronhei
Yaniv Bronhaim has posted comments on this change.

Change subject: iscsi: Iscsi rescan cleanup
..


Patch Set 1:

to what tests are we waiting for?

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

Gerrit-MessageType: comment
Gerrit-Change-Id: I842eb37cea3bd5e8cd357a310dd966081b242abd
Gerrit-PatchSet: 1
Gerrit-Project: vdsm
Gerrit-Branch: ovirt-3.3
Gerrit-Owner: Saggi Mizrahi 
Gerrit-Reviewer: Barak Azulay 
Gerrit-Reviewer: Dan Kenigsberg 
Gerrit-Reviewer: Haim Ateya 
Gerrit-Reviewer: Saggi Mizrahi 
Gerrit-Reviewer: Yaniv Bronhaim 
Gerrit-Reviewer: automat...@ovirt.org
Gerrit-HasComments: No
___
vdsm-patches mailing list
vdsm-patches@lists.fedorahosted.org
https://lists.fedorahosted.org/mailman/listinfo/vdsm-patches


Change in vdsm[ovirt-3.3]: iscsi: Iscsi rescan cleanup

2013-11-11 Thread danken
Dan Kenigsberg has posted comments on this change.

Change subject: iscsi: Iscsi rescan cleanup
..


Patch Set 1: Code-Review-1

This cleanup is quite widespread and quite new, so I would not like to see it 
in our already-delaying ovirt-3.3.1 version.

Let's give it some testing time, and push it to ovirt-3.3.2.

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

Gerrit-MessageType: comment
Gerrit-Change-Id: I842eb37cea3bd5e8cd357a310dd966081b242abd
Gerrit-PatchSet: 1
Gerrit-Project: vdsm
Gerrit-Branch: ovirt-3.3
Gerrit-Owner: Saggi Mizrahi 
Gerrit-Reviewer: Barak Azulay 
Gerrit-Reviewer: Dan Kenigsberg 
Gerrit-Reviewer: Haim Ateya 
Gerrit-Reviewer: Saggi Mizrahi 
Gerrit-Reviewer: Yaniv Bronhaim 
Gerrit-Reviewer: automat...@ovirt.org
Gerrit-HasComments: No
___
vdsm-patches mailing list
vdsm-patches@lists.fedorahosted.org
https://lists.fedorahosted.org/mailman/listinfo/vdsm-patches


Change in vdsm[ovirt-3.3]: iscsi: Iscsi rescan cleanup

2013-11-11 Thread smizrahi
Saggi Mizrahi has uploaded a new change for review.

Change subject: iscsi: Iscsi rescan cleanup
..

iscsi: Iscsi rescan cleanup

* Remove forceIscsiScan(): iscsiadm already does that when refreshing
  sessions
* Cleanup iscsi.rescan(): Replace complex logic with a simpler
  implementation since new iscsiadm takes care of all of this itself
* Make iscsi.rescan() more testable
* Test confusing timeout semantics of iscsi.rescan()

Bug-Url: https://bugzilla.redhat.com/964595
Change-Id: I842eb37cea3bd5e8cd357a310dd966081b242abd
Signed-off-by: Saggi Mizrahi 
---
M tests/Makefile.am
A tests/iscsiTests.py
M vdsm.spec.in
M vdsm/storage/iscsi.py
M vdsm/storage/iscsiadm.py
M vdsm/storage/multipath.py
M vdsm/supervdsmServer
7 files changed, 111 insertions(+), 62 deletions(-)


  git pull ssh://gerrit.ovirt.org:29418/vdsm refs/changes/36/21136/1

diff --git a/tests/Makefile.am b/tests/Makefile.am
index f87eddd..5efae38 100644
--- a/tests/Makefile.am
+++ b/tests/Makefile.am
@@ -37,6 +37,7 @@
guestIFTests.py \
hooksTests.py \
ipwrapperTests.py \
+   iscsiTests.py \
jsonRpcTests.py \
jsonRpcUtils.py \
libvirtconnectionTests.py \
diff --git a/tests/iscsiTests.py b/tests/iscsiTests.py
new file mode 100644
index 000..44f6962
--- /dev/null
+++ b/tests/iscsiTests.py
@@ -0,0 +1,80 @@
+import threading
+import time
+from contextlib import contextmanager
+
+from testrunner import VdsmTestCase as TestCaseBase
+
+from storage import iscsi
+
+
+class AsyncStubOperation(object):
+def __init__(self, timeout):
+self._evt = threading.Event()
+if timeout == 0:
+self._evt.set()
+else:
+threading.Timer(timeout, self._evt.set)
+
+def wait(self, timeout=None, cond=None):
+if cond is not None:
+raise Exception("TODO!!!")
+
+self._evt.wait(timeout)
+
+def stop(self):
+self._evt.set()
+
+def result(self):
+if self._evt.is_set():
+return (None, None)
+else:
+return None
+
+
+class RescanTimeoutTests(TestCaseBase):
+def setUp(self):
+self._iscsiadm_rescan_async = \
+iscsi.iscsiadm.session_rescan_async
+iscsi.iscsiadm.session_rescan_async = self._iscsi_stub
+self._timeout = 0
+
+def tearDown(self):
+iscsi.iscsiadm.session_rescan_async = \
+self._iscsiadm_rescan_async
+
+def _iscsi_stub(self):
+return AsyncStubOperation(self._timeout)
+
+@contextmanager
+def assertMaxDuration(self, maxtime):
+start = time.time()
+try:
+yield
+finally:
+end = time.time()
+elapsed = end - start
+if maxtime < elapsed:
+self.fail("Operation was too slow %fs > %fs" %
+  (elapsed, maxtime))
+
+@contextmanager
+def assertMinDuration(self, mintime):
+start = time.time()
+try:
+yield
+finally:
+end = time.time()
+elapsed = end - start
+if mintime > elapsed:
+self.fail("Operation was too fast %fs > %fs" %
+  (elapsed, mintime))
+
+def testFast(self):
+self._timeout = 0
+with self.assertMinDuration(2):
+iscsi.rescan(2, 4)
+
+def testSlow(self):
+self._timeout = 60
+with self.assertMaxDuration(3):
+iscsi.rescan(1, 2)
diff --git a/vdsm.spec.in b/vdsm.spec.in
index b0b89a1..cae9cab 100644
--- a/vdsm.spec.in
+++ b/vdsm.spec.in
@@ -146,7 +146,7 @@
 # Update the qemu-kvm requires when block_stream will be included
 Requires: qemu-kvm >= 2:0.12.1.2-2.295.el6_3.4
 Requires: qemu-img >= 2:0.12.1.2-2.295.el6_3.4
-Requires: iscsi-initiator-utils >= 6.2.0.872-15
+Requires: iscsi-initiator-utils >= 6.2.0.873-3
 Requires: device-mapper-multipath >= 0.4.9-52
 Requires: e2fsprogs >= 1.41.12-11
 Requires: fence-agents
diff --git a/vdsm/storage/iscsi.py b/vdsm/storage/iscsi.py
index 7da94ab..f4fdceb 100644
--- a/vdsm/storage/iscsi.py
+++ b/vdsm/storage/iscsi.py
@@ -30,7 +30,6 @@
 import time
 from collections import namedtuple
 
-from vdsm import constants
 import misc
 from vdsm.config import config
 import devicemapper
@@ -373,38 +372,15 @@
 
 
 @misc.samplingmethod
-def rescan():
-try:
-iscsiadm.session_rescan()
-except iscsiadm.IscsiError:
-pass
+def rescan(minTimeout=None, maxTimeout=None):
+# FIXME: This whole thing is wrong from the core. We need to make rescan
+#completely async and have methods timeout on their own if they
+#can't find the devices they are looking for
+if minTimeout is None:
+minTimeout = config.getint('irs', 'scsi_rescan_minimal_timeout')
+if maxTimeout is None:
+maxTimeout = config.getint('irs', 'scsi_rescan_maximal_timeout')
 
-
-@misc.samplingmethod
-def fo

Change in vdsm[ovirt-3.3]: iscsi: Iscsi rescan cleanup

2013-11-11 Thread smizrahi
Saggi Mizrahi has posted comments on this change.

Change subject: iscsi: Iscsi rescan cleanup
..


Patch Set 1: Verified+1

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

Gerrit-MessageType: comment
Gerrit-Change-Id: I842eb37cea3bd5e8cd357a310dd966081b242abd
Gerrit-PatchSet: 1
Gerrit-Project: vdsm
Gerrit-Branch: ovirt-3.3
Gerrit-Owner: Saggi Mizrahi 
Gerrit-Reviewer: Barak Azulay 
Gerrit-Reviewer: Saggi Mizrahi 
Gerrit-Reviewer: Yaniv Bronhaim 
Gerrit-Reviewer: automat...@ovirt.org
Gerrit-HasComments: No
___
vdsm-patches mailing list
vdsm-patches@lists.fedorahosted.org
https://lists.fedorahosted.org/mailman/listinfo/vdsm-patches