Change in vdsm[master]: remoteFileHandler: improve PYTHONPATH definition
by Federico Simoncelli
Federico Simoncelli has uploaded a new change for review.
Change subject: remoteFileHandler: improve PYTHONPATH definition
......................................................................
remoteFileHandler: improve PYTHONPATH definition
The recently added import for logUtils in misc.py broke the out of
process (remoteFileHandler) subsystem (ImportError: No module named
logUtils).
Defining PYTHONPATH with relative paths is both unreliable and
insecure.
In this patch:
* Remove an old sys.path modification in misc.py
* Improve the PYTHONPATH definition in remoteFileHandler removing the
relative path
Change-Id: I29dd748bcc9658a98ad86313921bfd94c96b83a6
Signed-off-by: Federico Simoncelli <fsimonce(a)redhat.com>
---
M vdsm/storage/misc.py
M vdsm/storage/remoteFileHandler.py
2 files changed, 2 insertions(+), 2 deletions(-)
git pull ssh://gerrit.ovirt.org:29418/vdsm refs/changes/93/9193/1
diff --git a/vdsm/storage/misc.py b/vdsm/storage/misc.py
index bf3ae79..7453b7f 100644
--- a/vdsm/storage/misc.py
+++ b/vdsm/storage/misc.py
@@ -55,7 +55,6 @@
import fcntl
import inspect
-sys.path.append("../")
from vdsm import constants
import storage_exception as se
from vdsm.betterPopen import BetterPopen
diff --git a/vdsm/storage/remoteFileHandler.py b/vdsm/storage/remoteFileHandler.py
index edf8e68..933dc82 100644
--- a/vdsm/storage/remoteFileHandler.py
+++ b/vdsm/storage/remoteFileHandler.py
@@ -220,7 +220,8 @@
try:
# Some imports in vdsm assume /usr/share/vdsm is in your PYTHONPATH
env = os.environ.copy()
- env['PYTHONPATH'] = "../:" + env.get('PYTHONPATH', "")
+ env['PYTHONPATH'] = "%s:%s" % (
+ constants.P_VDSM, env.get("PYTHONPATH"]))
self.process = BetterPopen([constants.EXT_PYTHON, __file__,
str(hisRead), str(hisWrite)], close_fds=False, env=env)
--
To view, visit http://gerrit.ovirt.org/9193
To unsubscribe, visit http://gerrit.ovirt.org/settings
Gerrit-MessageType: newchange
Gerrit-Change-Id: I29dd748bcc9658a98ad86313921bfd94c96b83a6
Gerrit-PatchSet: 1
Gerrit-Project: vdsm
Gerrit-Branch: master
Gerrit-Owner: Federico Simoncelli <fsimonce(a)redhat.com>
11 years, 6 months
Change in vdsm[master]: Another missing of joinAll after using ThreadPool
by ybronhei@redhat.com
Yaniv Bronhaim has uploaded a new change for review.
Change subject: Another missing of joinAll after using ThreadPool
......................................................................
Another missing of joinAll after using ThreadPool
ThreadPool initiates threads during its construct. The threads are
cleaned only by calling joinAll function.
This patch adds this call after using HSM_MailMonitor's threadPool.
Otherwise, the threads will stay alive until vdsm process will be
killed, and this was a leak.
Change-Id: I207d8db5863e11e89394b9144600b625282c51b6
Signed-off-by: Yaniv Bronhaim <ybronhei(a)redhat.com>
---
M vdsm/storage/storage_mailbox.py
1 file changed, 1 insertion(+), 1 deletion(-)
git pull ssh://gerrit.ovirt.org:29418/vdsm refs/changes/09/9009/1
diff --git a/vdsm/storage/storage_mailbox.py b/vdsm/storage/storage_mailbox.py
index c537883..f6f5337 100644
--- a/vdsm/storage/storage_mailbox.py
+++ b/vdsm/storage/storage_mailbox.py
@@ -446,7 +446,7 @@
self.log.info("HSM_MailboxMonitor - Incoming mail monitoring thread stopped, clearing outgoing mail")
self._outgoingMail = EMPTYMAILBOX
self._sendMail() # Clear outgoing mailbox
-
+ self.tp.joinAll(waitForTasks=False)
class SPM_MailMonitor:
--
To view, visit http://gerrit.ovirt.org/9009
To unsubscribe, visit http://gerrit.ovirt.org/settings
Gerrit-MessageType: newchange
Gerrit-Change-Id: I207d8db5863e11e89394b9144600b625282c51b6
Gerrit-PatchSet: 1
Gerrit-Project: vdsm
Gerrit-Branch: master
Gerrit-Owner: Yaniv Bronhaim <ybronhei(a)redhat.com>
11 years, 6 months
Change in vdsm[master]: Adding supervdsm uts file
by ybronhei@redhat.com
Yaniv Bronhaim has uploaded a new change for review.
Change subject: Adding supervdsm uts file
......................................................................
Adding supervdsm uts file
Change-Id: I08880b12db8a6ca9cc57d74d2ef2a86980a5b097
Signed-off-by: Yaniv Bronhaim <ybronhei(a)redhat.com>
---
M tests/Makefile.am
A tests/superVdsmTests.py
2 files changed, 46 insertions(+), 3 deletions(-)
git pull ssh://gerrit.ovirt.org:29418/vdsm refs/changes/00/8600/1
diff --git a/tests/Makefile.am b/tests/Makefile.am
index a5e4c64..f16239c 100644
--- a/tests/Makefile.am
+++ b/tests/Makefile.am
@@ -42,12 +42,14 @@
parted_utils_tests.py \
permutationTests.py \
persistentDictTests.py \
- restTests.py \
+ remoteFileHandlerTests.py \
+ resourceManagerTests.py \
restData.py \
+ restTests.py \
+ superVdsmTests.py \
tcTests.py \
vdsClientTests.py \
- remoteFileHandlerTests.py \
- resourceManagerTests.py
+ $(NULL)
dist_noinst_DATA = \
run_tests_local.sh
diff --git a/tests/superVdsmTests.py b/tests/superVdsmTests.py
new file mode 100644
index 0000000..ecb876f
--- /dev/null
+++ b/tests/superVdsmTests.py
@@ -0,0 +1,41 @@
+from testrunner import VdsmTestCase as TestCaseBase
+import supervdsm
+import testValidation
+import tempfile
+
+
+class TestSuperVdsm(TestCaseBase):
+
+ def setUp(self):
+ self._proxy = supervdsm.getProxy()
+
+ # changing default constants for test. remember to return the origin
+ # value
+ self._originpidfile = self._proxy.pidfile
+ self._origintimestempfile = self._proxy.timestamp
+ self._originsock = self._proxy.address
+
+ # temporary values to run temporary svdsm
+ self._proxy.pidfile = tempfile.mkdtemp()
+ self._proxy.timestamp = tempfile.mkdtemp()
+ self._proxy.address = tempfile.mkdtemp()
+
+ def tearDown(self):
+ self._proxy.kill() # cleanning old temp files
+ self._proxy.pidfile = self._originpidfile
+ self._proxy.timestamp = self._origintimestempfile
+ self._proxy.address = self._originsock
+
+ def testIsSuperUp(self):
+ testValidation.checkSudo(['python', "supervdsmServer.py"])
+ self._proxy.ping() # this call initiate svdsm
+
+ self.assertTrue(self._proxy.isRunning())
+
+ def testKillSuper(self):
+ testValidation.checkSudo(['python', "supervdsmServer.py"])
+ self._proxy.ping()
+ self._proxy.kill()
+ self.assertFail(self._proxy.isRunning())
+ self._proxy.ping() # Launching vdsm after kill
+ self.assertTrue(self._proxy.isRunning())
--
To view, visit http://gerrit.ovirt.org/8600
To unsubscribe, visit http://gerrit.ovirt.org/settings
Gerrit-MessageType: newchange
Gerrit-Change-Id: I08880b12db8a6ca9cc57d74d2ef2a86980a5b097
Gerrit-PatchSet: 1
Gerrit-Project: vdsm
Gerrit-Branch: master
Gerrit-Owner: Yaniv Bronhaim <ybronhei(a)redhat.com>
11 years, 6 months
Change in vdsm[master]: Add dependency to tuned package Change tuned profile to virt...
by nslomian@redhat.com
Noam Slomianko has uploaded a new change for review.
Change subject: Add dependency to tuned package Change tuned profile to virtual-host
......................................................................
Add dependency to tuned package
Change tuned profile to virtual-host
Change-Id: I5c87098ddced38a3e24405325a9c011de3a86e0e
Signed-off-by: Noam Slomianko <nslomian(a)redhat.com>
---
M vdsm.spec.in
M vdsm/vdsmd.init.in
2 files changed, 7 insertions(+), 0 deletions(-)
git pull ssh://gerrit.ovirt.org:29418/vdsm refs/changes/30/8930/1
diff --git a/vdsm.spec.in b/vdsm.spec.in
index 37f37a3..87109f5 100644
--- a/vdsm.spec.in
+++ b/vdsm.spec.in
@@ -120,6 +120,8 @@
Requires(post): /usr/sbin/saslpasswd2
Requires(post): /bin/hostname
+Requires: tuned
+
%description
The VDSM service is required by a Virtualization Manager to manage the
Linux hosts. VDSM manages and monitors the host's storage, memory and
diff --git a/vdsm/vdsmd.init.in b/vdsm/vdsmd.init.in
index 5b38d55..e8dcfa7 100755
--- a/vdsm/vdsmd.init.in
+++ b/vdsm/vdsmd.init.in
@@ -43,6 +43,8 @@
LDCONF=/etc/sysconfig/libvirtd
QLCONF=/etc/libvirt/qemu-sanlock.conf
+TUNED_PROFILE=virtual-host
+
is_coredump=`$GETCONFITEM $CONF_FILE vars core_dump_enable false | tr A-Z a-z`
[ $is_coredump != true ] && is_coredump=false
@@ -401,6 +403,9 @@
;;
esac
configure_libvirt $args
+
+ #Switch to optimised profile
+ tuned-adm profile $TUNED_PROFILE
}
stop_libvirtd_sysv() {
--
To view, visit http://gerrit.ovirt.org/8930
To unsubscribe, visit http://gerrit.ovirt.org/settings
Gerrit-MessageType: newchange
Gerrit-Change-Id: I5c87098ddced38a3e24405325a9c011de3a86e0e
Gerrit-PatchSet: 1
Gerrit-Project: vdsm
Gerrit-Branch: master
Gerrit-Owner: Noam Slomianko <nslomian(a)redhat.com>
11 years, 6 months
Change in vdsm[master]: remoteFileHandler: set PYTHONPATH properly for new process
by zhshzhou@linux.vnet.ibm.com
Zhou Zheng Sheng has uploaded a new change for review.
Change subject: remoteFileHandler: set PYTHONPATH properly for new process
......................................................................
remoteFileHandler: set PYTHONPATH properly for new process
PoolHandler.__init__() starts new process of remoteFileHandler.py.
To set the corrected PYTHONPATH for the new process, it copies existing
os.environ['PYTHONPATH'] and prepends "../:" to it. It's good for unit
test, but not for vdsmd service. When vdsmd.service is running as a
daemon, the current working dir is "/", and PYTHONPATH is not set
actually when vdsm is started. So the existing PYTHONPATH is empty and
"../" refers to "/". When new process of remoteFileHandler.py is started
this way, any attempt to import modules under /usr/share/vdsm will fail.
remoteFileHandler imports misc, and misc imports logUtils. logUtils.py
is under /usr/share/vdsm.
Bug-Url: https://bugzilla.redhat.com/show_bug.cgi?id=875678
Change-Id: I8d4a38d5848f74d327b1d9f4ecadc6de6a0cc091
Signed-off-by: Zhou Zheng Sheng <zhshzhou(a)linux.vnet.ibm.com>
---
M vdsm/storage/remoteFileHandler.py
1 file changed, 7 insertions(+), 1 deletion(-)
git pull ssh://gerrit.ovirt.org:29418/vdsm refs/changes/83/9183/1
diff --git a/vdsm/storage/remoteFileHandler.py b/vdsm/storage/remoteFileHandler.py
index 34de3ef..a2a9c41 100644
--- a/vdsm/storage/remoteFileHandler.py
+++ b/vdsm/storage/remoteFileHandler.py
@@ -227,7 +227,13 @@
try:
# Some imports in vdsm assume /usr/share/vdsm is in your PYTHONPATH
env = os.environ.copy()
- env['PYTHONPATH'] = "../:" + env.get('PYTHONPATH', "")
+ env['PYTHONPATH'] = "../"
+ try:
+ if os.environ['PYTHONPATH'] != "":
+ env['PYTHONPATH'] += ":" + os.environ['PYTHONPATH']
+ except KeyError:
+ pass
+ env['PYTHONPATH'] += ":" + constants.P_VDSM
self.process = BetterPopen([constants.EXT_PYTHON, __file__,
str(hisRead), str(hisWrite)], close_fds=False, env=env)
--
To view, visit http://gerrit.ovirt.org/9183
To unsubscribe, visit http://gerrit.ovirt.org/settings
Gerrit-MessageType: newchange
Gerrit-Change-Id: I8d4a38d5848f74d327b1d9f4ecadc6de6a0cc091
Gerrit-PatchSet: 1
Gerrit-Project: vdsm
Gerrit-Branch: master
Gerrit-Owner: Zhou Zheng Sheng <zhshzhou(a)linux.vnet.ibm.com>
11 years, 6 months
Change in vdsm[master]: configure.ac: check python-pthreading module
by Douglas Schilling Landgraf
Douglas Schilling Landgraf has uploaded a new change for review.
Change subject: configure.ac: check python-pthreading module
......................................................................
configure.ac: check python-pthreading module
Adding AX_PYTHON_MODULE macro to check if python-pthreading module
is installed.
Change-Id: I71eb94f8081159013bfb145bf29025998ff5905c
Signed-off-by: Douglas Schilling Landgraf <dougsland(a)redhat.com>
---
M configure.ac
1 file changed, 1 insertion(+), 0 deletions(-)
git pull ssh://gerrit.ovirt.org:29418/vdsm refs/changes/98/9198/1
diff --git a/configure.ac b/configure.ac
index 17ec6ce..5d8b238 100644
--- a/configure.ac
+++ b/configure.ac
@@ -125,6 +125,7 @@
# Checking for python modules (sorted, please keep in order)
AX_PYTHON_MODULE([ethtool], [fatal])
AX_PYTHON_MODULE([libvirt], [fatal])
+AX_PYTHON_MODULE([pthreading], [fatal])
# External programs (sorted, please keep in order)
AC_PATH_PROG([BLKID_PATH], [blkid], [/sbin/blkid])
--
To view, visit http://gerrit.ovirt.org/9198
To unsubscribe, visit http://gerrit.ovirt.org/settings
Gerrit-MessageType: newchange
Gerrit-Change-Id: I71eb94f8081159013bfb145bf29025998ff5905c
Gerrit-PatchSet: 1
Gerrit-Project: vdsm
Gerrit-Branch: master
Gerrit-Owner: Douglas Schilling Landgraf <dougsland(a)redhat.com>
11 years, 6 months
Change in vdsm[master]: logging: report the node hostname when vdsm starts
by Federico Simoncelli
Federico Simoncelli has uploaded a new change for review.
Change subject: logging: report the node hostname when vdsm starts
......................................................................
logging: report the node hostname when vdsm starts
It is convinient to correlate a log report to a specific host.
Change-Id: I11294d3accb8a596225166f5cc3895bb8965b99f
Signed-off-by: Federico Simoncelli <fsimonce(a)redhat.com>
---
M vdsm/vdsm
1 file changed, 4 insertions(+), 3 deletions(-)
git pull ssh://gerrit.ovirt.org:29418/vdsm refs/changes/01/9201/1
diff --git a/vdsm/vdsm b/vdsm/vdsm
index f2db404..71c85cc 100755
--- a/vdsm/vdsm
+++ b/vdsm/vdsm
@@ -80,9 +80,10 @@
file(pidfile, 'w').write(str(os.getpid()) + "\n")
os.chmod(pidfile, 0664)
- log.info('I am the actual vdsm %s-%s',
- dsaversion.software_version,
- dsaversion.software_revision)
+ sysname, nodename, release, version, machine = os.uname()
+ log.info('I am the actual vdsm %s-%s %s (%s)',
+ dsaversion.software_version, dsaversion.software_revision,
+ nodename, release)
serve_clients(log)
except:
log.error("Exception raised", exc_info=True)
--
To view, visit http://gerrit.ovirt.org/9201
To unsubscribe, visit http://gerrit.ovirt.org/settings
Gerrit-MessageType: newchange
Gerrit-Change-Id: I11294d3accb8a596225166f5cc3895bb8965b99f
Gerrit-PatchSet: 1
Gerrit-Project: vdsm
Gerrit-Branch: master
Gerrit-Owner: Federico Simoncelli <fsimonce(a)redhat.com>
11 years, 6 months
Change in vdsm[master]: Handle a race where it takes some time fot the cmdline to di...
by smizrahi@redhat.com
Saggi Mizrahi has uploaded a new change for review.
Change subject: Handle a race where it takes some time fot the cmdline to disappear after killing a process
......................................................................
Handle a race where it takes some time fot the cmdline to disappear after killing a process
Change-Id: I2d7a8190bb3b8e2251309b91f341a00f89618be5
Signed-off-by: Saggi Mizrahi <smizrahi(a)redhat.com>
---
M tests/miscTests.py
1 file changed, 4 insertions(+), 1 deletion(-)
git pull ssh://gerrit.ovirt.org:29418/vdsm refs/changes/04/9204/1
diff --git a/tests/miscTests.py b/tests/miscTests.py
index 6d6b234..964fc74 100644
--- a/tests/miscTests.py
+++ b/tests/miscTests.py
@@ -24,6 +24,7 @@
import threading
from testrunner import VdsmTestCase as TestCaseBase
import inspect
+from vdsm import utils
import storage.outOfProcess as oop
import storage.misc as misc
@@ -86,7 +87,9 @@
sproc = misc.execCmd(args, sync=False, sudo=False)
sproc.kill()
try:
- self.assertEquals(misc.getCmdArgs(sproc.pid), tuple())
+ test = lambda: self.assertEquals(misc.getCmdArgs(sproc.pid),
+ tuple())
+ utils.retry(AssertionError, test, tries=10, sleep=0.1)
finally:
sproc.wait()
--
To view, visit http://gerrit.ovirt.org/9204
To unsubscribe, visit http://gerrit.ovirt.org/settings
Gerrit-MessageType: newchange
Gerrit-Change-Id: I2d7a8190bb3b8e2251309b91f341a00f89618be5
Gerrit-PatchSet: 1
Gerrit-Project: vdsm
Gerrit-Branch: master
Gerrit-Owner: Saggi Mizrahi <smizrahi(a)redhat.com>
11 years, 6 months
Change in vdsm[master]: Fix problem where a 0 error code will cause remoteFileHandle...
by smizrahi@redhat.com
Saggi Mizrahi has uploaded a new change for review.
Change subject: Fix problem where a 0 error code will cause remoteFileHandler to become a zombie
......................................................................
Fix problem where a 0 error code will cause remoteFileHandler to become a zombie
Change-Id: I738d9739673d11c15b882743d412b9b267013208
Signed-off-by: Saggi Mizrahi <smizrahi(a)redhat.com>
---
M vdsm/storage/remoteFileHandler.py
1 file changed, 6 insertions(+), 4 deletions(-)
git pull ssh://gerrit.ovirt.org:29418/vdsm refs/changes/07/8907/1
diff --git a/vdsm/storage/remoteFileHandler.py b/vdsm/storage/remoteFileHandler.py
index 43ee951..446087b 100644
--- a/vdsm/storage/remoteFileHandler.py
+++ b/vdsm/storage/remoteFileHandler.py
@@ -240,10 +240,12 @@
except:
pass
- # For some reason Thread might have been released if python is going
- # down. This makes sure that there are no issues when this happens
- if self.process.poll() and Thread:
- Thread(target=self.process.wait).start()
+ if not self.process.wait(0):
+ # For some reason Thread might have been released if python is
+ # going down. This makes sure that there are no issues when this
+ # happens
+ if Thread:
+ Thread(target=self.process.wait).start()
def __del__(self):
self.stop()
--
To view, visit http://gerrit.ovirt.org/8907
To unsubscribe, visit http://gerrit.ovirt.org/settings
Gerrit-MessageType: newchange
Gerrit-Change-Id: I738d9739673d11c15b882743d412b9b267013208
Gerrit-PatchSet: 1
Gerrit-Project: vdsm
Gerrit-Branch: master
Gerrit-Owner: Saggi Mizrahi <smizrahi(a)redhat.com>
11 years, 6 months
Change in vdsm[master]: Integrate zombie reaper in test framework
by smizrahi@redhat.com
Saggi Mizrahi has uploaded a new change for review.
Change subject: Integrate zombie reaper in test framework
......................................................................
Integrate zombie reaper in test framework
Some parts of VDSM count on the zombie reaper being set up.
Change-Id: I74dec57129b65492d4bf41ce8fc2785d896f630e
Signed-off-by: Saggi Mizrahi <smizrahi(a)redhat.com>
---
M tests/testrunner.py
M tests/zombieReaperTests.py
2 files changed, 3 insertions(+), 6 deletions(-)
git pull ssh://gerrit.ovirt.org:29418/vdsm refs/changes/38/8938/1
diff --git a/tests/testrunner.py b/tests/testrunner.py
index cdbc9d3..34d09f6 100644
--- a/tests/testrunner.py
+++ b/tests/testrunner.py
@@ -29,6 +29,9 @@
from testValidation import SlowTestsPlugin
+import zombieReaper
+zombieReaper.registerSignalHandler()
+
PERMUTATION_ATTR = "_permutations_"
diff --git a/tests/zombieReaperTests.py b/tests/zombieReaperTests.py
index 6406ce3..42f3431 100644
--- a/tests/zombieReaperTests.py
+++ b/tests/zombieReaperTests.py
@@ -26,12 +26,6 @@
class zombieReaperTests(TestCaseBase):
- def setUp(self):
- zombieReaper.registerSignalHandler()
-
- def tearDown(self):
- zombieReaper.unregisterSignalHandler()
-
def test(self):
p = BetterPopen(["sleep", "1"])
zombieReaper.autoReapPID(p.pid)
--
To view, visit http://gerrit.ovirt.org/8938
To unsubscribe, visit http://gerrit.ovirt.org/settings
Gerrit-MessageType: newchange
Gerrit-Change-Id: I74dec57129b65492d4bf41ce8fc2785d896f630e
Gerrit-PatchSet: 1
Gerrit-Project: vdsm
Gerrit-Branch: master
Gerrit-Owner: Saggi Mizrahi <smizrahi(a)redhat.com>
11 years, 6 months