Currently, libvirt hook scripts are only searched in the system-wide directory /etc/libvirt/hooks/, which is typically not accessible to non-root users running session daemons. This series adds support for user-level hook scripts located in $XDG_CONFIG_HOME/libvirt/hooks/ (typically ~/.config/libvirt/hooks/). When running as a non-root session daemon, hooks are searched in both the system directory (if accessible) and the user directory, with system hooks executed first. A new "skip_system_hooks" daemon configuration option allows session daemons to skip the system hooks directory entirely, using only user hooks. Plus a preliminary patch to enable b4 usage. --- Marc-André Lureau (7): Add .b4-config util: extract virHookCheckDir from virHookCheck util: handle EACCES when opening hook directories util: search hooks in both system and user directories util: add virHookSetSkipSystemHooks API remote: add skip_system_hooks daemon config option docs: document session hooks support .b4-config | 9 ++ NEWS.rst | 7 ++ docs/hooks.rst | 10 ++ src/libvirt_private.syms | 1 + src/remote/libvirtd.aug.in | 1 + src/remote/libvirtd.conf.in | 9 ++ src/remote/remote_daemon.c | 1 + src/remote/remote_daemon_config.c | 3 + src/remote/remote_daemon_config.h | 2 + src/remote/test_libvirtd.aug.in | 1 + src/util/virhook.c | 243 +++++++++++++++++++++++++++----------- src/util/virhook.h | 1 + 12 files changed, 218 insertions(+), 70 deletions(-) --- base-commit: 9ecbf2a65454704240170676b94b65866b352a34 change-id: 20261006-session-hook-b2fe660603f0 Best regards, -- Marc-André Lureau <marcandre.lureau@redhat.com>