[NEW PATCH] vdsm-logrotate: remove leftovers of coredump handling (via gerrit-bot)
by Dan Kenigsberg
New patch submitted by Dan Kenigsberg (danken(a)redhat.com)
You can review this change at: http://gerrit.usersys.redhat.com/741
commit 702a103ba4c09000b6971db3533069f55739b3e4
Author: Dan Kenigsberg <danken(a)redhat.com>
Date: Sun Jul 24 23:06:27 2011 +0300
vdsm-logrotate: remove leftovers of coredump handling
commit 626c4b4f6 moved compression of coredumps into
vdsm-logrotate.conf, but left error-handling code in vdsm-logrotate.
Change-Id: I244cf610261dce01b8c182fd6b25c200b6fe2c36
diff --git a/vdsm/vdsm-logrotate b/vdsm/vdsm-logrotate
index efa9e09..a641f36 100755
--- a/vdsm/vdsm-logrotate
+++ b/vdsm/vdsm-logrotate
@@ -7,9 +7,4 @@ if [ $EXITVALUE != 0 ]; then
/usr/bin/logger -t logrotate "ALERT exited abnormally with [$EXITVALUE]"
fi
-EXITVALUE=$?
-if [ $EXITVALUE != 0 ]; then
- /usr/bin/logger -t logrotate "ALERT clean old core files exited abnormally with [$EXITVALUE]"
-fi
-
exit $EXITVALUE
12 years, 10 months
[NEW PATCH] BZ#694026 initctl libvirtd as part of its configuration vdsm use to control libvirtd using System V init script. The changes have been made so that vdsm start uses initctl to start libvirtd. If libvirtd is already using initctl, then it will start libvi (via gerrit-bot)
by Sanjay Mehrotra
New patch submitted by Sanjay Mehrotra (smehrotr(a)redhat.com)
You can review this change at: http://gerrit.usersys.redhat.com/675
commit 29d8859e93b0d56279b82313effe22559fa67ba6
Author: Sanjay Mehrotra <smehrotr(a)redhat.com>
Date: Thu Jul 7 16:09:39 2011 +0300
BZ#694026 initctl libvirtd as part of its configuration
vdsm use to control libvirtd using System V init script. The changes have been made
so that vdsm start uses initctl to start libvirtd. If libvirtd is already using initctl,
then it will start libvirtd if it is not running. If initctl fails, it will default to sysv initscript.
Change-Id: I0ea7b64a710b6e2c48fb96da82ebea64fd0482a4
diff --git a/vdsm.spec.in b/vdsm.spec.in
index 8f01acc..db14f44 100644
--- a/vdsm.spec.in
+++ b/vdsm.spec.in
@@ -151,6 +151,12 @@ then
/usr/sbin/saslpasswd2 -p -a libvirt vdsm@rhevh < "$pfile"
fi
+# copy the libvirtd upstart job control.
+upstart=`rpm -ql libvirt | grep libvirtd.upstart | head --lines=1`
+if [ -f "$upstart" ]; then
+ cp -f $upstart /etc/init/libvirtd.conf
+fi
+
%preun
if [ "$1" -eq 0 ]
then
@@ -180,6 +186,13 @@ _EOF
if selinuxenabled; then
setsebool virt_use_nfs off
fi
+
+ if initctl list | grep -q libvirtd; then
+ initctl stop libvirtd
+ rm -f /etc/init/libvirtd.conf
+ chkconfig libvirtd on
+ service libvirtd restart
+ fi
fi
%postun
diff --git a/vdsm/vdsmd b/vdsm/vdsmd
index 6b35e23..dee2987 100755
--- a/vdsm/vdsmd
+++ b/vdsm/vdsmd
@@ -30,7 +30,7 @@ RESPAWNPIDFILE=@P_VDSM_RUN(a)/respawn.pid
CORE_DUMP_PATH=/var/log/core/core.%p.%t.dump
DOM_METADATA_BACKUP_DIR=/var/log/vdsm/backup
CORE_PATTERN=/proc/sys/kernel/core_pattern
-NEEDED_SERVICES="iscsid multipathd libvirtd"
+NEEDED_SERVICES="iscsid multipathd"
CONFLICTING_SERVICES="libvirt-guests"
# TODO: Remove cpu cgroup disabling when BZ#623712 is resolved (kernel on
# massively multicore platforms failing to scale with cgroups turned on)
@@ -323,8 +323,6 @@ configure_libvirt()
virt_use_nfs=1
_EOF
/usr/sbin/setsebool virt_use_nfs on
-
- service libvirtd condrestart
}
RETVAL=0
@@ -343,26 +341,42 @@ reconfigure() {
configure_libvirt $args
}
+start_libvirtd() {
+ if ! initctl list | grep -q libvirtd
+ then
+ chkconfig libvirtd off && service libvirtd stop >/dev/null 2>&1
+ upstart=`rpm -ql libvirt | grep libvirt.upstart`
+ cp -f $upstart /etc/init/libvirtd.conf
+ initctl reload-configuration && initctl start libvirtd
+ fi
+
+ initctl status libvirtd | grep -q "libvirtd start" && return 0;
+
+ initctl status libvirtd | grep -q "libvirtd stop" && initctl start libvirtd;
+}
+
start() {
local ret_val
python @P_VDSM(a)/hooks.pyc before_vdsm_start
- reconfigure noforce
+ start_needed_srv
ret_val=$?
if [ $ret_val -ne 0 ]
then
- log_failure_msg "$prog: failed to reconfigure libvirt"
- return $ret_val
+ log_failure_msg "$prog: one of the dependent services did not start, error code $ret_val"
+ return $ret_val
fi
- start_needed_srv
+ reconfigure noforce
ret_val=$?
if [ $ret_val -ne 0 ]
then
- log_failure_msg "$prog: one of the dependent services did not start, error code $ret_val"
- return $ret_val
+ log_failure_msg "$prog: failed to reconfigure libvirt"
+ return $ret_val
fi
+ start_libvirtd
+
shutdown_conflicting_srv
@P_VDSM@/vdsm-restore-net-config
load_needed_modules
12 years, 10 months
netlink-based ifconfig() routine replacement
by Peter V. Saveliev
...
Hi there. I prepared an RT Netlink based netinfo.ifconfig() routine
replacement. It works from 3 to 6 time faster than /sbin/ifconfig
exec|parse and uses netlink(7) socket to communicate with kernel.
I tested it as a blackbox on several platforms:
* ALT Linux ia32, amd64 (kernel 2.6.18,2.6.35)
* Debian arm32 (kernel 2.6.21)
* Ubuntu ia32, amd64 (kernel 2.6.38)
It should work with Python from 2.5 to 2.7. Library requirements:
* socket
* ctypes
* copy
And so far I hope that it can be used as a faster replacement for
netinfo.ifconfig().
To get it from my git clone, checkout `nlconfig` branch:
$ git clone git://projects.radlinux.org/vdsm
...
$ cd vdsm/
$ git checkout -b nlconfig remotes/origin/nlconfig
...
Plain diff is attached.
--
Peter V. Saveliev
12 years, 10 months
[NEW PATCH] BZ#721356 - Use delay to actually check the delay (via gerrit-bot)
by smizrahi@redhat.com
New patch submitted by Saggi Mizrahi (smizrahi(a)redhat.com)
You can review this change at: http://gerrit.usersys.redhat.com/727
commit 635dbc3a49a62604d35cc7ede02f33702142df2c
Author: Saggi Mizrahi <smizrahi(a)redhat.com>
Date: Tue Jul 19 15:35:28 2011 +0300
BZ#721356 - Use delay to actually check the delay
Change-Id: I81a737d1ce11de94a488a02b9ab3c6afdd35254d
diff --git a/vdsm/storage/blockSD.py b/vdsm/storage/blockSD.py
index 0c00dd3..2b9f455 100644
--- a/vdsm/storage/blockSD.py
+++ b/vdsm/storage/blockSD.py
@@ -354,6 +354,12 @@ class BlockStorageDomain(sd.StorageDomain):
return bsd
+ def getReadDelay(self):
+ with fileUtils.open_ex(lvm.lvPath(self.sdUUID, sd.METADATA), "dr") as f:
+ t = time.time()
+ f.read(4096)
+ return time.time() - t
+
def produceVolume(self, imgUUID, volUUID):
"""
diff --git a/vdsm/storage/fileSD.py b/vdsm/storage/fileSD.py
index 8b40a59..a0b4adb 100644
--- a/vdsm/storage/fileSD.py
+++ b/vdsm/storage/fileSD.py
@@ -23,6 +23,7 @@ import outOfProcess as oop
from processPool import Timeout
from persistentDict import PersistentDict, DictValidator
import constants
+import time
REMOTE_PATH = "REMOTE_PATH"
@@ -127,6 +128,12 @@ class FileStorageDomain(sd.StorageDomain):
REMOTE_PATH : remotePath
})
+ def getReadDelay(self):
+ with fileUtils.open_ex(self.metafile, "dr") as f:
+ t = time.time()
+ f.read(4096)
+ return time.time() - t
+
def produceVolume(self, imgUUID, volUUID):
"""
Produce a type specific volume object
diff --git a/vdsm/storage/sp.py b/vdsm/storage/sp.py
index 8aed3e6..b650ba2 100644
--- a/vdsm/storage/sp.py
+++ b/vdsm/storage/sp.py
@@ -91,10 +91,10 @@ class StatsThread(threading.Thread):
def run(self):
while self._statsletrun:
try:
- start = time.time()
if self._domain is None:
self._domain = SDF.produce(self._sdUUID)
stats, code = self._statsfunc(self._domain)
+ delay = self._domain.getReadDelay()
except se.StorageException, e:
self.log.error("Unexpected error", exc_info=True)
code = e.code
@@ -109,7 +109,7 @@ class StatsThread(threading.Thread):
stats['finish'] = finish
stats['result'] = dict(code=code, lastCheck=finish,
- delay=str(finish - start), valid=(code == 0))
+ delay=str(delay), valid=(code == 0))
try:
if self._statscache["result"]["valid"] != stats["result"]["valid"]:
12 years, 10 months
[NEW PATCH] BZ#694408 - Don't return error code 358 (domain doesn't exists) on corrupted domain (via gerrit-bot)
by Yotam Oron
New patch submitted by Yotam Oron (yoron(a)redhat.com)
You can review this change at: http://gerrit.usersys.redhat.com/723
commit 494f03cea6e0dbbbf1cc4cf330c76e1fba2abdd8
Author: Yotam Oron <yoron(a)redhat.com>
Date: Sun Jul 17 11:30:46 2011 +0300
BZ#694408 - Don't return error code 358 (domain doesn't exists) on corrupted domain
When a domain's path exists but its metadata is corrupted, we now return
proper error code (corrupted domain), since the domain actually exists
Change-Id: I5aa4d541e9d4ccfe4721560375c0077f979634bc
diff --git a/vdsm/storage/blockSD.py b/vdsm/storage/blockSD.py
index 0c00dd3..c63246e 100644
--- a/vdsm/storage/blockSD.py
+++ b/vdsm/storage/blockSD.py
@@ -957,7 +957,14 @@ def _isSD(vg):
return STORAGE_DOMAIN_TAG in vg.tags
def findDomain(sdUUID):
- return BlockStorageDomain(BlockStorageDomain.findDomainPath(sdUUID))
+ domainPath = BlockStorageDomain.findDomainPath(sdUUID)
+ try:
+ return BlockStorageDomain(domainPath)
+ except KeyError:
+ # If the path exists
+ if os.path.exists(domainPath):
+ raise se.CorruptedDomain(sdUUID, domainPath)
+ raise
def getStorageDomainsList():
return [vg.name for vg in lvm.getAllVGs() if _isSD(vg)]
diff --git a/vdsm/storage/localFsSD.py b/vdsm/storage/localFsSD.py
index 012f304..6e4d63a 100644
--- a/vdsm/storage/localFsSD.py
+++ b/vdsm/storage/localFsSD.py
@@ -83,4 +83,12 @@ class LocalFsStorageDomain(fileSD.FileStorageDomain):
raise se.StorageDomainDoesNotExist(sdUUID)
def findDomain(sdUUID):
- return LocalFsStorageDomain(LocalFsStorageDomain.findDomainPath(sdUUID))
+ domainPath = LocalFsStorageDomain.findDomainPath(sdUUID)
+ try:
+ return LocalFsStorageDomain(domainPath)
+ except KeyError:
+ # If the path exists
+ if os.path.exists(domainPath):
+ raise se.CorruptedDomain(sdUUID, domainPath)
+ raise
+
diff --git a/vdsm/storage/nfsSD.py b/vdsm/storage/nfsSD.py
index abcf1ff..aea3897 100644
--- a/vdsm/storage/nfsSD.py
+++ b/vdsm/storage/nfsSD.py
@@ -127,5 +127,12 @@ class NfsStorageDomain(fileSD.FileStorageDomain):
raise se.StorageDomainDoesNotExist(sdUUID)
def findDomain(sdUUID):
- return NfsStorageDomain(NfsStorageDomain.findDomainPath(sdUUID))
+ domainPath = NfsStorageDomain.findDomainPath(sdUUID)
+ try:
+ return NfsStorageDomain(domainPath)
+ except KeyError:
+ # If the path exists
+ if os.path.exists(domainPath):
+ raise se.CorruptedDomain(sdUUID, domainPath)
+ raise
diff --git a/vdsm/storage/sdc.py b/vdsm/storage/sdc.py
index 245c5bf..910db0e 100644
--- a/vdsm/storage/sdc.py
+++ b/vdsm/storage/sdc.py
@@ -95,6 +95,9 @@ class StorageDomainCache:
return mod.findDomain(sdUUID)
except se.StorageDomainDoesNotExist:
pass
+ except se.CorruptedDomain:
+ # The domain path is there but the metadata files are corrupted.
+ raise
except Exception:
self.log.error("Error while looking for domain `%s`", sdUUID, exc_info=True)
diff --git a/vdsm/storage/storage_exception.py b/vdsm/storage/storage_exception.py
index c9df109..7337b39 100644
--- a/vdsm/storage/storage_exception.py
+++ b/vdsm/storage/storage_exception.py
@@ -699,6 +699,12 @@ class MixedSDVersionError(StorageException):
self.message = "Domain `%s` version (%d) is different from msd %s version (%d)" % (sdUUID, domVersion, msdUUID, msdVersion)
code = 398
+class CorruptedDomain(StorageException):
+ def __init__(self, sdUUID, domainPath):
+ self.value = ""
+ self.message = "Domain's %s is mounted but metafile is corrupted on path %s" % (sdUUID, domainPath)
+ code = 399
+
#################################################
# Task Exceptions
#################################################
12 years, 10 months
[NEW PATCH] BZ#720919 spmprotect.sh: remove more log noise (via gerrit-bot)
by Dan Kenigsberg
New patch submitted by Dan Kenigsberg (danken(a)redhat.com)
You can review this change at: http://gerrit.usersys.redhat.com/731
commit b5a36c7f0af5b3dc44d2703bbe2680d27197a72f
Author: Dan Kenigsberg <danken(a)redhat.com>
Date: Thu Jul 21 11:31:41 2011 +0300
BZ#720919 spmprotect.sh: remove more log noise
former patch for this bug left one place where check_renew complains
that its RENEWDIR was already removed.
Change-Id: I729991c363f1706c6f336c854909e7f174aaf7ad
diff --git a/vdsm/storage/protect/spmprotect.sh b/vdsm/storage/protect/spmprotect.sh
index f476446..d664581 100755
--- a/vdsm/storage/protect/spmprotect.sh
+++ b/vdsm/storage/protect/spmprotect.sh
@@ -126,7 +126,7 @@ function renew() {
function check_renew() {
local latest list
local res=1
- if ! list=`ls "$RENEWDIR" | sort -n` ; then
+ if ! list=`ls "$RENEWDIR" 2>/dev/null | sort -n` ; then
return "$res"
fi
if latest=`echo $list | awk '{ print $NF }'` ; then
12 years, 10 months