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>