diff options
author | Loic Dachary <loic-201408@dachary.org> | 2014-08-21 18:38:52 +0200 |
---|---|---|
committer | Loic Dachary <loic-201408@dachary.org> | 2014-08-28 12:17:15 +0200 |
commit | 3c4220e14de50ee74252f90615e050076b0ce442 (patch) | |
tree | c65d77cf79ac294eb094940a30b69495cab3f5af /src/test/erasure-code/ErasureCodePluginFailToInitialize.cc | |
parent | erasure-code: implement ErasureCodePluginRegistry::remove (diff) | |
download | ceph-3c4220e14de50ee74252f90615e050076b0ce442.tar.xz ceph-3c4220e14de50ee74252f90615e050076b0ce442.zip |
erasure-code: add Ceph version check to plugins
Add the __erasure_code_version function to all plugins, to return the
Ceph version against which they have been compiled. When a plugin is
loaded, an error is thrown if the version of the plugin does not match
the version of the daemon loading it.
If the symbol does not exist, which will be true of older plugins, set
the version to "an older version" so it never matches.
http://tracker.ceph.com/issues/9167 Fixes: #9167
Signed-off-by: Loic Dachary <loic-201408@dachary.org>
Diffstat (limited to 'src/test/erasure-code/ErasureCodePluginFailToInitialize.cc')
-rw-r--r-- | src/test/erasure-code/ErasureCodePluginFailToInitialize.cc | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/src/test/erasure-code/ErasureCodePluginFailToInitialize.cc b/src/test/erasure-code/ErasureCodePluginFailToInitialize.cc index 84b0ae49914..f1219fab42a 100644 --- a/src/test/erasure-code/ErasureCodePluginFailToInitialize.cc +++ b/src/test/erasure-code/ErasureCodePluginFailToInitialize.cc @@ -16,9 +16,11 @@ */ #include <errno.h> -#include "erasure-code/ErasureCodePlugin.h" +#include "ceph_ver.h" -int __erasure_code_init(char *plugin_name, char *directory) +extern "C" const char *__erasure_code_version() { return CEPH_GIT_NICE_VER; } + +extern "C" int __erasure_code_init(char *plugin_name, char *directory) { return -ESRCH; } |