diff options
author | Geoff Levand <geoff@infradead.org> | 2018-08-02 17:29:34 +0000 |
---|---|---|
committer | Samuel Mendoza-Jonas <sam@mendozajonas.com> | 2018-08-07 11:30:36 +1000 |
commit | c78f9ec47ba92b74698dacdae963dbbefd9b676f (patch) | |
tree | 58ce2f0f50f8edb451f81d9ecedc9abc842bc3d6 /discover | |
parent | 679d9dceb5bdf51f118548ca2645dc81088a8974 (diff) | |
download | talos-petitboot-c78f9ec47ba92b74698dacdae963dbbefd9b676f.tar.gz talos-petitboot-c78f9ec47ba92b74698dacdae963dbbefd9b676f.zip |
lib/log: Switch to pb_log_fn
The only functional change should be an additional '/n' to
a few log messagees that seemed to be missing it.
Signed-off-by: Geoff Levand <geoff@infradead.org>
Signed-off-by: Samuel Mendoza-Jonas <sam@mendozajonas.com>
Diffstat (limited to 'discover')
-rw-r--r-- | discover/boot.c | 14 | ||||
-rw-r--r-- | discover/device-handler.c | 8 | ||||
-rw-r--r-- | discover/devmapper.c | 14 | ||||
-rw-r--r-- | discover/discover-server.c | 6 | ||||
-rw-r--r-- | discover/event.c | 8 | ||||
-rw-r--r-- | discover/ipmi.c | 2 | ||||
-rw-r--r-- | discover/platform-powerpc.c | 4 | ||||
-rw-r--r-- | discover/pxe-parser.c | 2 | ||||
-rw-r--r-- | discover/resource.c | 2 | ||||
-rw-r--r-- | discover/udev.c | 4 | ||||
-rw-r--r-- | discover/user-event.c | 16 |
11 files changed, 40 insertions, 40 deletions
diff --git a/discover/boot.c b/discover/boot.c index 04c32a1..7faec9f 100644 --- a/discover/boot.c +++ b/discover/boot.c @@ -94,7 +94,7 @@ static int kexec_load(struct boot_task *boot_task) process = process_create(boot_task); if (!process) { - pb_log("%s: failed to create process\n", __func__); + pb_log_fn("failed to create process\n"); return -1; } @@ -131,14 +131,14 @@ static int kexec_load(struct boot_task *boot_task) result = process_run_sync(process); if (result) { - pb_log("%s: failed to run process\n", __func__); + pb_log_fn("failed to run process\n"); goto abort_kexec; } result = process->exit_status; if (result) { - pb_log("%s: failed: (%d)\n", __func__, result); + pb_log_fn("failed: (%d)\n", result); update_status(boot_task->status_fn, boot_task->status_arg, STATUS_ERROR, "%s", process->stdout_buf); } @@ -170,7 +170,7 @@ static int kexec_reboot(struct boot_task *task) } if (result) - pb_log("%s: failed: (%d)\n", __func__, result); + pb_log_fn("failed: (%d)\n", result); /* okay, kexec -e -f */ if (result) { @@ -179,7 +179,7 @@ static int kexec_reboot(struct boot_task *task) } if (result) - pb_log("%s: failed: (%d)\n", __func__, result); + pb_log_fn("failed: (%d)\n", result); return result; @@ -423,7 +423,7 @@ static void boot_process(struct load_url_result *result, void *data) _("Performing kexec load")); rc = kexec_load(task); - pb_log("%s: kexec_load returned %d\n", __func__, rc); + pb_log_fn("kexec_load returned %d\n", rc); if (rc == KEXEC_LOAD_DECRYPTION_FALURE) { update_status(task->status_fn, task->status_arg, STATUS_ERROR, _("Decryption failed")); @@ -526,7 +526,7 @@ struct boot_task *boot(void *ctx, struct discover_boot_option *opt, } else if (opt && opt->boot_image) { image = opt->boot_image->url; } else { - pb_log("%s: no image specified\n", __func__); + pb_log_fn("no image specified\n"); update_status(status_fn, status_arg, STATUS_INFO, _("Boot failed: no image specified")); return NULL; diff --git a/discover/device-handler.c b/discover/device-handler.c index 69bc050..1299c33 100644 --- a/discover/device-handler.c +++ b/discover/device-handler.c @@ -675,7 +675,7 @@ void device_handler_status_download(struct device_handler *handler, } if (!update) { - pb_log("%s: failed to allocate new status\n", __func__); + pb_log_fn("failed to allocate new status\n"); } else { device_handler_status_info(handler, "%s\n", update); talloc_free(update); @@ -1568,7 +1568,7 @@ static void process_url_cb(struct load_url_result *result, void *data) const char *mac; if (result->status != LOAD_OK) { - pb_log("%s: Load failed for %s\n", __func__, result->url->full); + pb_log_fn("Load failed for %s\n", result->url->full); return; } @@ -1673,7 +1673,7 @@ static void plugin_install_cb(struct process *process) struct device_handler *handler = process->data; if (!handler) { - pb_log("%s: Missing data!\n", __func__); + pb_log_fn("Missing data!\n"); return; } @@ -2206,7 +2206,7 @@ void device_handler_discover_context_commit( struct device_handler *handler __attribute__((unused)), struct discover_context *ctx __attribute__((unused))) { - pb_log("%s stubbed out for test cases\n", __func__); + pb_log_fn("stubbed out for test cases\n"); } static void device_handler_update_lang(const char *lang __attribute__((unused))) diff --git a/discover/devmapper.c b/discover/devmapper.c index d8445e6..f7407b7 100644 --- a/discover/devmapper.c +++ b/discover/devmapper.c @@ -138,7 +138,7 @@ static bool snapshot_merge_complete(const char *dm_name) task = dm_task_create(DM_DEVICE_STATUS); if (!task) { - pb_log("%s: Error creating task\n", __func__); + pb_log_fn("Error creating task\n"); return result; } @@ -198,7 +198,7 @@ static int set_device_active(const char *dm_name, bool active) task = dm_task_create(DM_DEVICE_SUSPEND); if (!task) { - pb_log("%s: Could not create dm_task\n", __func__); + pb_log_fn("Could not create dm_task\n"); return rc; } @@ -461,7 +461,7 @@ static int destroy_device(const char *dm_name) task = dm_task_create(DM_DEVICE_REMOVE); if (!task) { - pb_log("%s: could not create dm_task\n", __func__); + pb_log_fn("could not create dm_task\n"); return -1; } @@ -543,13 +543,13 @@ static int reload_snapshot(struct discover_device *device, bool merge) device->ramdisk->base); } if (!target.ttype || !target.params) { - pb_log("%s: failed to allocate parameters\n", __func__); + pb_log_fn("failed to allocate parameters\n"); goto err1; } task = dm_task_create(DM_DEVICE_RELOAD); if (!task) { - pb_log("%s: Error creating task\n", __func__); + pb_log_fn("Error creating task\n"); goto err1; } @@ -560,7 +560,7 @@ static int reload_snapshot(struct discover_device *device, bool merge) if (!dm_task_add_target(task, target.start_sector, target.end_sector, target.ttype, target.params)) { - pb_log("%s: Failed to set target\n", __func__); + pb_log_fn("Failed to set target\n"); goto err2; } @@ -581,7 +581,7 @@ err1: int devmapper_merge_snapshot(struct discover_device *device) { if (device->mounted) { - pb_log("%s: %s still mounted\n", __func__, device->device->id); + pb_log_fn("%s still mounted\n", device->device->id); return -1; } diff --git a/discover/discover-server.c b/discover/discover-server.c index 3377fa6..34d82be 100644 --- a/discover/discover-server.c +++ b/discover/discover-server.c @@ -270,7 +270,7 @@ static int discover_server_process_message(void *arg) rc = pb_protocol_deserialise_boot_command(boot_command, message); if (rc) { - pb_log("%s: no boot command?", __func__); + pb_log_fn("no boot command?\n"); return 0; } @@ -291,7 +291,7 @@ static int discover_server_process_message(void *arg) rc = pb_protocol_deserialise_config(config, message); if (rc) { - pb_log("%s: no config?", __func__); + pb_log_fn("no config?\n"); return 0; } @@ -328,7 +328,7 @@ static int discover_server_process_message(void *arg) break; default: - pb_log("%s: invalid action %d\n", __func__, message->action); + pb_log_fn("invalid action %d\n", message->action); return 0; } diff --git a/discover/event.c b/discover/event.c index 047e928..ead2fda 100644 --- a/discover/event.c +++ b/discover/event.c @@ -29,14 +29,14 @@ static int event_parse_ad_header(char *buf, int len, enum event_action *action, headerlen = strnlen(buf, len); if (!headerlen) { - pb_log("%s: bad header, no data\n", __func__); + pb_log_fn("bad header, no data\n"); return -1; } /* we should see an <action>@<device>\0 at the head of the buffer */ sep = strchr(buf, '@'); if (!sep) { - pb_log("%s: bad header: %s\n", __func__, buf); + pb_log_fn("bad header: %s\n", buf); return -1; } @@ -58,12 +58,12 @@ static int event_parse_ad_header(char *buf, int len, enum event_action *action, else if (streq(buf, "plugin")) *action = EVENT_ACTION_PLUGIN; else { - pb_log("%s: unknown action: %s\n", __func__, buf); + pb_log_fn("unknown action: %s\n", buf); return -1; } if (!*(sep + 1)) { - pb_log("%s: bad device: %s\n", __func__, buf); + pb_log_fn("bad device: %s\n", buf); return -1; } diff --git a/discover/ipmi.c b/discover/ipmi.c index d652e9f..f94dab7 100644 --- a/discover/ipmi.c +++ b/discover/ipmi.c @@ -239,7 +239,7 @@ int parse_ipmi_interface_override(struct config *config, uint8_t *buf, i += sizeof(ipsize); if (!hwsize || !ipsize) { - pb_log("%s: Empty response\n", __func__); + pb_log_fn("Empty response\n"); return -1; } diff --git a/discover/platform-powerpc.c b/discover/platform-powerpc.c index df8c7d6..22d213d 100644 --- a/discover/platform-powerpc.c +++ b/discover/platform-powerpc.c @@ -1193,7 +1193,7 @@ static void get_ipmi_network_override(struct platform_powerpc *platform, memcpy(&cookie, &resp[i], sizeof(cookie)); cookie = __be32_to_cpu(cookie); if (cookie != magic_value) { - pb_log("%s: Incorrect cookie %x\n", __func__, cookie); + pb_log_fn("Incorrect cookie %x\n", cookie); return; } i += sizeof(cookie); @@ -1259,7 +1259,7 @@ static int load_config(struct platform *p, struct config *config) rc = parse_nvram(platform); if (rc) - pb_log("%s: Failed to parse nvram\n", __func__); + pb_log_fn("Failed to parse nvram\n"); populate_config(platform, config); diff --git a/discover/pxe-parser.c b/discover/pxe-parser.c index 9221f95..ba0f81c 100644 --- a/discover/pxe-parser.c +++ b/discover/pxe-parser.c @@ -500,7 +500,7 @@ static int pxe_parse(struct discover_context *dc) file_url = dc->conf_url; if (!file_url) { - pb_log("%s: Failed to parse conf url!\n", __func__); + pb_log_fn("Failed to parse conf url!\n"); goto out_conf; } diff --git a/discover/resource.c b/discover/resource.c index 04e14cb..c09c1c5 100644 --- a/discover/resource.c +++ b/discover/resource.c @@ -86,7 +86,7 @@ struct resource *create_devpath_resource(struct discover_boot_option *opt, devstr = talloc_strndup(res, devpath, pos - devpath); path = talloc_strdup(res, pos + 1); - pb_log("%s: resource depends on device %s\n", __func__, devstr); + pb_log_fn("resource depends on device %s\n", devstr); /* defer resolution until we can find a suitable matching device */ info = talloc(res, struct devpath_resource_info); diff --git a/discover/udev.c b/discover/udev.c index 883313b..fa5d4b4 100644 --- a/discover/udev.c +++ b/discover/udev.c @@ -81,11 +81,11 @@ static void udev_setup_device_params(struct udev_device *udev, static void lvm_vg_search(struct device_handler *handler) { if (process_run_simple(handler, pb_system_apps.vgscan, "-qq", NULL)) - pb_log("%s: Failed to execute vgscan\n", __func__); + pb_log_fn("Failed to execute vgscan\n"); if (process_run_simple(handler, pb_system_apps.vgchange, "-ay", "-qq", NULL)) - pb_log("%s: Failed to execute vgchange\n", __func__); + pb_log_fn("Failed to execute vgchange\n"); } static int udev_handle_block_add(struct pb_udev *udev, struct udev_device *dev, diff --git a/discover/user-event.c b/discover/user-event.c index 128186b..1257796 100644 --- a/discover/user-event.c +++ b/discover/user-event.c @@ -94,13 +94,13 @@ static struct resource *user_event_resource(struct discover_boot_option *opt, siaddr = event_get_param(event, "siaddr"); if (!siaddr) { - pb_log("%s: next server option not found\n", __func__); + pb_log_fn("next server option not found\n"); return NULL; } boot_file = event_get_param(event, "bootfile"); if (!boot_file) { - pb_log("%s: bootfile not found\n", __func__); + pb_log_fn("bootfile not found\n"); return NULL; } @@ -148,7 +148,7 @@ static int parse_user_event(struct discover_context *ctx, struct event *event) val = event_get_param(event, "name"); if (!val) { - pb_log("%s: no name found\n", __func__); + pb_log_fn("no name found\n"); goto fail_opt; } @@ -157,7 +157,7 @@ static int parse_user_event(struct discover_context *ctx, struct event *event) d_opt->boot_image = user_event_resource(d_opt, event, false); if (!d_opt->boot_image) { - pb_log("%s: no boot image found for %s!\n", __func__, + pb_log_fn("no boot image found for %s!\n", opt->name); goto fail_opt; } @@ -288,7 +288,7 @@ struct pb_url *user_event_parse_conf_url(struct discover_context *ctx, host = parse_host_addr(event); if (!host) { - pb_log("%s: host address not found\n", __func__); + pb_log_fn("host address not found\n"); /* No full URLs and no host address? Check for DHCPv6 options */ if (bootfile_url && is_url(bootfile_url)) { @@ -362,7 +362,7 @@ char **user_event_parse_conf_filenames( } if (!mac_addr && !ip_hex) { - pb_log("%s: neither mac nor ip parameter found\n", __func__); + pb_log_fn("neither mac nor ip parameter found\n"); return NULL; } @@ -672,12 +672,12 @@ static int user_event_process(void *arg) len = recvfrom(uev->socket, buf, PBOOT_USER_EVENT_SIZE, 0, NULL, NULL); if (len < 0) { - pb_log("%s: socket read failed: %s", __func__, strerror(errno)); + pb_log_fn("socket read failed: %s\n", strerror(errno)); return 0; } if (len == 0) { - pb_log("%s: empty", __func__); + pb_log_fn("empty\n"); return 0; } |