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

[Xen-devel] [PATCH 11/11] xen/arm: vpl011: Modify handle_tty_read in xenconsole to redirect user data to vpl011 IN ring buffer



Modification in handle_tty_read to write the user data to the vpl011 IN ring 
buffer.

Finally this needs to be modified to allow user input for both PV and vpl011 
consoles.

Signed-off-by: Bhupinder Thakur <bhupinder.thakur@xxxxxxxxxx>
---
 tools/console/daemon/io.c | 19 +++++++++++++++++--
 1 file changed, 17 insertions(+), 2 deletions(-)

diff --git a/tools/console/daemon/io.c b/tools/console/daemon/io.c
index 4e531e7..a59b4c0 100644
--- a/tools/console/daemon/io.c
+++ b/tools/console/daemon/io.c
@@ -877,6 +877,9 @@ static int ring_free_bytes(struct domain *dom)
        struct xencons_interface *intf = dom->interface;
        XENCONS_RING_IDX cons, prod, space;
 
+       if ( dom->vpl011_initialized )
+               intf = dom->vpl011_interface;
+
        cons = intf->in_cons;
        prod = intf->in_prod;
        xen_mb();
@@ -904,8 +907,9 @@ static void handle_tty_read(struct domain *dom)
        ssize_t len = 0;
        char msg[80];
        int i;
-       struct xencons_interface *intf = dom->interface;
+       struct xencons_interface *intf=dom->interface;
        XENCONS_RING_IDX prod;
+       xenevtchn_port_or_error_t port=dom->local_port;
 
        if (dom->is_dead)
                return;
@@ -918,6 +922,16 @@ static void handle_tty_read(struct domain *dom)
                len = sizeof(msg);
 
        len = read(dom->master_fd, msg, len);
+
+       /* select the interface based on whether vpl011 console is 
+       * enabled or not
+       */
+       if ( dom->vpl011_initialized )
+       {
+               intf = dom->vpl011_interface;
+               port = dom->vpl011_local_port;
+       }
+
        /*
         * Note: on Solaris, len == 0 means the slave closed, and this
         * is no problem, but Linux can't handle this usefully, so we
@@ -927,13 +941,14 @@ static void handle_tty_read(struct domain *dom)
                domain_handle_broken_tty(dom, domain_is_valid(dom->domid));
        } else if (domain_is_valid(dom->domid)) {
                prod = intf->in_prod;
+
                for (i = 0; i < len; i++) {
                        intf->in[MASK_XENCONS_IDX(prod++, intf->in)] =
                                msg[i];
                }
                xen_wmb();
                intf->in_prod = prod;
-               xenevtchn_notify(dom->xce_handle, dom->local_port);
+               xenevtchn_notify(dom->xce_handle, port);
        } else {
                domain_close_tty(dom);
                shutdown_domain(dom);
-- 
2.7.4


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

 


Rackspace

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