]> git.ozlabs.org Git - petitboot/blobdiff - discover/device-handler.c
discover/paths: Add network jobs to queue
[petitboot] / discover / device-handler.c
index 3cf7edff082d9f6f880ccdd19c18fa698490cbce..730be857f5e564fdfea8938dbfc134d1f3c679be 100644 (file)
@@ -19,6 +19,7 @@
 #include <url/url.h>
 #include <i18n/i18n.h>
 
+#include <sys/sysmacros.h>
 #include <sys/types.h>
 #include <sys/socket.h>
 #include <netdb.h>
@@ -321,7 +322,7 @@ struct device_handler *device_handler_init(struct discover_server *server,
        handler->server = server;
        handler->waitset = waitset;
        handler->dry_run = dry_run;
-       handler->autoboot_enabled = config_get()->autoboot_enabled;
+       handler->autoboot_enabled = config_autoboot_active(config_get());
 
        list_init(&handler->unresolved_boot_options);
 
@@ -360,6 +361,7 @@ void device_handler_reinit(struct device_handler *handler)
 
        /* Cancel any remaining async jobs */
        process_stop_async_all();
+       pending_network_jobs_cancel();
 
        /* free unresolved boot options */
        list_for_each_entry_safe(&handler->unresolved_boot_options,
@@ -1082,6 +1084,8 @@ int device_handler_dhcp(struct device_handler *handler,
                        _("Processing DHCP lease response (ip: %s)"),
                        event_get_param(event, "ip"));
 
+       pending_network_jobs_start();
+
        /* create our context */
        ctx = device_handler_discover_context_create(handler, dev);
        talloc_steal(ctx, event);
@@ -1406,6 +1410,8 @@ static void device_handler_reinit_sources(struct device_handler *handler)
                return;
        }
 
+       system_info_reinit();
+
        udev_reinit(handler->udev);
 
        network_shutdown(handler->network);