From patchwork Mon Sep 18 10:32:03 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Bhupinder Thakur X-Patchwork-Id: 9956357 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 C805960208 for ; Mon, 18 Sep 2017 10:35:14 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id B7B6B28B21 for ; Mon, 18 Sep 2017 10:35:14 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id AC97C28C17; Mon, 18 Sep 2017 10:35:14 +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 3429528B21 for ; Mon, 18 Sep 2017 10:35:14 +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 1dttMh-0002bp-E3; Mon, 18 Sep 2017 10:33:23 +0000 Received: from mail6.bemta6.messagelabs.com ([193.109.254.103]) by lists.xenproject.org with esmtp (Exim 4.84_2) (envelope-from ) id 1dttMf-0002Y9-65 for xen-devel@lists.xenproject.org; Mon, 18 Sep 2017 10:33:21 +0000 Received: from [193.109.254.147] by server-10.bemta-6.messagelabs.com id 14/BD-03642-0F0AFB95; Mon, 18 Sep 2017 10:33:20 +0000 X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFtrBIsWRWlGSWpSXmKPExsXiVRtspPtmwf5 Ig3kzzC2+b5nM5MDocfjDFZYAxijWzLyk/IoE1oy/WzqZCyZzV6xasIWpgfEoZxcjF4eQwFRG iXWzmhm7GDk5WATmMUu821ILkpAQ6GeVmPjiIRNIQkIgTeLsl7ssMPbBa52sEHalxNTeJnYQW 0hAS+LoqdmsEFN3MElMu/sQaCoHB5uAicSsDgmQGhEBJYl7qyYzgdQwC8xnlGia1MsGkhAWiJ G4Mf8aK8QVqhIXPp8DG8or4CMx8eomRohlchI3z3Uyg9icQPHz6x+wQiz2lpj36wrjBEbBBYw Mqxg1ilOLylKLdI0M9JKKMtMzSnITM3N0DQ3M9HJTi4sT01NzEpOK9ZLzczcxAkOOAQh2MP5a FnCIUZKDSUmUVzRyf6QQX1J+SmVGYnFGfFFpTmrxIUYZDg4lCd7V84FygkWp6akVaZk5wOCHS Utw8CiJ8K4DSfMWFyTmFmemQ6ROMVpyHNt0+Q8Tx749t4Bkx827f5iEWPLy81KlxHnfgTQIgD RklObBjYNF6CVGWSlhXkagA4V4ClKLcjNLUOVfMYpzMCoJ8z4CmcKTmVcCt/UV0EFMQAe17Ng DclBJIkJKqoHx2I67Zao1y8z/qdyIv2+XFaC5zbj1/Qz+ky7rbm5T2OPRljx36uEg7VWBi3iY NWqn8L3QYDnTfdOpUKTaQ+WpwtKJWxYlrF/++63LtTmb7gZ9nmu5V89jUdfOHVVntnikuO35c cLpRFHtO/45bKXNoomL+C+1LjLb9++h0yLLvJzfRndtff+IKLEUZyQaajEXFScCAI+1RsbLAg AA X-Env-Sender: bhupinder.thakur@linaro.org X-Msg-Ref: server-9.tower-27.messagelabs.com!1505730795!117343795!1 X-Originating-IP: [74.125.83.50] 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 18878 invoked from network); 18 Sep 2017 10:33:16 -0000 Received: from mail-pg0-f50.google.com (HELO mail-pg0-f50.google.com) (74.125.83.50) by server-9.tower-27.messagelabs.com with AES128-GCM-SHA256 encrypted SMTP; 18 Sep 2017 10:33:16 -0000 Received: by mail-pg0-f50.google.com with SMTP id v66so32322pgb.5 for ; Mon, 18 Sep 2017 03:33:16 -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=fWttH9SqlTBV+dTiGvvx9yMdDFQFlEOY9ta7zwOQDjSy2RtP2FIcrgIBnAP4WdB4df XSC/N3/tRD8Y55iXzIMKPfv865EgeRegbs/l8c/Tb/HGahoCbMofo2k7MCiz/vm9E6M8 MLUzv6oilIKBYlnuT9qbQ/POblIhT0TU3JuYY= 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=tdveItxaH1bhUzy6haYKOKcgz6c9kHkSchLpsICFcoN0RabyzGCZknCVApeMwOg2zz szONZ+RZdXQHIGHsLaZ7g8FRQGkdB06ljf8YFjqFi4oA94mZ1viZntf9JIq+NUjQDRtA Yb//tJNLosxf0XuYFI8c2pojS8OFnie8mdWXl7nh4PQcVhMS71bZcxtLAZDvwujqJFjz 4tIid/KmK35mfKrYltg3C+JQ+h5q4He1lw+TyqyMfyiuMqkCgIrtNhu395Ao289Y2c4K HZsHAEATVgk8/4QR/baySy+u9O6hehBIw3DyTfpQpijROoB74aFMjDHdkgbbP4/HFb/f Pffg== X-Gm-Message-State: AHPjjUiOJU25v9gJlRFq6cs49DXwoTGripNkKZG+S8/2lN6ZwWIVQmZP hH6NVkJ8/0Z9pDvavXScsg== X-Google-Smtp-Source: ADKCNb7gNHzq4HxpbcSu+uUPICpL5e31CGu/g7ub/WF5SeAADq+I/Hkqk8gsgXA0Kp9EcAMBJal0Gg== X-Received: by 10.98.14.213 with SMTP id 82mr33015085pfo.274.1505730795302; Mon, 18 Sep 2017 03:33:15 -0700 (PDT) Received: from blr-ubuntu-linaro.qualcomm.com (blr-bdr-fw-01_globalnat_allzones-outside.qualcomm.com. [103.229.18.19]) by smtp.gmail.com with ESMTPSA id b7sm12937845pge.79.2017.09.18.03.33.12 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Mon, 18 Sep 2017 03:33:14 -0700 (PDT) From: Bhupinder Thakur To: xen-devel@lists.xenproject.org Date: Mon, 18 Sep 2017 16:02:03 +0530 Message-Id: <1505730731-10947-20-git-send-email-bhupinder.thakur@linaro.org> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1505730731-10947-1-git-send-email-bhupinder.thakur@linaro.org> References: <1505730731-10947-1-git-send-email-bhupinder.thakur@linaro.org> Cc: Wei Liu , Julien Grall , Stefano Stabellini , Ian Jackson Subject: [Xen-devel] [PATCH 19/27 v9] 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); } }