From: Bhupinder Thakur Date: Wed, 27 Sep 2017 06:13:27 +0000 (+0530) Subject: xen/arm: vpl011: Add a new console_cleanup function in xenconsole X-Git-Tag: archive/raspbian/4.11.1-1+rpi1~1^2~66^2~1248 X-Git-Url: https://dgit.raspbian.org/?a=commitdiff_plain;h=1ef1267981fb9714f9488a4432a9f16ce03137ad;p=xen.git xen/arm: vpl011: Add a new console_cleanup function in xenconsole This patch introduces a new console_cleanup function. This function frees up the console resources. Signed-off-by: Bhupinder Thakur Reviewed-by: Stefano Stabellini Acked-by: Wei Liu --- diff --git a/tools/console/daemon/io.c b/tools/console/daemon/io.c index 5c6da31d84..ff69e52057 100644 --- a/tools/console/daemon/io.c +++ b/tools/console/daemon/io.c @@ -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); }