Vered Volansky has uploaded a new change for review. Change subject: vdsm: Add after_vdsm_start hook ......................................................................
vdsm: Add after_vdsm_start hook Bug-Url: https://bugzilla.redhat.com/842674 Change-Id: Id02b2b7d091ffa0be57a3850fa97cdcd35778466 Signed-off-by: Vered Volansky <[email protected]> --- M vdsm.spec.in M vdsm/hooks.py M vdsm/vdsmd.8.in M vdsm/vdsmd.init.in M vdsm_hooks/Makefile.am 5 files changed, 13 insertions(+), 4 deletions(-) git pull ssh://gerrit.ovirt.org:29418/vdsm refs/changes/43/13543/1 diff --git a/vdsm.spec.in b/vdsm.spec.in index dbb9d04..f01e348 100644 --- a/vdsm.spec.in +++ b/vdsm.spec.in @@ -821,6 +821,7 @@ %dir %{_libexecdir}/%{vdsm_name}/hooks/before_disk_hotunplug %dir %{_libexecdir}/%{vdsm_name}/hooks/after_disk_hotunplug %dir %{_libexecdir}/%{vdsm_name}/hooks/before_vdsm_start +%dir %{_libexecdir}/%{vdsm_name}/hooks/after_vdsm_start %dir %{_libexecdir}/%{vdsm_name}/hooks/after_vdsm_stop %{_datadir}/%{vdsm_name}/addNetwork %{_datadir}/%{vdsm_name}/configNetwork.py* diff --git a/vdsm/hooks.py b/vdsm/hooks.py index 95516a8..b18a4af 100644 --- a/vdsm/hooks.py +++ b/vdsm/hooks.py @@ -221,6 +221,10 @@ return _runHooksDir(None, 'before_vdsm_start', raiseError=False) +def after_vdsm_start(): + return _runHooksDir(None, 'after_vdsm_start', raiseError=False) + + def after_vdsm_stop(): return _runHooksDir(None, 'after_vdsm_stop', raiseError=False) diff --git a/vdsm/vdsmd.8.in b/vdsm/vdsmd.8.in index 9a1a268..7f62ceb 100644 --- a/vdsm/vdsmd.8.in +++ b/vdsm/vdsmd.8.in @@ -51,15 +51,16 @@ before_nic_hotunplug, after_nic_hotunplug, after_nic_unhotplug_fail, before_disk_hotplug, after_disk_hotplug, before_disk_hotunplug, after_disk_hotunplug, - before_vdsm_start, after_vdsm_stop. + before_vdsm_start, after_vdsm_start, after_vdsm_stop. Each hook executes the scripts under .FN /usr/libexec/vdsm/hooks/<hook-name>/ in lexicographic order. .SS Hook environment -Each hook script (except before_vdsm_start and after_vdsm_stop) inherit the -environment of the VDSM process, with an additional variable +Each hook script (except before_vdsm_start, after_vdsm_start, +and after_vdsm_stop) inherit the environment of the VDSM process, +with an additional variable .B _hook_domxml which holds the path of libvirt's .B domain xml @@ -84,7 +85,7 @@ with a set of params passed by the caller of setVmTicket. .SS Hook execution -before_vdsm_start and after_vdsm_stop scripts are executed as user +before_vdsm_start, after_vdsm_start, and after_vdsm_stop scripts are executed as user .I root. All the other hooks are executed as user .I vdsm. diff --git a/vdsm/vdsmd.init.in b/vdsm/vdsmd.init.in index c804ce8..f241086 100755 --- a/vdsm/vdsmd.init.in +++ b/vdsm/vdsmd.init.in @@ -511,6 +511,8 @@ RETVAL=$? [ "$RETVAL" -eq 0 ] && log_success_msg $"$prog start" || log_failure_msg $"$prog start" [ "$RETVAL" -eq 0 ] && touch /var/lock/subsys/vdsmd + + python @VDSMDIR@/hooks.pyc after_vdsm_start } stop() { diff --git a/vdsm_hooks/Makefile.am b/vdsm_hooks/Makefile.am index fa5a795..6e1f1fe 100644 --- a/vdsm_hooks/Makefile.am +++ b/vdsm_hooks/Makefile.am @@ -88,6 +88,7 @@ before_disk_hotunplug \ after_disk_hotunplug \ before_vdsm_start \ + after_vdsm_start \ after_vdsm_stop all-local: \ -- To view, visit http://gerrit.ovirt.org/13543 To unsubscribe, visit http://gerrit.ovirt.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: Id02b2b7d091ffa0be57a3850fa97cdcd35778466 Gerrit-PatchSet: 1 Gerrit-Project: vdsm Gerrit-Branch: master Gerrit-Owner: Vered Volansky <[email protected]> _______________________________________________ vdsm-patches mailing list [email protected] https://lists.fedorahosted.org/mailman/listinfo/vdsm-patches
