From: Eric Bollengier Date: Wed, 12 Nov 2008 13:50:00 +0000 (+0000) Subject: ebl add debug dump for plugins in director X-Git-Tag: Release-3.0.0~585 X-Git-Url: https://git.sur5r.net/?a=commitdiff_plain;h=bd6a5ebe40025a168472db228dc5ea24e79c558b;p=bacula%2Fbacula ebl add debug dump for plugins in director git-svn-id: https://bacula.svn.sourceforge.net/svnroot/bacula/trunk@8040 91ce42f0-d328-0410-95d8-f526ca767f89 --- diff --git a/bacula/src/dird/dir_plugins.c b/bacula/src/dird/dir_plugins.c index 3c5243656f..b2487543da 100644 --- a/bacula/src/dird/dir_plugins.c +++ b/bacula/src/dird/dir_plugins.c @@ -94,6 +94,21 @@ void generate_plugin_event(JCR *jcr, bEventType eventType, void *value) return; } +static void dump_dir_plugin(Plugin *plugin, FILE *fp) +{ + if (!plugin) { + return ; + } + pInfo *info = (pInfo *) plugin->pinfo; + fprintf(fp, "\tversion=%d\n", info->version); + fprintf(fp, "\tdate=%s\n", NPRTB(info->plugin_date)); + fprintf(fp, "\tmagic=%s\n", NPRTB(info->plugin_magic)); + fprintf(fp, "\tauthor=%s\n", NPRTB(info->plugin_author)); + fprintf(fp, "\tlicence=%s\n", NPRTB(info->plugin_license)); + fprintf(fp, "\tversion=%s\n", NPRTB(info->plugin_version)); + fprintf(fp, "\tdescription=%s\n", NPRTB(info->plugin_description)); +} + void load_dir_plugins(const char *plugin_dir) { if (!plugin_dir) { @@ -102,6 +117,7 @@ void load_dir_plugins(const char *plugin_dir) plugin_list = New(alist(10, not_owned_by_alist)); load_plugins((void *)&binfo, (void *)&bfuncs, plugin_dir, plugin_type); + dbg_plugin_add_hook(dump_dir_plugin); } /* @@ -156,7 +172,6 @@ void free_plugins(JCR *jcr) jcr->plugin_ctx_list = NULL; } - /* ============================================================== * * Callbacks from the plugin diff --git a/bacula/src/dird/dird.h b/bacula/src/dird/dird.h index 71083412e9..f6ba3692ec 100644 --- a/bacula/src/dird/dird.h +++ b/bacula/src/dird/dird.h @@ -36,10 +36,10 @@ #include "lib/runscript.h" #include "lib/breg.h" #include "dird_conf.h" -#include "dir_plugins.h" #define DIRECTOR_DAEMON 1 +#include "dir_plugins.h" #include "cats/cats.h" #include "jcr.h"