From patchwork Mon Dec 19 04:18:57 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: 706920 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 3thnlS3zT3z9s65 for ; Mon, 19 Dec 2016 15:20:36 +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="iQTN2LoX"; 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 3thnlS2dwzzDwHV for ; Mon, 19 Dec 2016 15:20:36 +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="iQTN2LoX"; 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 3thnkX2VRfzDwBH for ; Mon, 19 Dec 2016 15:19:48 +1100 (AEDT) Authentication-Results: lists.ozlabs.org; dkim=pass (1024-bit key; unprotected) header.d=mendozajonas.com header.i=@mendozajonas.com header.b="iQTN2LoX"; 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 BA447143FAE; Mon, 19 Dec 2016 12:19:44 +0800 (SGT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=mendozajonas.com; s=mail; t=1482121185; bh=W7u2ECcw2quCVu+uuc12zHdHUB3Cy8Vgi0bQxgimuaU=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=iQTN2LoXZ20pdZ+2TMlO8XifDvciH1wFqNZaEqZhJKLxP3z6IsF5b7lB2AOipuDRI 6U5lExP8V6AyTvLyokPtKo64Z9uRRkz0cwfBS+OrymEOd7FSqUYelylo2eyJerLjJw ME06c/dxYBqoxmSN3ghW0kKluDUw1WAbtMEDGzFY= From: Samuel Mendoza-Jonas To: petitboot@lists.ozlabs.org Subject: [PATCH 11/29] discover: Add reference to url in load_url_result Date: Mon, 19 Dec 2016 15:18:57 +1100 Message-Id: <20161219041915.30497-12-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 We may want to access the loaded URL in a async handler. Signed-off-by: Jeremy Kerr Signed-off-by: Samuel Mendoza-Jonas --- discover/paths.c | 1 + discover/paths.h | 1 + test/parser/utils.c | 1 + 3 files changed, 3 insertions(+) diff --git a/discover/paths.c b/discover/paths.c index 7fcff9e..8d85619 100644 --- a/discover/paths.c +++ b/discover/paths.c @@ -383,6 +383,7 @@ struct load_url_result *load_url_async(void *ctx, struct pb_url *url, task->async = async_cb != NULL; task->result = talloc_zero(ctx, struct load_url_result); task->result->task = task; + task->result->url = url; task->process = process_create(task); if (task->async) { task->async_cb = async_cb; diff --git a/discover/paths.h b/discover/paths.h index ed0e153..191b8dc 100644 --- a/discover/paths.h +++ b/discover/paths.h @@ -30,6 +30,7 @@ struct load_url_result { LOAD_CANCELLED, } status; + struct pb_url *url; const char *local; bool cleanup_local; struct load_task *task; diff --git a/test/parser/utils.c b/test/parser/utils.c index 6bc7cc5..9d40d2b 100644 --- a/test/parser/utils.c +++ b/test/parser/utils.c @@ -353,6 +353,7 @@ struct load_url_result *load_url_async(void *ctx, struct pb_url *url, return NULL; result->local = talloc_strdup(result, tmp); + result->url = url; if (rc < 0) result->status = LOAD_ERROR; else