diff options
author | Jeremy Kerr <jk@ozlabs.org> | 2013-09-19 17:16:53 +0800 |
---|---|---|
committer | Jeremy Kerr <jk@ozlabs.org> | 2013-09-19 21:36:33 +0800 |
commit | f611bde3f182e9a4befb48a0160d1831708aca67 (patch) | |
tree | cacf467246c85c491bf91b3fe46c448c5fdbab94 /test/parser/handler.c | |
parent | 4926cde5c97d09794ec33cca1321bb05a8d43304 (diff) | |
download | talos-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 'test/parser/handler.c')
-rw-r--r-- | test/parser/handler.c | 32 |
1 files changed, 32 insertions, 0 deletions
diff --git a/test/parser/handler.c b/test/parser/handler.c index f585c31..437f765 100644 --- a/test/parser/handler.c +++ b/test/parser/handler.c @@ -1,9 +1,12 @@ +#include <assert.h> + #include <talloc/talloc.h> #include <types/types.h> #include "device-handler.h" +typedef void (*boot_status_fn)(void *arg, struct boot_status *); void discover_server_notify_device_add(struct discover_server *server, struct device *device) @@ -26,3 +29,32 @@ void discover_server_notify_device_remove(struct discover_server *server, (void)device; } +void discover_server_notify_boot_status(struct discover_server *server, + struct boot_status *status) +{ + (void)server; + (void)status; +} + +void parser_init(void) +{ +} + +void iterate_parsers(struct discover_context *ctx, enum conf_method method) +{ + (void)ctx; + (void)method; + assert(false); +} + +int boot(void *ctx, struct discover_boot_option *opt, struct boot_command *cmd, + int dry_run, boot_status_fn status_fn, void *status_arg) +{ + (void)ctx; + (void)opt; + (void)cmd; + (void)dry_run; + (void)status_fn; + (void)status_arg; + assert(false); +} |