Index: doc/man1/roard.1
===================================================================
--- doc/man1/roard.1	(revision 5399)
+++ doc/man1/roard.1	(revision 5592)
@@ -159,4 +159,8 @@
 Arguments for the plugin.
 (must be given before the \-\-plugin-load).
+
+.TP
+\fB--list-plugins\fR
+List loaded plugins.
 
 .SH "SECURITY"
Index: roard/include/plugins.h
===================================================================
--- roard/include/plugins.h	(revision 5447)
+++ roard/include/plugins.h	(revision 5592)
@@ -45,4 +45,6 @@
 int plugins_load     (const char * filename, const char * args);
 
+void print_pluginlist(enum output_format format);
+
 int plugins_reg_sched(struct roard_plugins_sched * sched);
 int plugins_reg_proto(struct roard_proto         * proto);
Index: roard/plugins.c
===================================================================
--- roard/plugins.c	(revision 5586)
+++ roard/plugins.c	(revision 5592)
@@ -49,17 +49,28 @@
  int i;
 
+ ROAR_DBG("_find_free(void) = ?");
+
  for (i = 0; i < MAX_PLUGINS; i++) {
   if ( g_plugins[i].lhandle == NULL ) {
    memset(&(g_plugins[i]), 0, sizeof(struct _roard_plugin));
+   ROAR_DBG("_find_free(void) = %p // i=%i", &(g_plugins[i]), i);
    return &(g_plugins[i]);
   }
  }
 
+ ROAR_DBG("_find_free(void) = NULL");
  return NULL;
 }
 
 int plugins_preinit  (void) {
+ ROAR_DBG("plugins_preinit(void) = ?");
+
  memset(g_plugins, 0, sizeof(g_plugins));
 
+#ifdef DEBUG
+ print_pluginlist(FORMAT_NATIVE);
+#endif
+
+ ROAR_DBG("plugins_preinit(void) = 0");
  return 0;
 }
@@ -67,4 +78,6 @@
 static inline void plugins_delete(struct _roard_plugin * plugin) {
  int i;
+
+ ROAR_DBG("plugins_delete(plugin=%p) = ?", plugin);
 
  if ( plugin->sched != NULL ) {
@@ -93,4 +106,6 @@
   return -1;
 
+ ROAR_DBG("plugins_init_one(plugin=%p) = ?", plugin);
+
  _pp = plugin;
  _pp->sched = NULL;
@@ -120,5 +135,12 @@
  size_t i;
 
+ ROAR_DBG("plugins_init(void) = ?");
+
+#ifdef DEBUG
+ print_pluginlist(FORMAT_NATIVE);
+#endif
+
  if ( _plugins_inited ) {
+  ROAR_DBG("plugins_init(void) = -1 // error=BUSY");
   roar_err_set(ROAR_ERROR_BUSY);
   return -1;
@@ -135,4 +157,9 @@
  _plugins_inited = 1;
 
+#ifdef DEBUG
+ print_pluginlist(FORMAT_NATIVE);
+#endif
+
+ ROAR_DBG("plugins_init(void) = 0");
  return 0;
 }
@@ -140,4 +167,6 @@
 int plugins_free  (void) {
  int i;
+
+ ROAR_DBG("plugins_free(void) = ?");
 
  for (i = 0; i < MAX_PLUGINS; i++) {
@@ -178,8 +207,10 @@
  int i;
 
+ ROAR_DBG("plugins_load(filename=\"%s\", args=\"%s\") = ?", filename, args);
+
  if ( next == NULL )
   return -1;
 
- for (i = 0; i < MAX_PROTOS; i++)
+ for (i = 0; i < MAX_PLUGINS; i++)
   next->protocols[i] = -1;
 
@@ -201,4 +232,40 @@
 
  return 0;
+}
+
+void print_pluginlist(enum output_format format) {
+ const struct roar_dl_libraryname * libname;
+ struct _roard_plugin * p;
+ size_t i;
+
+ switch (format) {
+  case FORMAT_NATIVE:
+    printf("  Name\n");
+    printf("   Attributes\n");
+    printf("-----------------------------------------------------\n");
+   break;
+  case FORMAT_WIKI:
+  case FORMAT_CSV:
+  default:
+    roar_err_set(ROAR_ERROR_NOTSUP);
+    return;
+ }
+
+ for (i = 0; i < MAX_PLUGINS; i++) {
+  p = &(g_plugins[i]);
+  if ( p->lhandle == NULL )
+   continue;
+
+  libname = roar_dl_getlibname(p->lhandle);
+  if ( libname == NULL ) {
+  } else {
+   printf("  %s\n", libname->libname);
+   printf("   Flags:       %s\n", p->sched != NULL ? "roardsched" : "");
+   if ( libname->description != NULL )
+    printf("   Description: %s\n", libname->description);
+   if ( libname->contact != NULL )
+    printf("   Contact:     %s\n", libname->contact);
+  }
+ }
 }
 
Index: roard/roard.c
===================================================================
--- roard/roard.c	(revision 5586)
+++ roard/roard.c	(revision 5592)
@@ -43,5 +43,6 @@
 enum metaaction {
  MA_ACTION,
- MA_LIST_PROTO
+ MA_LIST_PROTO,
+ MA_LIST_PLUGIN
 };
 
@@ -272,4 +273,5 @@
         " --plugin-args ARGS    - Arguments for the plugin\n"
         "                         (must be given before the --plugin-load)\n"
+        " --list-plugins        - List loaded plugins\n"
        );
 
@@ -1766,4 +1768,6 @@
    _CKHAVEARGS(1);
    plugin_args = argv[++i];
+  } else if ( strcmp(k, "--list-plugins") == 0 ) {
+   metaaction = MA_LIST_PLUGIN;
 
   } else if ( strcmp(k, "--guest-acclev") == 0 ) {
@@ -2467,4 +2471,8 @@
     return 0;
    break;
+  case MA_LIST_PLUGIN:
+    print_pluginlist(print_format);
+    return 0;
+   break;
  }
 #endif
