diff options
| author | Renato Westphal <renato@opensourcerouting.org> | 2019-05-06 15:57:02 -0300 |
|---|---|---|
| committer | Renato Westphal <renato@opensourcerouting.org> | 2019-05-06 22:07:18 -0300 |
| commit | 1b8de275c84f2bd079666364d899c243274dbf50 (patch) | |
| tree | b45075413b344b4f58c41daff1053a39c5dd0a57 /lib/yang.c | |
| parent | 95f092540e525aac639863743373b789fed0b3ec (diff) | |
lib, yang: disable libyang custom user types temporarily
libyang 1.0 introduced a few changes in the user types API, and
these changes made FRR incompatible with libyang 1.x. In order to
ease our migration from libyang 0.x to libyang 1.x, let's disable
our libyang custom user types temporarily so that FRR can work
with both libyang 0.x and libyang 1.x. This should be especially
helpful to the CI systems during the transition. Once the migration
to libyang 1.x is complete, this commit will be reverted.
Disabling our libyang custom user types should have only
minimal performance implications when processing configuration
transactions. The user types infrastructure should be more important
in the future to perform canonization of YANG data values when
necessary.
Signed-off-by: Renato Westphal <renato@opensourcerouting.org>
Diffstat (limited to 'lib/yang.c')
| -rw-r--r-- | lib/yang.c | 45 |
1 files changed, 0 insertions, 45 deletions
diff --git a/lib/yang.c b/lib/yang.c index 2a2c155dee..2f9a9aa5a3 100644 --- a/lib/yang.c +++ b/lib/yang.c @@ -617,14 +617,6 @@ static void ly_log_cb(LY_LOG_LEVEL level, const char *msg, const char *path) zlog(priority, "libyang: %s", msg); } -#if CONFDATE > 20190401 -CPP_NOTICE("lib/yang: time to remove non-LIBYANG_EXT_BUILTIN support") -#endif - -#ifdef LIBYANG_EXT_BUILTIN -extern struct lytype_plugin_list frr_user_types[]; -#endif - struct ly_ctx *yang_ctx_new_setup(void) { struct ly_ctx *ctx; @@ -650,31 +642,10 @@ struct ly_ctx *yang_ctx_new_setup(void) void yang_init(void) { -#ifndef LIBYANG_EXT_BUILTIN -CPP_NOTICE("lib/yang: deprecated libyang <0.16.74 extension loading in use!") - static char ly_plugin_dir[PATH_MAX]; - const char *const *ly_loaded_plugins; - const char *ly_plugin; - bool found_ly_frr_types = false; - - /* Tell libyang where to find its plugins. */ - snprintf(ly_plugin_dir, sizeof(ly_plugin_dir), "%s=%s", - "LIBYANG_USER_TYPES_PLUGINS_DIR", LIBYANG_PLUGINS_PATH); - putenv(ly_plugin_dir); -#endif - /* Initialize libyang global parameters that affect all containers. */ ly_set_log_clb(ly_log_cb, 1); ly_log_options(LY_LOLOG | LY_LOSTORE); -#ifdef LIBYANG_EXT_BUILTIN - if (ly_register_types(frr_user_types, "frr_user_types")) { - flog_err(EC_LIB_LIBYANG_PLUGIN_LOAD, - "ly_register_types() failed"); - exit(1); - } -#endif - /* Initialize libyang container for native models. */ ly_native_ctx = yang_ctx_new_setup(); if (!ly_native_ctx) { @@ -682,22 +653,6 @@ CPP_NOTICE("lib/yang: deprecated libyang <0.16.74 extension loading in use!") exit(1); } -#ifndef LIBYANG_EXT_BUILTIN - /* Detect if the required libyang plugin(s) were loaded successfully. */ - ly_loaded_plugins = ly_get_loaded_plugins(); - for (size_t i = 0; (ly_plugin = ly_loaded_plugins[i]); i++) { - if (strmatch(ly_plugin, "frr_user_types")) { - found_ly_frr_types = true; - break; - } - } - if (!found_ly_frr_types) { - flog_err(EC_LIB_LIBYANG_PLUGIN_LOAD, - "%s: failed to load frr_user_types.so", __func__); - exit(1); - } -#endif - yang_translator_init(); } |
