]> xenbits.xensource.com Git - people/dariof/xen.git/commitdiff
xen/arm: vpl011: Add a new console_cleanup function in xenconsole
authorBhupinder Thakur <bhupinder.thakur@linaro.org>
Wed, 27 Sep 2017 06:13:27 +0000 (11:43 +0530)
committerStefano Stabellini <sstabellini@kernel.org>
Tue, 3 Oct 2017 22:23:37 +0000 (15:23 -0700)
This patch introduces a new console_cleanup function. This function
frees up the console resources.

Signed-off-by: Bhupinder Thakur <bhupinder.thakur@linaro.org>
Reviewed-by: Stefano Stabellini <sstabellini@kernel.org>
Acked-by: Wei Liu <wei.liu2@citrix.com>
tools/console/daemon/io.c

index 5c6da31d844f5ed618defa30db561c6fe527b653..ff69e520577b51db1b7a50408afd348f988383ba 100644 (file)
@@ -768,12 +768,8 @@ static void remove_domain(struct domain *dom)
        }
 }
 
-static void cleanup_domain(struct domain *d)
+static void console_cleanup(struct console *con)
 {
-       struct console *con = &d->console;
-
-       console_close_tty(con);
-
        if (con->log_fd != -1) {
                close(con->log_fd);
                con->log_fd = -1;
@@ -784,6 +780,15 @@ static void cleanup_domain(struct domain *d)
 
        free(con->xspath);
        con->xspath = NULL;
+}
+
+static void cleanup_domain(struct domain *d)
+{
+       struct console *con = &d->console;
+
+       console_close_tty(con);
+
+       console_cleanup(con);
 
        remove_domain(d);
 }