Hello Nir Soffer, Dan Kenigsberg,
I'd like you to do a code review. Please visit
to review the following change.
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@redhat.com Reviewed-on: http://gerrit.ovirt.org/35369 Reviewed-by: Nir Soffer nsoffer@redhat.com Reviewed-by: Dan Kenigsberg danken@redhat.com --- M vdsm/storage/hsm.py 1 file changed, 2 insertions(+), 11 deletions(-)
git pull ssh://gerrit.ovirt.org:29418/vdsm refs/changes/09/35809/1
diff --git a/vdsm/storage/hsm.py b/vdsm/storage/hsm.py index 0f6930b..45f1694 100644 --- a/vdsm/storage/hsm.py +++ b/vdsm/storage/hsm.py @@ -362,8 +362,6 @@
oop.setDefaultImpl(config.get('irs', 'oop_impl'))
- self.domainStateChangeCallbacks = set() - # cleanStorageRepoitory uses tasksDir value, this must be assigned # before calling it self.tasksDir = config.get('irs', 'hsm_tasks') @@ -401,10 +399,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) @@ -1074,12 +1071,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:
Adam Litke has posted comments on this change.
Change subject: irs: Directly register domain state change callbacks ......................................................................
Patch Set 1: Verified+1
Dan Kenigsberg has posted comments on this change.
Change subject: irs: Directly register domain state change callbacks ......................................................................
Patch Set 1: Code-Review+1
Dan Kenigsberg has posted comments on this change.
Change subject: irs: Directly register domain state change callbacks ......................................................................
Patch Set 1: Code-Review+2
Dan Kenigsberg has submitted this change and it was merged.
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@redhat.com Reviewed-on: http://gerrit.ovirt.org/35369 Reviewed-by: Nir Soffer nsoffer@redhat.com Reviewed-by: Dan Kenigsberg danken@redhat.com Reviewed-on: http://gerrit.ovirt.org/35809 --- M vdsm/storage/hsm.py 1 file changed, 2 insertions(+), 11 deletions(-)
Approvals: Adam Litke: Verified Dan Kenigsberg: Looks good to me, approved
oVirt Jenkins CI Server has posted comments on this change.
Change subject: irs: Directly register domain state change callbacks ......................................................................
Patch Set 2:
Build Successful
http://jenkins.ovirt.org/job/vdsm_3.5_create-rpms-fc19-x86_64_merged/130/ : SUCCESS
http://jenkins.ovirt.org/job/vdsm_3.5_create-rpms-fc20-x86_64_merged/130/ : SUCCESS
http://jenkins.ovirt.org/job/vdsm_3.5_create-rpms-el7-x86_64_merged/130/ : SUCCESS
http://jenkins.ovirt.org/job/vdsm_3.5_create-rpms-el6-x86_64_merged/133/ : SUCCESS
vdsm-patches@lists.fedorahosted.org