From patchwork Mon Dec 19 04:18:55 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: 706918 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 3thnlJ3B15z9s65 for ; Mon, 19 Dec 2016 15:20:28 +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="oEWAUURi"; 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 3thnlJ20zrzDw5h for ; Mon, 19 Dec 2016 15:20:28 +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="oEWAUURi"; 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 3thnkT4MHjzDwHl for ; Mon, 19 Dec 2016 15:19:45 +1100 (AEDT) Authentication-Results: lists.ozlabs.org; dkim=pass (1024-bit key; unprotected) header.d=mendozajonas.com header.i=@mendozajonas.com header.b="oEWAUURi"; 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 D6625143FB4; Mon, 19 Dec 2016 12:19:41 +0800 (SGT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=mendozajonas.com; s=mail; t=1482121182; bh=+JnzOaNqqF25RscRWXXskqm0vUsedDvA7IocmJZ0fPk=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=oEWAUURir5oGOYFVhOgE6h1AYAQBVBF3sxHW8KMlcPf/vTnhOnFG8nb64bT+/6Qtu dv+aPB9thqOgbXmUccstbkOQX0gJL6vQtt96WkoLUoWJ7Oun7AVzL5ERzL1mr9mkGq udnJ2C1NdQmsdevPKKUokX3HBXgRPWGr0bVO8fp4= From: Samuel Mendoza-Jonas To: petitboot@lists.ozlabs.org Subject: [PATCH 09/29] discover: Use device_handler_status_dev_* for device-specific status Date: Mon, 19 Dec 2016 15:18:55 +1100 Message-Id: <20161219041915.30497-10-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 Signed-off-by: Jeremy Kerr Signed-off-by: Samuel Mendoza-Jonas --- discover/device-handler.c | 39 ++++++++++++--------------------------- discover/pxe-parser.c | 5 +++-- 2 files changed, 15 insertions(+), 29 deletions(-) diff --git a/discover/device-handler.c b/discover/device-handler.c index aa693e4..a9a24ae 100644 --- a/discover/device-handler.c +++ b/discover/device-handler.c @@ -904,15 +904,14 @@ int device_handler_discover(struct device_handler *handler, struct discover_context *ctx; int rc; - /* - * TRANSLATORS: this string will be passed the type and identifier - * of the device. For example, the first parameter could be "Disk", - * (which will be translated accordingly) and the second a Linux device - * identifier like 'sda1' (which will not be translated) - */ - device_handler_status_info(handler, _("Processing %s device %s"), - device_type_display_name(dev->device->type), - dev->device->id); + device_handler_status_dev_info(handler, dev, + /* + * TRANSLATORS: this string will be passed the type of the + * device (eg "disk" or "network"), which will be translated + * accordingly. + */ + _("Processing new %s device"), + device_type_display_name(dev->device->type)); process_boot_option_queue(handler); @@ -934,12 +933,7 @@ int device_handler_discover(struct device_handler *handler, device_handler_discover_context_commit(handler, ctx); out: - /* - * TRANSLATORS: the format specifier in this string is a Linux - * device identifier, like 'sda1' - */ - device_handler_status_info(handler, _("Processing %s complete"), - dev->device->id); + device_handler_status_dev_info(handler, dev, _("Processing complete")); talloc_unlink(handler, ctx); @@ -952,12 +946,8 @@ int device_handler_dhcp(struct device_handler *handler, { struct discover_context *ctx; - /* - * TRANSLATORS: this format specifier will be the name of a network - * device, like 'eth0'. - */ - device_handler_status_info(handler, _("Processing dhcp event on %s"), - dev->device->id); + device_handler_status_dev_info(handler, dev, + _("Processing dhcp event")); /* create our context */ ctx = device_handler_discover_context_create(handler, dev); @@ -968,12 +958,7 @@ int device_handler_dhcp(struct device_handler *handler, device_handler_discover_context_commit(handler, ctx); - /* - * TRANSLATORS: this format specifier will be the name of a network - * device, like 'eth0'. - */ - device_handler_status_info(handler, _("Processing %s complete"), - dev->device->id); + device_handler_status_dev_info(handler, dev, _("Processing complete")); talloc_unlink(handler, ctx); diff --git a/discover/pxe-parser.c b/discover/pxe-parser.c index 5ac6990..8237c4b 100644 --- a/discover/pxe-parser.c +++ b/discover/pxe-parser.c @@ -282,8 +282,9 @@ static void pxe_conf_parse_cb(struct load_url_result *result, void *data) * TRANSLATORS: the format specifier in this string in an IP address, * eg. 192.168.1.1 */ - device_handler_status_info(handler, _("pxe: parsed config for %s"), - conf->dc->conf_url->host); + device_handler_status_dev_info(handler, conf->dc->device, + _("Parsed PXE config from %s"), + conf->dc->conf_url->host); talloc_free(buf); out_clean: