handlers: pass config to handlers' init()

The handlers may want to consume config parameters, so pass the struct
config to their init call.

Signed-off-by: Jeremy Kerr <jk@ozlabs.org>
diff --git a/console-server.c b/console-server.c
index 40e3a36..183d0ae 100644
--- a/console-server.c
+++ b/console-server.c
@@ -219,7 +219,7 @@
 	return write_buf_to_fd(console->tty_fd, data, len);
 }
 
-static void handlers_init(struct console *console)
+static void handlers_init(struct console *console, struct config *config)
 {
 	extern struct handler *__start_handlers, *__stop_handlers;
 	struct handler *handler;
@@ -237,7 +237,7 @@
 		printf("  %s\n", handler->name);
 
 		if (handler->init)
-			handler->init(handler, console);
+			handler->init(handler, console, config);
 	}
 }
 
@@ -502,7 +502,7 @@
 	if (rc)
 		goto out_config_fini;
 
-	handlers_init(console);
+	handlers_init(console, config);
 
 	rc = run_console(console);
 
diff --git a/console-server.h b/console-server.h
index dcedada..5871019 100644
--- a/console-server.h
+++ b/console-server.h
@@ -3,6 +3,7 @@
 #include <stdint.h>
 
 struct console;
+struct config;
 
 /* handler API */
 enum {
@@ -13,7 +14,8 @@
 struct handler {
 	const char	*name;
 	int		(*init)(struct handler *handler,
-				struct console *console);
+				struct console *console,
+				struct config *config);
 	int		(*data_in)(struct handler *handler,
 				uint8_t *buf, size_t len);
 	void		(*fini)(struct handler *handler);
diff --git a/log-handler.c b/log-handler.c
index eb5f80f..9a387fd 100644
--- a/log-handler.c
+++ b/log-handler.c
@@ -33,7 +33,8 @@
 	return container_of(handler, struct log_handler, handler);
 }
 
-static int log_init(struct handler *handler, struct console *console)
+static int log_init(struct handler *handler, struct console *console,
+		struct config *config __attribute__((unused)))
 {
 	struct log_handler *lh = to_log_handler(handler);
 	int rc;
diff --git a/socket-handler.c b/socket-handler.c
index d7ef00c..6827978 100644
--- a/socket-handler.c
+++ b/socket-handler.c
@@ -108,7 +108,8 @@
 
 }
 
-static int socket_init(struct handler *handler, struct console *console)
+static int socket_init(struct handler *handler, struct console *console,
+		struct config *config __attribute__((unused)))
 {
 	struct socket_handler *sh = to_socket_handler(handler);
 	struct sockaddr_un addr;