lib: remove plugin's ABI version
authorPhilippe Proulx <eeppeliteloop@gmail.com>
Fri, 18 Oct 2019 17:47:27 +0000 (13:47 -0400)
committerJérémie Galarneau <jeremie.galarneau@efficios.com>
Wed, 30 Oct 2019 19:14:53 +0000 (15:14 -0400)
We don't need this version property.

We intend for Babeltrace 2.y to be able to load any plugin written for
Babeltrace 2.x, where y ≥ x.

With this patch, `struct __bt_plugin_descriptor` only contains the
plugin's name, because this is the only required property. Optional
properties are within an array of plugin descriptor attributes
(`struct __bt_plugin_descriptor_attribute`). Each plugin descriptor
attribute has a type (`enum __bt_plugin_descriptor_attribute_type`), so
this is how we can introduce new, optional plugin properties, instead of
relying on some ABI version.

The same goes for component class attributes
(`struct __bt_plugin_component_class_descriptor_attribute`) and their
type
(`enum __bt_plugin_component_class_descriptor_attribute_type`).

Signed-off-by: Philippe Proulx <eeppeliteloop@gmail.com>
Change-Id: I4e9658f7d2216f43d872e3acd072dbdf588abe46
Reviewed-on: https://review.lttng.org/c/babeltrace/+/2220
Tested-by: jenkins <jenkins@lttng.org>
Reviewed-by: Francis Deslauriers <francis.deslauriers@efficios.com>
include/babeltrace2/plugin/plugin-dev.h
src/lib/plugin/plugin-so.c

index 85c3ef7f52a6e7f3ac7cb9ae01a63ad5ef7ca421..0db0f6bfa1e9ef779bd50683ea8bc4f4b1194edc 100644 (file)
 extern "C" {
 #endif
 
-/*
- * Plugin interface's version, not synced with Babeltrace's version
- * (internal use).
- */
-#define __BT_PLUGIN_VERSION_MAJOR      1
-#define __BT_PLUGIN_VERSION_MINOR      0
-
 /* Plugin initialization function type */
 typedef enum bt_plugin_initialize_func_status {
        BT_PLUGIN_INITIALIZE_FUNC_STATUS_OK             = __BT_FUNC_STATUS_OK,
@@ -72,12 +65,6 @@ typedef void (*bt_plugin_finalize_func)(void);
 
 /* Plugin descriptor: describes a single plugin (internal use) */
 struct __bt_plugin_descriptor {
-       /* Plugin's interface major version number */
-       uint32_t major;
-
-       /* Plugin's interface minor version number */
-       uint32_t minor;
-
        /* Plugin's name */
        const char *name;
 } __attribute__((packed));
@@ -433,8 +420,6 @@ struct __bt_plugin_component_class_descriptor_attribute const * const *__bt_get_
  */
 #define BT_PLUGIN_WITH_ID(_id, _name)                                  \
        struct __bt_plugin_descriptor __bt_plugin_descriptor_##_id = {  \
-               .major = __BT_PLUGIN_VERSION_MAJOR,                     \
-               .minor = __BT_PLUGIN_VERSION_MINOR,                     \
                .name = _name,                                          \
        };                                                              \
        static struct __bt_plugin_descriptor const * const __bt_plugin_descriptor_##_id##_ptr __BT_PLUGIN_DESCRIPTOR_ATTRS = &__bt_plugin_descriptor_##_id
index 00e51b504104c7ecb6de022323ea5fcb2345598f..bbd91692df285045695ff6eec2492b973b1aefa6 100644 (file)
@@ -1336,25 +1336,8 @@ int bt_plugin_so_create_all_from_sections(
                        continue;
                }
 
-               BT_LOGI("Creating plugin object for plugin: "
-                       "name=\"%s\", abi-major=%d, abi-minor=%d",
-                       descriptor->name, descriptor->major, descriptor->minor);
-
-               if (descriptor->major > __BT_PLUGIN_VERSION_MAJOR) {
-                       if (fail_on_load_error) {
-                               BT_LIB_LOGW_APPEND_CAUSE(
-                                       "Unknown ABI major version: abi-major=%d",
-                                               descriptor->major);
-                               status = BT_FUNC_STATUS_ERROR;
-                               goto error;
-                       } else {
-                               BT_LIB_LOGW(
-                                       "Unknown ABI major version: abi-major=%d",
-                                               descriptor->major);
-                               continue;
-                       }
-               }
-
+               BT_LOGI("Creating plugin object for plugin: name=\"%s\"",
+                       descriptor->name);
                plugin = bt_plugin_so_create_empty(shared_lib_handle);
                if (!plugin) {
                        BT_LIB_LOGE_APPEND_CAUSE(
This page took 0.026453 seconds and 4 git commands to generate.