From patchwork Mon Aug 7 08:53:11 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Bhupinder Thakur X-Patchwork-Id: 109528 Delivered-To: patch@linaro.org Received: by 10.182.109.195 with SMTP id hu3csp2481945obb; Mon, 7 Aug 2017 01:55:49 -0700 (PDT) X-Received: by 10.36.65.74 with SMTP id x71mr187789ita.102.1502096149529; Mon, 07 Aug 2017 01:55:49 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1502096149; cv=none; d=google.com; s=arc-20160816; b=xb0jXL6AW9JE+3++t6u3YpGFPbk/q7fkDXD/togUTfeLRN7w7RcGuUNDPYs63f13xt y+rNEwoARHJ2f1vz6eRKYWanq+oOmHjbX06N0/N9MwfV+DxC1hQMjjjMpc9AhB7uaIxI Qz04p07nJJQ2e6fbFJ9rRDRXXKygWpSmQVa9/COpsge21UAv23+pRSfEXbQPr6yeTYjs Y9mJkrSal5nbUIGkLAtRLsWjQD0QpGSmJMumfOpHrGK9nZV5Cjlv1aqjrKB6niaJ/gjy +Dks2egCWjltyCjL3ti3+M9FMBEBvHlCk5FK7zwjY30MLfTn7c9UVjvUDKFQUKMOmww0 yP6w== 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=0WTlf5TnOy6YP/0aRdpmJMniNmgkZDVENM8RygHZIr0=; b=ueJBcHo43u0gkjBbFByip0PzVhVuBFbuQkyYQeLsUMTpeAiZ4VHe+Na90rmCAI2ixE Twi4KX4L6a7xPdGaFXUAjehS64DQGJKHPnlkIHAP+EJ2SfOcOzpxG5aspQMlomAiNZ4T 1l4HL0l1LREMfiAKBrLaXSyQmvv7tEiUM96TF7/iZVDXYFo3B0N5Rn38CZ0dm+2jmWph T8Mye44D9ZMZQY6NySSDKGNd5vqrsSgB6koxpsb8A/HkfaagsV+Ax+jwHPyDpPVrYSwt X5Vv2gwFPxGgRUTYCbWd3AgkjzVfgFRycfpswWLGjOuGbUb8C8m4la9upCfMgP66JtBd 36MQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=neutral (body hash did not verify) header.i=@linaro.org header.s=google header.b=kYC2Ju6U; 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 i200si7837645ita.137.2017.08.07.01.55.49 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 07 Aug 2017 01:55:49 -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.s=google header.b=kYC2Ju6U; 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 1dedny-00059y-1J; Mon, 07 Aug 2017 08:54:30 +0000 Received: from mail6.bemta3.messagelabs.com ([195.245.230.39]) by lists.xenproject.org with esmtp (Exim 4.84_2) (envelope-from ) id 1dednw-00056c-5T for xen-devel@lists.xenproject.org; Mon, 07 Aug 2017 08:54:28 +0000 Received: from [85.158.137.68] by server-17.bemta-3.messagelabs.com id BD/29-01859-3CA28895; Mon, 07 Aug 2017 08:54:27 +0000 X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFlrLIsWRWlGSWpSXmKPExsXiVRtsqHtIqyP SYMNtI4vvWyYzOTB6HP5whSWAMYo1My8pvyKBNWPOx6+MBa+5Kl6se8vawLiQs4uRi0NIYAaj xOf2c+wgDovAPGaJtRMXsIE4EgL9rBKrVy0EynACOWkSv7/eYoawKyWeb3rNBGILCWhJHD01m xViVBuTxJKl24G6OTjYBEwkZnVIgNSICChJ3Fs1mQmkhllgPqNE06ReNpCEsECMxNeuF2ALWA RUJV4t/AUW5xXwkZjStpkRYpmcxM1znWCLOYHi5y+9YYFY7C1x+1gf4wRGgQWMDKsYNYpTi8p Si3SNDPSSijLTM0pyEzNzdA0NjPVyU4uLE9NTcxKTivWS83M3MQKDq56BgXEHY/MJv0OMkhxM SqK88SvaIoX4kvJTKjMSizPii0pzUosPMcpwcChJ8CZodkQKCRalpqdWpGXmAMMcJi3BwaMkw vtCHSjNW1yQmFucmQ6ROsVoybFh9fovTByTDmwHkq8m/P/GJMSSl5+XKiXOmwMyTwCkIaM0D2 4cLBYvMcpKCfMyMjAwCPEUpBblZpagyr9iFOdgVBLmnQQyhSczrwRu6yugg5iADnqT2ApyUEk iQkqqgbFb0faqlHjfDq0LjHcUH3L9jJz9TbRJ+Pfu5VJ3FUUq51QEdG2bcaK4wLWsXn62fEDm lwPd+SnvxOq3+9d1qC74+6xVJ35LhcUf+2zjCW1nghz+vbum8cZVfbVCx76OOukrp1anG71sM mp+77dBv+OdyRez6CDjZ90FGzzOCH8I01TSCezxVGIpzkg01GIuKk4EAKQVmE7AAgAA X-Env-Sender: bhupinder.thakur@linaro.org X-Msg-Ref: server-3.tower-31.messagelabs.com!1502096065!108865371!1 X-Originating-IP: [74.125.83.49] 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 40986 invoked from network); 7 Aug 2017 08:54:26 -0000 Received: from mail-pg0-f49.google.com (HELO mail-pg0-f49.google.com) (74.125.83.49) by server-3.tower-31.messagelabs.com with AES128-GCM-SHA256 encrypted SMTP; 7 Aug 2017 08:54:26 -0000 Received: by mail-pg0-f49.google.com with SMTP id v77so31641023pgb.3 for ; Mon, 07 Aug 2017 01:54:26 -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=mMQ/Oj6uICvCOt7w/LqlESqBMq7zC7kLronMiZ9p9+o=; b=kYC2Ju6UsMTgHUA7VN0HRZSwskvGzHgL0STv6dDHZSjkdafq2WN02CIvZXlxPS0PMy V/qxnvtcr8g2rBXClL85uCXexN5mlxPgSMWtmetUbyAzblTWjgP0WwaVij2TKx2tV6Is 6jag5ndGjCpS7JELkTs83CP50zyxkARRtz8LM= 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=mMQ/Oj6uICvCOt7w/LqlESqBMq7zC7kLronMiZ9p9+o=; b=m3Cd4Hv5h+oZn5pvNEQMB1uNlTRR81IwC6Ks8CFastWMSiZsANhxcHr8TsMl2Kt486 MpqXT8ZFAgSA7sWl7ILaul3NfFdeuBjvuZf2nKm57Py6OpSsAFY4bi49zB4+tRPz0k3F OrBXcgB66snMXvxxJdfWh+bANYdFcINVe1u6NxyQ1hBBJ1zOBz2Iyfv3hUFNxRH3eT/P v/w9kIclte3DslrbahFoQBW+N68a/LiLrdyAsrihVJVQcgslVRKMjDsq53SMUN4G+L3R ZbMJAxR2bDBtdm0vdaJ0o2H5lVfvpi3YlFJQcvYODlAhJQjg8os6ThHA9uQwQwo4730i b7Sg== X-Gm-Message-State: AIVw1102Kvc4u6poNH0uC8uFkkHAUMe5gXoeqRwLAZY0fbpJ+AbwHvf5 77gaHn8cqLRIHwaLZRVP2A== X-Received: by 10.99.43.87 with SMTP id r84mr10786055pgr.314.1502096064870; Mon, 07 Aug 2017 01:54:24 -0700 (PDT) Received: from blr-ubuntu-linaro.wlan.qualcomm.com ([103.5.19.18]) by smtp.gmail.com with ESMTPSA id p77sm12604047pfi.153.2017.08.07.01.54.21 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Mon, 07 Aug 2017 01:54:24 -0700 (PDT) From: Bhupinder Thakur To: xen-devel@lists.xenproject.org Date: Mon, 7 Aug 2017 14:23:11 +0530 Message-Id: <1502095997-31219-20-git-send-email-bhupinder.thakur@linaro.org> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1502095997-31219-1-git-send-email-bhupinder.thakur@linaro.org> References: <1502095997-31219-1-git-send-email-bhupinder.thakur@linaro.org> Cc: Wei Liu , Julien Grall , Stefano Stabellini , Ian Jackson Subject: [Xen-devel] [PATCH 19/25 v7] 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 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); } }