* Called when trying to start a plugin directory through RPC, it registers * all contained plugins recursively and then starts them. */
| 91 | * all contained plugins recursively and then starts them. |
| 92 | */ |
| 93 | static struct command_result * |
| 94 | plugin_dynamic_startdir(struct plugin_command *pcmd, const char *dir_path) |
| 95 | { |
| 96 | const char *err; |
| 97 | struct command_result *res; |
| 98 | |
| 99 | err = add_plugin_dir(pcmd->cmd->ld->plugins, dir_path, false); |
| 100 | if (err) |
| 101 | return command_fail(pcmd->cmd, JSONRPC2_INVALID_PARAMS, "%s", err); |
| 102 | |
| 103 | /* If none added, this calls plugin_cmd_all_complete immediately */ |
| 104 | res = plugin_register_all_complete(pcmd->cmd->ld, pcmd); |
| 105 | if (res) |
| 106 | return res; |
| 107 | |
| 108 | plugins_send_getmanifest(pcmd->cmd->ld->plugins, pcmd->cmd->id); |
| 109 | return command_still_pending(pcmd->cmd); |
| 110 | } |
| 111 | |
| 112 | static struct command_result *plugin_stop(struct command *cmd, struct plugin *p, |
| 113 | bool kill) |
no test coverage detected