diff mbox series

[Xen-devel,19/25,v6] xen/arm: vpl011: Add a new console_open_log function in xenconsole

Message ID 1500296815-10243-20-git-send-email-bhupinder.thakur@linaro.org
State New
Headers show
Series SBSA UART emulation support in Xen | expand

Commit Message

Bhupinder Thakur July 17, 2017, 1:06 p.m. UTC
This patch introduces a console_open_log console_cleanup function. This function
opens the console log file.

Signed-off-by: Bhupinder Thakur <bhupinder.thakur@linaro.org>
---
CC: Ian Jackson <ian.jackson@eu.citrix.com>
CC: Wei Liu <wei.liu2@citrix.com>
CC: Stefano Stabellini <sstabellini@kernel.org>
CC: Julien Grall <julien.grall@arm.com>

Changes since v5:
- Split this change in a separate patch.

 tools/console/daemon/io.c | 14 +++++++++++---
 1 file changed, 11 insertions(+), 3 deletions(-)

Comments

Stefano Stabellini July 18, 2017, 7:55 p.m. UTC | #1
On Mon, 17 Jul 2017, Bhupinder Thakur wrote:
> This patch introduces a console_open_log console_cleanup function. This function
> opens the console log file.
> 
> Signed-off-by: Bhupinder Thakur <bhupinder.thakur@linaro.org>
> ---
> CC: Ian Jackson <ian.jackson@eu.citrix.com>
> CC: Wei Liu <wei.liu2@citrix.com>
> CC: Stefano Stabellini <sstabellini@kernel.org>
> CC: Julien Grall <julien.grall@arm.com>
> 
> 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))
> +	{

Wrong code style for the if statement. Aside from that:

Reviewed-by: Stefano Stabellini <sstabellini@kernel.org>


> +		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);
>  		}
>  	}
>  
> -- 
> 2.7.4
>
diff mbox series

Patch

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);
 		}
 	}