[Asterisk-code-review] loader: Process module dependencies. (asterisk[master])

Corey Farrell asteriskteam at digium.com
Thu Jan 11 17:55:53 CST 2018


Corey Farrell has posted comments on this change. ( https://gerrit.asterisk.org/7873 )

Change subject: loader: Process module dependencies.
......................................................................


Patch Set 3:

(2 comments)

https://gerrit.asterisk.org/#/c/7873/3/main/loader.c
File main/loader.c:

https://gerrit.asterisk.org/#/c/7873/3/main/loader.c@234
PS3, Line 234:  * \param missing Vector to store name of any enhancer that is not running or declined.
> I'm not sure if the help text is wrong, the code or I am just all around mi
This is intentional.  'missing' contains only modules which must be running before 'mod' can be started.  An enhancer is only required if it not declined.  Some modules decline load they are disabled by configuration, in that case the enhancer will never load.

This doesn't make a difference with the current dependencies that are added (enhancers aren't widely used yet).  A potential future use case is if res_hep_pjsip had '.enhances = "res_hep,res_pjsip"' instead of '.requires'.  If res_hep is disabled by configuration res_hep_pjsip would decline.  chan_pjsip already requires res_pjsip, so the system would try starting res_hep_pjsip after res_hep / res_pjsip but before chan_pjsip.


https://gerrit.asterisk.org/#/c/7873/3/main/loader.c@1487
PS3, Line 1487: 		if (module_deps_reference(mod, NULL)) {
              : 			ast_log(LOG_WARNING, "Module '%s' could not be loaded due to missing dependencies.\n", resource_name);
              : 			unload_dynamic_module(mod);
              : 
              : 			return required ? AST_MODULE_LOAD_FAILURE : AST_MODULE_LOAD_DECLINE;
              : 		}
> Not sure if this would be the best place to do it, but do you think it woul
Actually start_resource already does that, so this block can just be removed.  I'm not sure why I left this here, might have been to allow me to deal with the required argument but that's unneeded.  required is never true when resource_heap == NULL.



-- 
To view, visit https://gerrit.asterisk.org/7873
To unsubscribe, visit https://gerrit.asterisk.org/settings

Gerrit-Project: asterisk
Gerrit-Branch: master
Gerrit-MessageType: comment
Gerrit-Change-Id: I9be08d1dd331aceadc1dcba00b804d71360b2fbb
Gerrit-Change-Number: 7873
Gerrit-PatchSet: 3
Gerrit-Owner: Corey Farrell <git at cfware.com>
Gerrit-Reviewer: Corey Farrell <git at cfware.com>
Gerrit-Reviewer: Jenkins2
Gerrit-Reviewer: Kevin Harwell <kharwell at digium.com>
Gerrit-Comment-Date: Thu, 11 Jan 2018 23:55:53 +0000
Gerrit-HasComments: Yes
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.digium.com/pipermail/asterisk-code-review/attachments/20180111/4b6b62f0/attachment-0001.html>


More information about the asterisk-code-review mailing list