X-Git-Url: https://gerrit.fd.io/r/gitweb?a=blobdiff_plain;f=src%2Fvlib%2Funix%2Fplugin.c;h=a1df3b24b66c00229f6bc93d8012fd38ddae161e;hb=3464c860650c5d8cc8abf11c7d2faa074105b8d6;hp=9b341cc8113f753c0b3b85e239e791fead4a7809;hpb=1bfb0ddace3ebb9010275e4bdd847c8c493ff4b3;p=vpp.git diff --git a/src/vlib/unix/plugin.c b/src/vlib/unix/plugin.c index 9b341cc8113..a1df3b24b66 100644 --- a/src/vlib/unix/plugin.c +++ b/src/vlib/unix/plugin.c @@ -137,15 +137,11 @@ load_one_plugin (plugin_main_t * pm, plugin_info_t * pi, int from_early_init) handle = dlopen ((char *) pi->filename, RTLD_LAZY); - /* - * Note: this can happen if the plugin has an undefined symbol reference, - * so print a warning. Otherwise, the poor slob won't know what happened. - * Ask me how I know that... - */ if (handle == 0) { clib_warning ("%s", dlerror ()); - return -1; + clib_warning ("Failed to load plugin '%s'", pi->name); + goto error; } pi->handle = handle; @@ -365,6 +361,20 @@ vlib_plugin_early_init (vlib_main_t * vm) return vlib_load_new_plugins (pm, 1 /* from_early_init */ ); } +u8 * +vlib_get_vat_plugin_path (void) +{ + plugin_main_t *pm = &vlib_plugin_main; + return (pm->vat_plugin_path); +} + +u8 * +vlib_get_vat_plugin_name_filter (void) +{ + plugin_main_t *pm = &vlib_plugin_main; + return (pm->vat_plugin_name_filter); +} + static clib_error_t * vlib_plugins_show_cmd_fn (vlib_main_t * vm, unformat_input_t * input, vlib_cli_command_t * cmd) @@ -501,6 +511,12 @@ done: u8 *s = 0; if (unformat (input, "path %s", &s)) pm->plugin_path = s; + else if (unformat (input, "name-filter %s", &s)) + pm->plugin_name_filter = s; + else if (unformat (input, "vat-path %s", &s)) + pm->vat_plugin_path = s; + else if (unformat (input, "vat-name-filter %s", &s)) + pm->vat_plugin_name_filter = s; else if (unformat (input, "plugin %s %U", &s, unformat_vlib_cli_sub_input, &sub_input)) {