[Xen-devel,20/27,v8] xen/arm: vpl011: Add a new console_close_evtchn function in xenconsole

Message ID 1503910570-24427-21-git-send-email-bhupinder.thakur@linaro.org
State Superseded
Headers show
Series
  • SBSA UART emulation support in Xen
Related show

Commit Message

Bhupinder Thakur Aug. 28, 2017, 8:56 a.m.
This patch introduces a console_close_evtchn function. This function closes
the console event channel.

Signed-off-by: Bhupinder Thakur <bhupinder.thakur@linaro.org>
Reviewed-by: Stefano Stabellini <sstabellini@kernel.org>
Acked-by: Wei Liu <wei.liu2@citrix.com>
---
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 | 12 +++++++++---
 1 file changed, 9 insertions(+), 3 deletions(-)

Patch

diff --git a/tools/console/daemon/io.c b/tools/console/daemon/io.c
index cfd7273..71465a0 100644
--- a/tools/console/daemon/io.c
+++ b/tools/console/daemon/io.c
@@ -793,6 +793,14 @@  static void cleanup_domain(struct domain *d)
 	remove_domain(d);
 }
 
+static void console_close_evtchn(struct console *con)
+{
+	if (con->xce_handle != NULL)
+		xenevtchn_close(con->xce_handle);
+
+	con->xce_handle = NULL;
+}
+
 static void shutdown_domain(struct domain *d)
 {
 	struct console *con = &d->console;
@@ -800,9 +808,7 @@  static void shutdown_domain(struct domain *d)
 	d->is_dead = true;
 	watch_domain(d, false);
 	console_unmap_interface(con);
-	if (con->xce_handle != NULL)
-		xenevtchn_close(con->xce_handle);
-	con->xce_handle = NULL;
+	console_close_evtchn(con);
 }
 
 static unsigned enum_pass = 0;