Remove some of the more noisy log messages, and add some information
pertinent to device resolution events.
Signed-off-by: Jeremy Kerr <jk@ozlabs.org>
resource_is_resolved(opt->icon);
}
resource_is_resolved(opt->icon);
}
-static bool resource_resolve(struct resource *res, struct parser *parser,
+static bool resource_resolve(struct resource *res, const char *name,
+ struct discover_boot_option *opt,
struct device_handler *handler)
{
struct device_handler *handler)
{
+ struct parser *parser = opt->source;
+
if (resource_is_resolved(res))
return true;
if (resource_is_resolved(res))
return true;
+ pb_log("Attempting to resolve resource %s->%s with parser %s\n",
+ opt->option->id, name, parser->name);
parser->resolve_resource(handler, res);
return res->resolved;
parser->resolve_resource(handler, res);
return res->resolved;
static bool boot_option_resolve(struct discover_boot_option *opt,
struct device_handler *handler)
{
static bool boot_option_resolve(struct discover_boot_option *opt,
struct device_handler *handler)
{
- return resource_resolve(opt->boot_image, opt->source, handler) &&
- resource_resolve(opt->initrd, opt->source, handler) &&
- resource_resolve(opt->icon, opt->source, handler);
+ return resource_resolve(opt->boot_image, "boot_image", opt, handler) &&
+ resource_resolve(opt->initrd, "initrd", opt, handler) &&
+ resource_resolve(opt->icon, "icon", opt, handler);
}
static void boot_option_finalise(struct discover_boot_option *opt)
}
static void boot_option_finalise(struct discover_boot_option *opt)
list_for_each_entry_safe(&handler->unresolved_boot_options,
opt, tmp, list) {
list_for_each_entry_safe(&handler->unresolved_boot_options,
opt, tmp, list) {
+ pb_log("queue: attempting resolution for %s\n",
+ opt->option->id);
+
if (!boot_option_resolve(opt, handler))
continue;
if (!boot_option_resolve(opt, handler))
continue;
+ pb_log("\tresolved!\n");
+
list_remove(&opt->list);
list_add(&opt->device->boot_options, &opt->list);
talloc_steal(opt->device, opt);
list_remove(&opt->list);
list_add(&opt->device->boot_options, &opt->list);
talloc_steal(opt->device, opt);
/* this new device might be able to resolve existing boot
* options */
/* this new device might be able to resolve existing boot
* options */
+ pb_log("New device %s, processing queue\n", dev->device->id);
process_boot_option_queue(handler);
}
process_boot_option_queue(handler);
}
list_remove(&opt->list);
if (boot_option_resolve(opt, handler)) {
list_remove(&opt->list);
if (boot_option_resolve(opt, handler)) {
+ pb_log("boot option %s is resolved, "
+ "sending to clients\n",
+ opt->option->id);
list_add(&dev->boot_options, &opt->list);
talloc_steal(dev, opt);
boot_option_finalise(opt);
list_add(&dev->boot_options, &opt->list);
talloc_steal(dev, opt);
boot_option_finalise(opt);
- pb_log("%s: @%s@%s@\n", __func__, *name_out, *value_out);
-
return end ? end + 1 : NULL;
}
return end ? end + 1 : NULL;
}
if (streq(name, conf->global_options[i].name)) {
conf->global_options[i].value
= talloc_strdup(conf, value);
if (streq(name, conf->global_options[i].name)) {
conf->global_options[i].value
= talloc_strdup(conf, value);
- pb_log("%s: @%s@%s@\n", __func__, name, value);
+ pb_log("%s: %s = '%s'\n", __func__, name, value);
assert(conf->global_options);
for (i = 0; conf->global_options[i].name ;i++)
assert(conf->global_options);
for (i = 0; conf->global_options[i].name ;i++)
- if (streq(name, conf->global_options[i].name)) {
- pb_log("%s: @%s@%s@\n", __func__, name,
- conf->global_options[i].value);
+ if (streq(name, conf->global_options[i].name))
return conf->global_options[i].value;
return conf->global_options[i].value;
assert(0 && "unknown global name");
return NULL;
assert(0 && "unknown global name");
return NULL;
rc = read_file(ctx, path, &buf, &len);
if (!rc) {
rc = read_file(ctx, path, &buf, &len);
if (!rc) {
+ pb_log("Running parser %s on file %s\n",
+ parser->name, *filename);
parser->parse(ctx, buf, len);
talloc_free(buf);
}
parser->parse(ctx, buf, len);
talloc_free(buf);
}
#include <string.h>
#include <url/url.h>
#include <string.h>
#include <url/url.h>
#include <talloc/talloc.h>
#include "device-handler.h"
#include <talloc/talloc.h>
#include "device-handler.h"
devstr = talloc_strndup(res, devpath, pos - devpath);
path = talloc_strdup(res, pos + 1);
devstr = talloc_strndup(res, devpath, pos - devpath);
path = talloc_strdup(res, pos + 1);
+ pb_log("%s: resource depends on device %s\n", __func__, devstr);
+
/* defer resolution until we can find a suitable matching device */
info = talloc(res, struct devpath_resource_info);
info->dev = devstr;
/* defer resolution until we can find a suitable matching device */
info = talloc(res, struct devpath_resource_info);
info->dev = devstr;
- udev_list_entry_foreach(entry, list) {
- DBG("property: %s - %s\n",
- udev_list_entry_get_name(entry),
- udev_device_get_property_value(dev,
- udev_list_entry_get_name(entry)));
-
+ udev_list_entry_foreach(entry, list)
event_set_param(event,udev_list_entry_get_name(entry),
udev_list_entry_get_value(entry));
event_set_param(event,udev_list_entry_get_name(entry),
udev_list_entry_get_value(entry));
}
static int udev_handle_dev_action(struct udev_device *dev, const char *action)
}
static int udev_handle_dev_action(struct udev_device *dev, const char *action)
struct pb_url *url;
const char *p;
struct pb_url *url;
const char *p;
- pb_log("%s: '%s'\n", __func__, url_str);
-
if (!url_str || !*url_str) {
assert(0 && "bad url");
return NULL;
if (!url_str || !*url_str) {
assert(0 && "bad url");
return NULL;
- pb_log(" scheme %d\n", url->scheme);
- pb_log(" host '%s'\n", url->host);
- pb_log(" port '%s'\n", url->port);
- pb_log(" path '%s'\n", url->path);
- pb_log(" dir '%s'\n", url->dir);
- pb_log(" file '%s'\n", url->file);
-