From bd6a5ebe40025a168472db228dc5ea24e79c558b Mon Sep 17 00:00:00 2001 From: Eric Bollengier Date: Wed, 12 Nov 2008 13:50:00 +0000 Subject: [PATCH] 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 --- bacula/src/dird/dir_plugins.c | 17 ++++++++++++++++- bacula/src/dird/dird.h | 2 +- 2 files changed, 17 insertions(+), 2 deletions(-) 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" -- 2.39.5