From patchwork Tue Jan 24 04:41:58 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sam Mendoza-Jonas X-Patchwork-Id: 718881 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from lists.ozlabs.org (lists.ozlabs.org [103.22.144.68]) (using TLSv1.2 with cipher ADH-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 3v6wWt4MwQz9sxN for ; Tue, 24 Jan 2017 15:42:18 +1100 (AEDT) Authentication-Results: ozlabs.org; dkim=fail reason="signature verification failed" (1024-bit key; unprotected) header.d=mendozajonas.com header.i=@mendozajonas.com header.b="iApQd9K7"; dkim-atps=neutral Received: from lists.ozlabs.org (lists.ozlabs.org [IPv6:2401:3900:2:1::3]) by lists.ozlabs.org (Postfix) with ESMTP id 3v6wWt3QjrzDqRV for ; Tue, 24 Jan 2017 15:42:18 +1100 (AEDT) Authentication-Results: lists.ozlabs.org; dkim=fail reason="signature verification failed" (1024-bit key; unprotected) header.d=mendozajonas.com header.i=@mendozajonas.com header.b="iApQd9K7"; dkim-atps=neutral X-Original-To: petitboot@lists.ozlabs.org Delivered-To: petitboot@lists.ozlabs.org Received: from mendozajonas.com (mendozajonas.com [188.166.185.233]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by lists.ozlabs.org (Postfix) with ESMTPS id 3v6wWn46W1zDqRB for ; Tue, 24 Jan 2017 15:42:13 +1100 (AEDT) Authentication-Results: lists.ozlabs.org; dkim=pass (1024-bit key; unprotected) header.d=mendozajonas.com header.i=@mendozajonas.com header.b="iApQd9K7"; dkim-atps=neutral Received: from skellige.ozlabs.ibm.com (unknown [122.99.82.10]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client did not present a certificate) (Authenticated sender: sam@mendozajonas.com) by mendozajonas.com (Postfix) with ESMTPSA id 2F9DB140059; Tue, 24 Jan 2017 12:42:07 +0800 (SGT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=mendozajonas.com; s=mail; t=1485232927; bh=9IctjB6pKUzMuEytVZQZEVLtLaT0kQJyawGBppr+nXk=; h=From:To:Cc:Subject:Date:From; b=iApQd9K7enV0gqQDk8ak1PlEPTRQ9kgYyji2NNhR3YRQY3qu0xM6YzaZ2P9gOpwrr 08wF1DrqPIOTXFB41ePDTPPqaxhyGhuibB8+BlWbKNFJa5dI8eb5X8slso7f+Sysb8 dB2WdOWz29aXXdpoP2pp3L25VgLwGsYL7q1DhDgQ= From: Samuel Mendoza-Jonas To: petitboot@lists.ozlabs.org Subject: [PATCH] discover/device-handler: Process queue after device added Date: Tue, 24 Jan 2017 15:41:58 +1100 Message-Id: <20170124044158.13902-1-sam@mendozajonas.com> X-Mailer: git-send-email 2.11.0 X-BeenThere: petitboot@lists.ozlabs.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: Petitboot bootloader development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Samuel Mendoza-Jonas MIME-Version: 1.0 Errors-To: petitboot-bounces+incoming=patchwork.ozlabs.org@lists.ozlabs.org Sender: "Petitboot" 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 --- 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);