diff options
author | Jeremy Kerr <jk@ozlabs.org> | 2013-03-11 17:08:57 +0800 |
---|---|---|
committer | Jeremy Kerr <jk@ozlabs.org> | 2013-04-16 12:57:15 +0800 |
commit | 92806cf6bc15f680f75879288df12ea9a87e4608 (patch) | |
tree | 4a6650d8881dda3c6ee321d1e3350edc646c4baf /discover/parser-conf.c | |
parent | 7b396a45d43cc464539cc25799ddda3a27339bd8 (diff) | |
download | talos-petitboot-92806cf6bc15f680f75879288df12ea9a87e4608.tar.gz talos-petitboot-92806cf6bc15f680f75879288df12ea9a87e4608.zip |
discover: Separate temporary and permanent device data
At present, we keep both permanent (eg links/n_links) and temporary
(event) data in struct discover_context.
This change makes discover_context a temporary structure, just used
during actual device discovery. Once discovery is complete, the
permanent data (discover_device) is "committed" to the device handler.
Signed-off-by: Jeremy Kerr <jk@ozlabs.org>
Diffstat (limited to 'discover/parser-conf.c')
-rw-r--r-- | discover/parser-conf.c | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/discover/parser-conf.c b/discover/parser-conf.c index be19932..247e29d 100644 --- a/discover/parser-conf.c +++ b/discover/parser-conf.c @@ -255,6 +255,7 @@ static void conf_parse_buf(struct conf_context *conf) int conf_parse(struct conf_context *conf) { + struct device *dev; int fd, rc; unsigned int i; struct stat stat; @@ -269,7 +270,7 @@ int conf_parse(struct conf_context *conf) for (i = 0; conf->conf_files[i]; i++) { char *filepath = resolve_path(conf->dc, - conf->conf_files[i], conf->dc->device_path); + conf->conf_files[i], conf->dc->device->device_path); pb_log("%s: try: %s\n", __func__, filepath); @@ -309,8 +310,9 @@ int conf_parse(struct conf_context *conf) if (len <= 0) goto out; - if (!conf->dc->device->icon_file) - conf->dc->device->icon_file = talloc_strdup(conf->dc, + dev = conf->dc->device->device; + if (!dev->icon_file) + dev->icon_file = talloc_strdup(dev, generic_icon_file(guess_device_type(conf->dc))); conf_parse_buf(conf); |