]> git.ipfire.org Git - thirdparty/asterisk.git/commit
loader.c: Allow dependent modules to be unloaded recursively.
authorNaveen Albert <asterisk@phreaknet.org>
Sat, 2 Dec 2023 23:07:02 +0000 (18:07 -0500)
committerasterisk-org-access-app[bot] <120671045+asterisk-org-access-app[bot]@users.noreply.github.com>
Tue, 30 Apr 2024 14:14:17 +0000 (14:14 +0000)
commit01ff5c8140e67fe480a04345e54b0e7a2c0cbd71
tree3fdbbbb8acf1af53b2ad401c4d23ff20e8f350a8
parentb267629b7702fbead77104c7304e1a72375f682d
loader.c: Allow dependent modules to be unloaded recursively.

Because of the (often recursive) nature of module dependencies in
Asterisk, hot swapping a module on the fly is cumbersome if a module
is depended on by other modules. Currently, dependencies must be
popped manually by unloading dependents, unloading the module of
interest, and then loading modules again in reverse order.

To make this easier, the ability to do this recursively in certain
circumstances has been added, as an optional extension to the
"module refresh" command. If requested, Asterisk will check if a module
that has a positive usecount could be unloaded safely if anything
recursively dependent on it were unloaded. If so, it will go ahead
and unload all these modules and load them back again. This makes
hot swapping modules that provide dependencies much easier.

Resolves: #474

UserNote: In certain circumstances, modules with dependency relations
can have their dependents automatically recursively unloaded and loaded
again using the "module refresh" CLI command or the ModuleLoad AMI command.
include/asterisk/module.h
main/cli.c
main/loader.c
main/manager.c