From patchwork Mon Jul 17 13:06:49 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Bhupinder Thakur X-Patchwork-Id: 107944 Delivered-To: patch@linaro.org Received: by 10.140.101.44 with SMTP id t41csp4495194qge; Mon, 17 Jul 2017 06:09:30 -0700 (PDT) X-Received: by 10.36.5.136 with SMTP id 130mr4999287itl.68.1500296970172; Mon, 17 Jul 2017 06:09:30 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1500296970; cv=none; d=google.com; s=arc-20160816; b=yYIIdK5ApjAgYO1D2R/2YL3eYTo6jNROK3cYMKioexIOcaclbdgo4MFD6utxE7oaUJ O5MfqGg1nDNtwvH7eBcvPlsoChG91M7CO4Qd+S95LZ/ZkMES3I68C3Wr0XWw3RPlKsWo F9wIKbw55f9t/v2Cm9eLoBA4w2+G1ZTWq508xi4eHS+NOycjt3f+4m3F/fg4Od8rx/om S3OuuutbgEfw8XsAcAAnijH+Tm+iPs/1RjBdWK9rqT+w7xO0G58NOol9V0cct7ngig/S 8FsuOY1UiqDVCB8GlEsr2C3DXVdrDk5LH35WE8GHu2JTZHM7XiSRPshPe7bOG2D+rHXH hXPA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:content-transfer-encoding:mime-version :list-subscribe:list-help:list-post:list-unsubscribe:list-id :precedence:subject:cc:references:in-reply-to:message-id:date:to :from:dkim-signature:arc-authentication-results; bh=nKZ7PRUuSwFUP8OuyrkTbvUzmHs0cskj3M0GxYrAILk=; b=odUEjSFBtf+ESfgPd3C25TXVvBu4CIYTVUN756jeSi9fc+v+yaAeFgJ/t7axhf0iC2 +dPPZRs/sU/kBSp2MgUxMeiMqtl0taLA8q7lW8fwo9dFPHel4EQmP8k3dXN3Zv8ck9VS B43POzBZKytFRXZgP2QQ3hveqFXWakgI1aJBwrP9wUqEeXzrSvIK8dNGVAuE/RQN6PIJ rKwPLfjPFAX52YMZVUXqsDnGMC0T/DCTMElwhJbQ7OM8v/EfoYUe2Pt+rhDzITnskdph W0qF0et5pcCCi2EB9GrOgcHsGNDv8wasJHUZpS7efTROov6+yyVdtwzfzX987uxkMEDu skMg== ARC-Authentication-Results: i=1; mx.google.com; dkim=neutral (body hash did not verify) header.i=@linaro.org header.b=kqGskaqu; spf=neutral (google.com: 192.237.175.120 is neither permitted nor denied by best guess record for domain of xen-devel-bounces@lists.xen.org) smtp.mailfrom=xen-devel-bounces@lists.xen.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from lists.xenproject.org (lists.xenproject.org. [192.237.175.120]) by mx.google.com with ESMTPS id z84si16418819ioi.40.2017.07.17.06.09.29 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 17 Jul 2017 06:09:30 -0700 (PDT) Received-SPF: neutral (google.com: 192.237.175.120 is neither permitted nor denied by best guess record for domain of xen-devel-bounces@lists.xen.org) client-ip=192.237.175.120; Authentication-Results: mx.google.com; dkim=neutral (body hash did not verify) header.i=@linaro.org header.b=kqGskaqu; spf=neutral (google.com: 192.237.175.120 is neither permitted nor denied by best guess record for domain of xen-devel-bounces@lists.xen.org) smtp.mailfrom=xen-devel-bounces@lists.xen.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: from localhost ([127.0.0.1] helo=lists.xenproject.org) by lists.xenproject.org with esmtp (Exim 4.84_2) (envelope-from ) id 1dX5kp-0004vm-JB; Mon, 17 Jul 2017 13:08:03 +0000 Received: from mail6.bemta5.messagelabs.com ([195.245.231.135]) by lists.xenproject.org with esmtp (Exim 4.84_2) (envelope-from ) id 1dX5ko-0004tF-25 for xen-devel@lists.xenproject.org; Mon, 17 Jul 2017 13:08:02 +0000 Received: from [85.158.139.211] by server-15.bemta-5.messagelabs.com id B2/3C-01736-1B6BC695; Mon, 17 Jul 2017 13:08:01 +0000 X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFlrLIsWRWlGSWpSXmKPExsXiVRtsqrthW06 kQfMUc4vvWyYzOTB6HP5whSWAMYo1My8pvyKBNePqph3sBVu5Kvbc/MTUwPiOo4uRi0NIYCaj xOF7O5hBHBaBecwSx078ZAJxJAT6WSUu7djK2MXICeSkSRyff5gFwq6UuPvkJxuILSSgJXH01 GxWiFGtTBLvltwHKuLgYBMwkZjVIQFSIyKgJHFv1WSwocwC8xklmib1gjULC8RI7L01lRnEZh FQlVg0bTE7iM0r4COx9vZ9ZohlchI3z3WC2ZxA8TMbVjNBLPaWuHlkItMERoEFjAyrGDWKU4v KUot0jSz1kooy0zNKchMzc3QNDUz1clOLixPTU3MSk4r1kvNzNzECg6uegYFxB+PlLX6HGCU5 mJREeS+yZUcK8SXlp1RmJBZnxBeV5qQWH2KU4eBQkuB135oTKSRYlJqeWpGWmQMMc5i0BAePk ghvNUiat7ggMbc4Mx0idYrRkmPD6vVfmDgmHdgOJF9N+P+NSYglLz8vVUqcVw+kQQCkIaM0D2 4cLBYvMcpKCfMyMjAwCPEUpBblZpagyr9iFOdgVBLmzQSZwpOZVwK39RXQQUxABwn7gh1Ukoi QkmpgtJrqUex7aG+VeLhBfPb8vEWritauMp/xfvsKixyV8ysOz5u0xpTPi1Pt0uwDEqrLryrf OyOhy+A7SzblUY9ZLPOkuMKlwtHerrHp/y/OzU7MPilyQejXbgG+PO+nZnu91vjJ1rXptVXO6 /5vx77pdtHi1T+nhlW78PBanumJ2BD8X8ZHTFxGiaU4I9FQi7moOBEA3cfcf8ACAAA= X-Env-Sender: bhupinder.thakur@linaro.org X-Msg-Ref: server-6.tower-206.messagelabs.com!1500296879!103036836!1 X-Originating-IP: [74.125.83.53] X-SpamReason: No, hits=0.0 required=7.0 tests= X-StarScan-Received: X-StarScan-Version: 9.4.25; banners=-,-,- X-VirusChecked: Checked Received: (qmail 57144 invoked from network); 17 Jul 2017 13:08:00 -0000 Received: from mail-pg0-f53.google.com (HELO mail-pg0-f53.google.com) (74.125.83.53) by server-6.tower-206.messagelabs.com with AES128-GCM-SHA256 encrypted SMTP; 17 Jul 2017 13:08:00 -0000 Received: by mail-pg0-f53.google.com with SMTP id v190so21527359pgv.2 for ; Mon, 17 Jul 2017 06:08:00 -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=wNE42O/N0pQjC9jFpODEWb7HEXgWVKOfEIu88E/ZDT4=; b=kqGskaquabnw0bkeHCKvLAg40uLm4KPAtTi62lR79Y7jlBDy/cWiZYsei+a898aLNT qH6IE2wgW+t5VmvoonVlvDezsV+q5zq4LGnj98YnJPKyCqr7V3pu/F/y3i9PdamDRpkO hcXzBPPK4smdUysUqs+3ipyGgO1uLbj8F7lm4= 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=wNE42O/N0pQjC9jFpODEWb7HEXgWVKOfEIu88E/ZDT4=; b=YSdLYpEIv/dZez5JP/FeJRGFF8ppMFey2dlDCIvFuqi7XFp6IaFi+Oqr+PN5ZL9Rbj ThTXXkuvRkqIT4kKTZqsHm9YIXEmX1NePg/F4e2W/GgToOI6b+ePgbiX7xAJHCSTMWZC mtqZ+d8p7CwO127RthqBDBAPvkipdzuHRtc+WMeJvdXFsdu53OLyvHKVDE+W5dbPDd7Z PiNd127eWhSgKdHzQOiy+EyLJ/ArwEV9l0AtIXfDBA8P2wIPL4dUOmIC4cx1ShkuYtRJ /ZLozlt9cl8VBfXZ2xF7ek0e7DloGqi8krGvOGnnznpShOHrM7t35tTEnKZikVTe8JaM 2e+w== X-Gm-Message-State: AIVw111s/68Izj9wGvlRxKHEeNY0lQlzR++cjfQszSvvMcN/1jdFJEK2 53xfya4W+YghI9QCWZWr4g== X-Received: by 10.84.140.235 with SMTP id 98mr29602559plt.26.1500296879270; Mon, 17 Jul 2017 06:07:59 -0700 (PDT) Received: from blr-ubuntu-linaro.wlan.qualcomm.com ([103.5.19.18]) by smtp.gmail.com with ESMTPSA id z69sm15705665pgz.42.2017.07.17.06.07.56 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Mon, 17 Jul 2017 06:07:58 -0700 (PDT) From: Bhupinder Thakur To: xen-devel@lists.xenproject.org Date: Mon, 17 Jul 2017 18:36:49 +0530 Message-Id: <1500296815-10243-20-git-send-email-bhupinder.thakur@linaro.org> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1500296815-10243-1-git-send-email-bhupinder.thakur@linaro.org> References: <1500296815-10243-1-git-send-email-bhupinder.thakur@linaro.org> Cc: Wei Liu , Julien Grall , Stefano Stabellini , Ian Jackson Subject: [Xen-devel] [PATCH 19/25 v6] 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" 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 --- 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 | 14 +++++++++++--- 1 file changed, 11 insertions(+), 3 deletions(-) diff --git a/tools/console/daemon/io.c b/tools/console/daemon/io.c index d004687..93fc8cc 100644 --- a/tools/console/daemon/io.c +++ b/tools/console/daemon/io.c @@ -1046,6 +1046,16 @@ 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) { @@ -1053,9 +1063,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); } }