[PATCH] discover/device-handler: Process queue after device added

Samuel Mendoza-Jonas sam at mendozajonas.com
Tue Jan 24 15:41:58 AEDT 2017


In device_handler_discover() we process the unresolved boot options
queue first. However the discover_device in question has not yet been
added to handler->devices so when a parser tries to search for a
matching device it will fail.
The discover_device will be added to the handler if it has not already
in device_handler_discover_context_commit() so move the call to
process_boot_option_queue() after it.

Signed-off-by: Samuel Mendoza-Jonas <sam at mendozajonas.com>
---
 discover/device-handler.c | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)

diff --git a/discover/device-handler.c b/discover/device-handler.c
index 48bfa0e..a3891c4 100644
--- a/discover/device-handler.c
+++ b/discover/device-handler.c
@@ -1039,8 +1039,6 @@ int device_handler_discover(struct device_handler *handler,
 		_("Processing new %s device"),
 		device_type_display_name(dev->device->type));
 
-	process_boot_option_queue(handler);
-
 	/* create our context */
 	ctx = device_handler_discover_context_create(handler, dev);
 
@@ -1058,6 +1056,7 @@ int device_handler_discover(struct device_handler *handler,
 	/* add discovered stuff to the handler */
 	device_handler_discover_context_commit(handler, ctx);
 
+	process_boot_option_queue(handler);
 out:
 	talloc_unlink(handler, ctx);
 
-- 
2.11.0



More information about the Petitboot mailing list