From patchwork Mon Aug 28 08:56:02 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Bhupinder Thakur X-Patchwork-Id: 9924849 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id D934760311 for ; Mon, 28 Aug 2017 08:59:10 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id CA0A628531 for ; Mon, 28 Aug 2017 08:59:10 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id BE8C528675; Mon, 28 Aug 2017 08:59:10 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-4.1 required=2.0 tests=BAYES_00,DKIM_SIGNED, RCVD_IN_DNSWL_MED,T_DKIM_INVALID autolearn=ham version=3.3.1 Received: from lists.xenproject.org (lists.xenproject.org [192.237.175.120]) (using TLSv1.2 with cipher AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id 4BAB728531 for ; Mon, 28 Aug 2017 08:59:10 +0000 (UTC) Received: from localhost ([127.0.0.1] helo=lists.xenproject.org) by lists.xenproject.org with esmtp (Exim 4.84_2) (envelope-from ) id 1dmFrL-0005au-S4; Mon, 28 Aug 2017 08:57:27 +0000 Received: from mail6.bemta5.messagelabs.com ([195.245.231.135]) by lists.xenproject.org with esmtp (Exim 4.84_2) (envelope-from ) id 1dmFrK-0005YK-Ds for xen-devel@lists.xenproject.org; Mon, 28 Aug 2017 08:57:26 +0000 Received: from [85.158.139.211] by server-16.bemta-5.messagelabs.com id D3/67-01712-5FAD3A95; Mon, 28 Aug 2017 08:57:25 +0000 X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFlrLIsWRWlGSWpSXmKPExsVyMfTARt2PtxZ HGjR9VLL4vmUykwOjx+EPV1gCGKNYM/OS8isSWDP+bulkLpjMXbFqwRamBsajnF2MXBxCAjMZ Je5e+cEM4rAIzGOW+PZwGRuIIyHQzypx5PI2IIcTyEmTeND8iR3CrpD4+OE1M4gtJKAlcfTUb FaIUfuZJPbeu8rYxcjBwSZgIjGrQwKkRkRASeLeqslMIDXMAvMZJZom9YINFRaIkXg0+yAjiM 0ioCqxcfIusDivgI9E05b3zBDL5CRunusEszmB4jvW3mWHWOwt0fX6A+sERoEFjAyrGDWKU4v KUot0DU31kooy0zNKchMzc3QNDUz1clOLixPTU3MSk4r1kvNzNzECg4sBCHYwNmz3PMQoycGk JMq7s2JxpBBfUn5KZUZicUZ8UWlOavEhRhkODiUJ3jM3gXKCRanpqRVpmTnAMIdJS3DwKInwf gBJ8xYXJOYWZ6ZDpE4xWnJcubLuCxPHhtXrgeSUA9u/MAmx5OXnpUqJ8z4EaRAAacgozYMbB4 vFS4yyUsK8jEAHCvEUpBblZpagyr9iFOdgVBLmPQgyhSczrwRu6yugg5iADlIUXAhyUEkiQkq qgXE980pzQQuGPxv+HBe4MTfskep0i00ql9Y9OjxjWtD8mf45EoZcuxl6XhYvCAw3iK3jDN/Q F1slv+1tgV3CjC0vGmUfqi37ufr6lym/I86+XmWScoFtctOhitDIAzYVe29V7FCIP+InUxP2X OboMsndSq2VzuJX505hc9t5QVI71++3YxV31DklluKMREMt5qLiRACOdU78wAIAAA== X-Env-Sender: bhupinder.thakur@linaro.org X-Msg-Ref: server-14.tower-206.messagelabs.com!1503910640!70320104!1 X-Originating-IP: [209.85.192.177] X-SpamReason: No, hits=0.0 required=7.0 tests= X-StarScan-Received: X-StarScan-Version: 9.4.45; banners=-,-,- X-VirusChecked: Checked Received: (qmail 62822 invoked from network); 28 Aug 2017 08:57:21 -0000 Received: from mail-pf0-f177.google.com (HELO mail-pf0-f177.google.com) (209.85.192.177) by server-14.tower-206.messagelabs.com with AES128-GCM-SHA256 encrypted SMTP; 28 Aug 2017 08:57:21 -0000 Received: by mail-pf0-f177.google.com with SMTP id c15so14539387pfm.2 for ; Mon, 28 Aug 2017 01:57:21 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=Czel33Q/wCzetrNTUKuMCaNrHbuXAUhTInKJVQs+Ekc=; b=BmlMHd4E8JLz8xc+1zPduxiC+6j4KzXJodX7ne+CEXF7Eh++x7Rt1SyTJGX2ol25UG VONOCS0WaQTiaOd7wRsqD8jMjEfr1biCaIahJC4pHnDL26ReMezyabLS7oPnH27DVoRa K17It6SIh6qN0YWMMiaO7D90qG1u8oy0HN0XM= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=Czel33Q/wCzetrNTUKuMCaNrHbuXAUhTInKJVQs+Ekc=; b=H60vVdFYPg/ppLif8gccU2dMHie8bkGWfPRzW1hpVT0AjWq8IklgwG+O+9ttRSYYzl BTewKcMahk9MxwbHPLHHu6+fgvOpmanUXxv6quRkCni5KDeSqoUXztjlijb2xc26V3gf MIeYVcXpoQ8ktbcXQOVPSW5R0WJnD3sbDPtsQRjiDqY8uE2TixqL7NrapgIrKBb2v6cs H6KMGUIzz3EGT0euccWGs904Y3CS1QLyNJUAbKETEpXt0L9WrYj0459R14vISXTfF04C xW4MxUAyNQs+QmTRyy/MW6v8IdjnAF83BM7uhsKcEyQqWGwHWxaSk0HvU2mBnr65V2d8 JJKg== X-Gm-Message-State: AHYfb5gr6s0c0jeWsQuCToexfJJ7ZegyljctZ9fPPSahpHDrnPDg6fOD JL51NeG7aIQi1Eobnvzisg== X-Received: by 10.98.51.71 with SMTP id z68mr6834378pfz.307.1503910639665; Mon, 28 Aug 2017 01:57:19 -0700 (PDT) Received: from blr-ubuntu-linaro.wlan.qualcomm.com (blr-bdr-fw-01_globalnat_allzones-outside.qualcomm.com. [103.229.18.19]) by smtp.gmail.com with ESMTPSA id d88sm21713569pfl.158.2017.08.28.01.57.16 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Mon, 28 Aug 2017 01:57:19 -0700 (PDT) From: Bhupinder Thakur To: xen-devel@lists.xenproject.org Date: Mon, 28 Aug 2017 14:26:02 +0530 Message-Id: <1503910570-24427-20-git-send-email-bhupinder.thakur@linaro.org> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1503910570-24427-1-git-send-email-bhupinder.thakur@linaro.org> References: <1503910570-24427-1-git-send-email-bhupinder.thakur@linaro.org> Cc: Wei Liu , Julien Grall , Stefano Stabellini , Ian Jackson Subject: [Xen-devel] [PATCH 19/27 v8] xen/arm: vpl011: Add a new console_open_log function in xenconsole X-BeenThere: xen-devel@lists.xen.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: Xen developer discussion List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Errors-To: xen-devel-bounces@lists.xen.org Sender: "Xen-devel" X-Virus-Scanned: ClamAV using ClamSMTP This patch introduces a console_open_log console_cleanup function. This function opens the console log file. Signed-off-by: Bhupinder Thakur Reviewed-by: Stefano Stabellini Acked-by: Wei Liu --- CC: Ian Jackson CC: Wei Liu CC: Stefano Stabellini CC: Julien Grall Changes since v5: - Split this change in a separate patch. tools/console/daemon/io.c | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) diff --git a/tools/console/daemon/io.c b/tools/console/daemon/io.c index ff69e52..cfd7273 100644 --- a/tools/console/daemon/io.c +++ b/tools/console/daemon/io.c @@ -1038,6 +1038,15 @@ static void handle_hv_logs(xenevtchn_handle *xce_handle, bool force) (void)xenevtchn_unmask(xce_handle, port); } +static void console_open_log(struct console *con) +{ + if (console_enabled(con)) { + if (con->log_fd != -1) + close(con->log_fd); + con->log_fd = create_console_log(con); + } +} + static void handle_log_reload(void) { if (log_guest) { @@ -1045,9 +1054,7 @@ static void handle_log_reload(void) for (d = dom_head; d; d = d->next) { struct console *con = &d->console; - if (con->log_fd != -1) - close(con->log_fd); - con->log_fd = create_console_log(con); + console_open_log(con); } }