vlib: add plugin override support
Allow a plugin to override (suppress loading of) other plugins. This
mechanism allows a developer to prevent specific plugins from being
loaded.
To do so, provide an "overrides" list in the plugin definition:
VLIB_PLUGIN_REGISTER () =
{
<snip>
.overrides = "avf_plugin.so,ioam_plugin.so,dpdk_plugin.so",
};
or some such. Simply list the plugins in question as shown above. The
.overrides structure member is limited to 256 octets. The named .elf
section mechanism used to discover the vlib_plugin_registration_t's
precludes the use of a variable-length array of strings.
Use the vlib log to eliminate plugin and built-in vat plugin loader
console spew.
Added vlib_log_register_class_rate_limit(...) to allow procedural
configuration of the log rate-limit. We *never* want to rate-limit
plugin loader messages.
Type: feature
Signed-off-by: Dave Barach <dave@barachs.net>
Change-Id: I0a9327b8cf5508482f057342783252112cb44170
diff --git a/src/vlib/unix/plugin.h b/src/vlib/unix/plugin.h
index 2a23827..30039c5 100644
--- a/src/vlib/unix/plugin.h
+++ b/src/vlib/unix/plugin.h
@@ -61,6 +61,7 @@
u8 default_disabled;
const char version[32];
const char version_required[32];
+ const char overrides[256];
const char *early_init;
const char *description;
}) vlib_plugin_registration_t;
@@ -91,6 +92,7 @@
/* loaded plugin info */
plugin_info_t *plugin_info;
uword *plugin_by_name_hash;
+ uword *plugin_overrides_by_name_hash;
/* paths and name filters */
u8 *plugin_path;
@@ -103,6 +105,9 @@
plugin_config_t *configs;
uword *config_index_by_name;
+ /* Plugin log, avoid filling syslog w/ junk */
+ vlib_log_class_t logger;
+
/* usual */
vlib_main_t *vlib_main;
} plugin_main_t;