Adam Litke has uploaded a new change for review.
Change subject: irs: Directly register domain state change callbacks
......................................................................
irs: Directly register domain state change callbacks
Currently, domain state change callbacks aren't actually registered
until a storage pool is connected. In a hosted engine environment there
is not a traditional storage pool associated with the storage domain
that is hosting the engine VM so in this case the event doesn't get
registered. Since storage pools are becoming deprecated, there is no
reason to delay callback registration based on connectStoragePool.
Change-Id: I28d4f1af4f94da1a8e3511abbe160ea66e81daad
Bug-Url: https://bugzilla.redhat.com/show_bug.cgi?id=1157421
Signed-off-by: Adam Litke <alitke(a)redhat.com>
---
M vdsm/storage/hsm.py
1 file changed, 2 insertions(+), 9 deletions(-)
git pull ssh://gerrit.ovirt.org:29418/vdsm refs/changes/69/35369/1
diff --git a/vdsm/storage/hsm.py b/vdsm/storage/hsm.py
index 1164d99..045ed39 100644
--- a/vdsm/storage/hsm.py
+++ b/vdsm/storage/hsm.py
@@ -403,10 +403,9 @@
@public
def registerDomainStateChangeCallback(self, callbackFunc):
"""
- Currently this method assumes that all registrations
- are done *prior* to connecting to pool.
+ Register a state change callback function with the domain monitor.
"""
- self.domainStateChangeCallbacks.add(callbackFunc)
+ self.domainMonitor.onDomainStateChange.register(callbackFunc)
def _hsmSchedule(self, name, func, *args):
self.taskMng.scheduleJob("hsm", None, vars.task, name, func, *args)
@@ -1076,12 +1075,6 @@
else:
pool.setBackend(
StoragePoolMemoryBackend(pool, masterVersion, domainsMap))
-
- # Must register domain state change callbacks *before* connecting
- # the pool, which starts domain monitor threads. Otherwise we will
- # miss the first event from the monitor thread.
- for cb in self.domainStateChangeCallbacks:
- pool.domainMonitor.onDomainStateChange.register(cb)
res = pool.connect(hostID, msdUUID, masterVersion)
if res:
--
To view, visit http://gerrit.ovirt.org/35369
To unsubscribe, visit http://gerrit.ovirt.org/settings
Gerrit-MessageType: newchange
Gerrit-Change-Id: I28d4f1af4f94da1a8e3511abbe160ea66e81daad
Gerrit-PatchSet: 1
Gerrit-Project: vdsm
Gerrit-Branch: master
Gerrit-Owner: Adam Litke <alitke(a)redhat.com>
Adam Litke has uploaded a new change for review.
Change subject: clientIF: Use a weakref.proxy when registering contEIOVMs
......................................................................
clientIF: Use a weakref.proxy when registering contEIOVMs
Our storage Event class is taking a weakref on the callback function
that is passed into Event.register. Unfortunately weakrefs on bound
methods are dead on arrival. See this [1] discussion for more
information. Use the same approach as StoragePool._upgradeCallback and
use a weakref.proxy to build the callback function.
[1] http://code.activestate.com/recipes/81253/
Change-Id: Ib06967b26fc9ace41e5f8305a8fadafbbb0fc4e4
Bug-Url: https://bugzilla.redhat.com/show_bug.cgi?id=1157421
Signed-off-by: Adam Litke <alitke(a)redhat.com>
---
M vdsm/clientIF.py
1 file changed, 4 insertions(+), 1 deletion(-)
git pull ssh://gerrit.ovirt.org:29418/vdsm refs/changes/36/35436/1
diff --git a/vdsm/clientIF.py b/vdsm/clientIF.py
index 79ba8f8..b339211 100644
--- a/vdsm/clientIF.py
+++ b/vdsm/clientIF.py
@@ -23,6 +23,8 @@
import time
import threading
import uuid
+from functools import partial
+from weakref import proxy
import alignmentScan
from vdsm.config import config
@@ -76,7 +78,8 @@
self._shutdownSemaphore = threading.Semaphore()
self.irs = irs
if self.irs:
- self.irs.registerDomainStateChangeCallback(self.contEIOVms)
+ cb = partial(clientIF.contEIOVms, proxy(self))
+ self.irs.registerDomainStateChangeCallback(cb)
self.log = log
self._recovery = True
self.channelListener = Listener(self.log)
--
To view, visit http://gerrit.ovirt.org/35436
To unsubscribe, visit http://gerrit.ovirt.org/settings
Gerrit-MessageType: newchange
Gerrit-Change-Id: Ib06967b26fc9ace41e5f8305a8fadafbbb0fc4e4
Gerrit-PatchSet: 1
Gerrit-Project: vdsm
Gerrit-Branch: master
Gerrit-Owner: Adam Litke <alitke(a)redhat.com>
Yeela Kaplan has uploaded a new change for review.
Change subject: multipath: use a backup file instead of rotateFiles
......................................................................
multipath: use a backup file instead of rotateFiles
as part of the move to using vdsm tool configurator for multipath,
we want to consolidate the configuration of multipath with
other configurators, such as libvirt.
Rotating the configuration file will end up deleting the
most important multipath conf file for the user,
which is the original conf file - pre vdsm installation.
That is why we will only back up the original multipath conf,
and any other new changes to multipath that are important to the
user and have been made after vdsm installation should be saved
by the user.
Change-Id: I96a9251ebc852fcdf39239ba50f43dd2343b83a6
Signed-off-by: Yeela Kaplan <ykaplan(a)redhat.com>
---
M vdsm/storage/multipath.py
1 file changed, 28 insertions(+), 12 deletions(-)
git pull ssh://gerrit.ovirt.org:29418/vdsm refs/changes/77/34077/1
diff --git a/vdsm/storage/multipath.py b/vdsm/storage/multipath.py
index 43b06f1..e5964de 100644
--- a/vdsm/storage/multipath.py
+++ b/vdsm/storage/multipath.py
@@ -28,6 +28,7 @@
import tempfile
import logging
import re
+import shutil
from collections import namedtuple
from vdsm import constants
@@ -48,6 +49,8 @@
TOXIC_CHARS = '()*+?|^$.\\'
MPATH_CONF = "/etc/multipath.conf"
+
+CONF_BACKUP = "/etc/multipath.conf.bak"
OLD_TAGS = ["# RHAT REVISION 0.2", "# RHEV REVISION 0.3",
"# RHEV REVISION 0.4", "# RHEV REVISION 0.5",
@@ -110,6 +113,19 @@
misc.execCmd([constants.EXT_MULTIPATH], sudo=True)
+def _parseConf():
+ first = second = ''
+ svdsm = supervdsm.getProxy()
+ mpathconf = svdsm.readMultipathConf()
+ try:
+ first = mpathconf[0]
+ second = mpathconf[1]
+ except IndexError:
+ pass
+
+ return (first, second)
+
+
def isEnabled():
"""
Check the multipath daemon configuration. The configuration file
@@ -120,14 +136,7 @@
"""
if os.path.exists(MPATH_CONF):
- first = second = ''
- svdsm = supervdsm.getProxy()
- mpathconf = svdsm.readMultipathConf()
- try:
- first = mpathconf[0]
- second = mpathconf[1]
- except IndexError:
- pass
+ first, second = _parseConf()
if MPATH_CONF_PRIVATE_TAG in second:
log.info("Manual override for multipath.conf detected - "
"preserving current configuration")
@@ -158,10 +167,17 @@
supported state. The original configuration, if any, is saved
"""
if os.path.exists(MPATH_CONF):
- misc.rotateFiles(
- os.path.dirname(MPATH_CONF),
- os.path.basename(MPATH_CONF), MAX_CONF_COPIES,
- cp=True, persist=True)
+ first, second = _parseConf()
+
+ if not os.path.exists(CONF_BACKUP) and MPATH_CONF_TAG not in first:
+ try:
+ shutil.copyfile(MPATH_CONF, CONF_BACKUP)
+ except IOError:
+ raise se.MultipathSetupError()
+ else:
+ utils.persist(CONF_BACKUP)
+
+
with tempfile.NamedTemporaryFile() as f:
f.write(MPATH_CONF_TEMPLATE % {'scsi_id_path': _scsi_id.cmd})
f.flush()
--
To view, visit http://gerrit.ovirt.org/34077
To unsubscribe, visit http://gerrit.ovirt.org/settings
Gerrit-MessageType: newchange
Gerrit-Change-Id: I96a9251ebc852fcdf39239ba50f43dd2343b83a6
Gerrit-PatchSet: 1
Gerrit-Project: vdsm
Gerrit-Branch: master
Gerrit-Owner: Yeela Kaplan <ykaplan(a)redhat.com>
Dan Kenigsberg has uploaded a new change for review.
Change subject: use SASL_USERNAME instead of its upstream value
......................................................................
use SASL_USERNAME instead of its upstream value
commit 98a2692fe reverted broken code, but it also added new code, that
the reviewer failed to notice. This patch fixes it.
Bug-Url : https://bugzilla.redhat.com/show_bug.cgi?id=1168689
Change-Id: Idf7800e26d95e5da9d64b615de420389bbc7e52f
Signed-off-by: Dan Kenigsberg <danken(a)redhat.com>
---
M vdsm.spec.in
1 file changed, 1 insertion(+), 1 deletion(-)
git pull ssh://gerrit.ovirt.org:29418/vdsm refs/changes/00/35800/1
diff --git a/vdsm.spec.in b/vdsm.spec.in
index 5becd4a..50b9112 100644
--- a/vdsm.spec.in
+++ b/vdsm.spec.in
@@ -761,7 +761,7 @@
%{_bindir}/vdsm-tool configure --module sanlock --force >/dev/null
# update the vdsm "secret" password for libvirt
if [ -f /etc/pki/vdsm/keys/libvirt_password ]; then
- @SASLPASSWD2_PATH@ -p -a libvirt vdsm@ovirt < \
+ @SASLPASSWD2_PATH@ -p -a libvirt @SASL_USERNAME@ < \
/etc/pki/vdsm/keys/libvirt_password
fi
--
To view, visit http://gerrit.ovirt.org/35800
To unsubscribe, visit http://gerrit.ovirt.org/settings
Gerrit-MessageType: newchange
Gerrit-Change-Id: Idf7800e26d95e5da9d64b615de420389bbc7e52f
Gerrit-PatchSet: 1
Gerrit-Project: vdsm
Gerrit-Branch: ovirt-3.5
Gerrit-Owner: Dan Kenigsberg <danken(a)redhat.com>