]> git.ozlabs.org Git - petitboot/blobdiff - discover/pxe-parser.c
discover: add handler reference to struct discover_context
[petitboot] / discover / pxe-parser.c
index 43520364982e865b302dc32a5920d394f88ccb76..cd5f1495343117cef6e6f207398384379ca5a1e5 100644 (file)
@@ -11,6 +11,7 @@
 #include <file/file.h>
 #include <i18n/i18n.h>
 
+#include "device-handler.h"
 #include "parser.h"
 #include "parser-conf.h"
 #include "parser-utils.h"
@@ -108,8 +109,9 @@ static void pxe_process_sysappend(struct discover_context *ctx,
                return;
 
        if (val & 0x2) {
-               uint8_t *mac = find_mac_by_name(ctx, ctx->network,
-                                       event->device);
+               uint8_t *mac = find_mac_by_name(ctx,
+                               device_handler_get_network(ctx->handler),
+                               event->device);
                str = pxe_sysappend_mac(ctx, mac);
                if (str) {
                        pxe_append_string(opt, str);
@@ -241,7 +243,6 @@ static void pxe_conf_parse_cb(struct load_url_result *result, void *data)
 {
        struct conf_context *conf = data;
        struct device_handler *handler;
-       struct boot_status status = {0};
        struct pxe_parser_info *info;
        char *buf = NULL;
        int len, rc = 0;
@@ -279,14 +280,13 @@ static void pxe_conf_parse_cb(struct load_url_result *result, void *data)
        handler = talloc_parent(conf);
        device_handler_discover_context_commit(handler, conf->dc);
 
-       status.type = BOOT_STATUS_INFO;
        /*
         * TRANSLATORS: the format specifier in this string in an IP address,
         * eg. 192.168.1.1
         */
-       status.message = talloc_asprintf(conf, _("pxe: parsed config for %s"),
-                                       conf->dc->conf_url->host);
-       device_handler_boot_status(handler, &status);
+       device_handler_status_dev_info(handler, conf->dc->device,
+                       _("Parsed PXE config from %s"),
+                       conf->dc->conf_url->host);
 
        talloc_free(buf);
 out_clean: