summaryrefslogtreecommitdiffstats
path: root/lib/pb-config
diff options
context:
space:
mode:
authorJeremy Kerr <jk@ozlabs.org>2013-09-19 17:16:53 +0800
committerJeremy Kerr <jk@ozlabs.org>2013-09-19 21:36:33 +0800
commitf611bde3f182e9a4befb48a0160d1831708aca67 (patch)
treecacf467246c85c491bf91b3fe46c448c5fdbab94 /lib/pb-config
parent4926cde5c97d09794ec33cca1321bb05a8d43304 (diff)
downloadtalos-petitboot-f611bde3f182e9a4befb48a0160d1831708aca67.tar.gz
talos-petitboot-f611bde3f182e9a4befb48a0160d1831708aca67.zip
discover: Remove unnecessary event passing
Currently, we pass "events" between the udev, user-event and device-handler layers. These events all get sent through device_handler_event, then de-multiplexed to an appropriate handler, depending on their source. Instead, just export relevant device_handler functions, and have the (old) event sources call these functions directly. This also means we can include a lot more of the device hander code in the parser tests. Signed-off-by: Jeremy Kerr <jk@ozlabs.org>
Diffstat (limited to 'lib/pb-config')
-rw-r--r--lib/pb-config/pb-config.c12
1 files changed, 12 insertions, 0 deletions
diff --git a/lib/pb-config/pb-config.c b/lib/pb-config/pb-config.c
index e43ddf8..aad3b9e 100644
--- a/lib/pb-config/pb-config.c
+++ b/lib/pb-config/pb-config.c
@@ -77,6 +77,18 @@ int config_init(void *ctx)
return 0;
}
+/* A non-exported function to allow the test infrastructure to initialise
+ * (and change) the configuration variables */
+struct parser_test;
+struct config __attribute__((unused)) *test_config_init(
+ struct parser_test *test);
+struct config *test_config_init(struct parser_test *test)
+{
+ config = talloc(test, struct config);
+ config_set_defaults(config);
+ return config;
+}
+
const struct config *config_get(void)
{
return config;
OpenPOWER on IntegriCloud