summaryrefslogtreecommitdiffstats
path: root/discover/kboot-parser.c
diff options
context:
space:
mode:
authorJeremy Kerr <jk@ozlabs.org>2013-03-12 16:13:55 +0800
committerJeremy Kerr <jk@ozlabs.org>2013-04-29 14:31:12 +1000
commit06a49ebdfc795a70b938f5aee29f3c488ef9fc21 (patch)
tree57ef497f90ed6dbbccbdd0cedae6e7f0989bd150 /discover/kboot-parser.c
parent39e06f5cfda0ed0c1eeb7a7604a3d05dda81ccf1 (diff)
downloadtalos-petitboot-06a49ebdfc795a70b938f5aee29f3c488ef9fc21.zip
talos-petitboot-06a49ebdfc795a70b938f5aee29f3c488ef9fc21.tar.gz
parsers: change parser.parse to accept a buffer
Rather than having each of the parsers do their own open(), read(), etc, use the registered filenames array to find & open parser conf files. Signed-off-by: Jeremy Kerr <jk@ozlabs.org>
Diffstat (limited to 'discover/kboot-parser.c')
-rw-r--r--discover/kboot-parser.c8
1 files changed, 3 insertions, 5 deletions
diff --git a/discover/kboot-parser.c b/discover/kboot-parser.c
index c828e30..b28603e 100644
--- a/discover/kboot-parser.c
+++ b/discover/kboot-parser.c
@@ -133,10 +133,9 @@ static const char *const kboot_ignored_names[] = {
NULL
};
-static int kboot_parse(struct discover_context *dc)
+static int kboot_parse(struct discover_context *dc, char *buf, int len)
{
struct conf_context *conf;
- int rc;
conf = talloc_zero(dc, struct conf_context);
@@ -146,15 +145,14 @@ static int kboot_parse(struct discover_context *dc)
conf->dc = dc;
conf->global_options = kboot_global_options,
conf_init_global_options(conf);
- conf->conf_files = kboot_conf_files,
conf->get_pair = conf_get_pair_equal;
conf->process_pair = kboot_process_pair;
conf->parser_info = (void *)kboot_ignored_names,
- rc = conf_parse(conf);
+ conf_parse_buf(conf, buf, len);
talloc_free(conf);
- return rc;
+ return 1;
}
struct parser __kboot_parser = {
OpenPOWER on IntegriCloud