[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Xen-changelog] [xen master] xen/arm: vpl011: Add a new handle_console_tty function in xenconsole



commit b71e11dc7ceaac6df4742ab9e7ff6a3e2e92158c
Author:     Bhupinder Thakur <bhupinder.thakur@xxxxxxxxxx>
AuthorDate: Wed Sep 27 11:43:26 2017 +0530
Commit:     Stefano Stabellini <sstabellini@xxxxxxxxxx>
CommitDate: Tue Oct 3 15:23:37 2017 -0700

    xen/arm: vpl011: Add a new handle_console_tty function in xenconsole
    
    This patch introduces a new handle_console_tty function. This function
    performs read/write from/to console tty.
    
    Signed-off-by: Bhupinder Thakur <bhupinder.thakur@xxxxxxxxxx>
    Reviewed-by: Stefano Stabellini <sstabellini@xxxxxxxxxx>
    Acked-by: Wei Liu <wei.liu2@xxxxxxxxxx>
---
 tools/console/daemon/io.c | 35 +++++++++++++++++++----------------
 1 file changed, 19 insertions(+), 16 deletions(-)

diff --git a/tools/console/daemon/io.c b/tools/console/daemon/io.c
index c361b42..5c6da31 100644
--- a/tools/console/daemon/io.c
+++ b/tools/console/daemon/io.c
@@ -1130,6 +1130,24 @@ static void maybe_add_console_tty_fd(struct console *con)
        }
 }
 
+static void handle_console_tty(struct console *con)
+{
+       if (con->master_fd != -1 && con->master_pollfd_idx != -1) {
+               if (fds[con->master_pollfd_idx].revents &
+                   ~(POLLIN|POLLOUT|POLLPRI))
+                       console_handle_broken_tty(con, 
domain_is_valid(con->d->domid));
+               else {
+                       if (fds[con->master_pollfd_idx].revents &
+                           POLLIN)
+                               handle_tty_read(con);
+                       if (fds[con->master_pollfd_idx].revents &
+                           POLLOUT)
+                               handle_tty_write(con);
+               }
+       }
+       con->master_pollfd_idx = -1;
+}
+
 void handle_io(void)
 {
        int ret;
@@ -1260,22 +1278,7 @@ void handle_io(void)
 
                        handle_console_ring(con);
 
-                       if (con->master_fd != -1 && con->master_pollfd_idx != 
-1) {
-                               if (fds[con->master_pollfd_idx].revents &
-                                   ~(POLLIN|POLLOUT|POLLPRI))
-                                       console_handle_broken_tty(con,
-                                                  domain_is_valid(d->domid));
-                               else {
-                                       if (fds[con->master_pollfd_idx].revents 
&
-                                           POLLIN)
-                                               handle_tty_read(con);
-                                       if (fds[con->master_pollfd_idx].revents 
&
-                                           POLLOUT)
-                                               handle_tty_write(con);
-                               }
-                       }
-
-                       con->master_pollfd_idx = -1;
+                       handle_console_tty(con);
 
                        if (d->last_seen != enum_pass)
                                shutdown_domain(d);
--
generated by git-patchbot for /home/xen/git/xen.git#master

_______________________________________________
Xen-changelog mailing list
Xen-changelog@xxxxxxxxxxxxx
https://lists.xenproject.org/xen-changelog

 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.