From patchwork Mon Dec 19 04:19:02 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sam Mendoza-Jonas X-Patchwork-Id: 706925 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from lists.ozlabs.org (lists.ozlabs.org [IPv6:2401:3900:2:1::3]) (using TLSv1.2 with cipher ADH-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 3thnlt21J6z9s65 for ; Mon, 19 Dec 2016 15:20:58 +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="D6pPoCbQ"; 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 3thnlt0nSGzDwHV for ; Mon, 19 Dec 2016 15:20:58 +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="D6pPoCbQ"; 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 3thnkg42TYzDwHX for ; Mon, 19 Dec 2016 15:19:55 +1100 (AEDT) Authentication-Results: lists.ozlabs.org; dkim=pass (1024-bit key; unprotected) header.d=mendozajonas.com header.i=@mendozajonas.com header.b="D6pPoCbQ"; 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 F0E54143FB6; Mon, 19 Dec 2016 12:19:51 +0800 (SGT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=mendozajonas.com; s=mail; t=1482121193; bh=FxRezP9yXZ8S85Uagi4loyJUE21BWfoKbfyIivEhhmw=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=D6pPoCbQ4YMX9RamHjJmsftegn/nJbOKETBiNJ5Oa6GCPy3S24mhy/uz8ZbeWYX2A pprVPW7mOyuPO0+OEA/pJfo2UD0c0Of0U0LH71ww6XawudVaL3ryJMJh0JeFKPRd3x YWOR0Ye6RNXkiRpLNWs9POZ8XKDubur1a57Q+WK4= From: Samuel Mendoza-Jonas To: petitboot@lists.ozlabs.org Subject: [PATCH 16/29] discover/status: report on PXE download failures Date: Mon, 19 Dec 2016 15:19:02 +1100 Message-Id: <20161219041915.30497-17-sam@mendozajonas.com> X-Mailer: git-send-email 2.10.2 In-Reply-To: <20161219041915.30497-1-sam@mendozajonas.com> References: <20161219041915.30497-1-sam@mendozajonas.com> 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" From: Jeremy Kerr Add dev_err messages on both autoconfiguration and specified-configuration download failures. Signed-off-by: Jeremy Kerr Signed-off-by: Samuel Mendoza-Jonas --- discover/pxe-parser.c | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) diff --git a/discover/pxe-parser.c b/discover/pxe-parser.c index 5aacd39..90af66b 100644 --- a/discover/pxe-parser.c +++ b/discover/pxe-parser.c @@ -250,18 +250,29 @@ static void pxe_conf_parse_cb(struct load_url_result *result, void *data) if (!data) return; + handler = talloc_parent(conf); + if (result && result->status == LOAD_OK) rc = read_file(conf, result->local, &buf, &len); if (!result || result->status != LOAD_OK || rc) { /* This load failed so try the next available filename */ info = conf->parser_info; - if (!info->pxe_conf_files) + if (!info->pxe_conf_files) { + device_handler_status_dev_err(handler, + conf->dc->device, + _("Failed to download %s"), + pb_url_to_string(result->url)); + return; + } info->current++; pxe_load_next_filename(conf); if (info->pxe_conf_files[info->current] == NULL) { /* Nothing left to try */ + device_handler_status_dev_err(handler, + conf->dc->device, + _("PXE autoconfiguration failed")); goto out_clean; } return; @@ -277,7 +288,6 @@ static void pxe_conf_parse_cb(struct load_url_result *result, void *data) /* We may be called well after the original caller of iterate_parsers(), * commit any new boot options ourselves */ - handler = talloc_parent(conf); device_handler_discover_context_commit(handler, conf->dc); /*