diff mbox series

[Xen-devel,08/10,v2] xen/arm: vpl011: Add a new vuart console type to xenconsole client

Message ID 1493395284-18430-9-git-send-email-bhupinder.thakur@linaro.org
State Superseded
Headers show
Series pl011 emulation support in Xen | expand

Commit Message

Bhupinder Thakur April 28, 2017, 4:01 p.m. UTC
Add a new console type VUART to connect to guest vuart.

Signed-off-by: Bhupinder Thakur <bhupinder.thakur@linaro.org>
---
 tools/console/client/main.c | 8 +++++++-
 1 file changed, 7 insertions(+), 1 deletion(-)

Comments

Stefano Stabellini April 28, 2017, 10:01 p.m. UTC | #1
On Fri, 28 Apr 2017, Bhupinder Thakur wrote:
> Add a new console type VUART to connect to guest vuart.
> 
> Signed-off-by: Bhupinder Thakur <bhupinder.thakur@linaro.org>
> ---
>  tools/console/client/main.c | 8 +++++++-
>  1 file changed, 7 insertions(+), 1 deletion(-)
> 
> diff --git a/tools/console/client/main.c b/tools/console/client/main.c
> index 977779f..ec5c6e1 100644
> --- a/tools/console/client/main.c
> +++ b/tools/console/client/main.c
> @@ -76,7 +76,7 @@ static void usage(const char *program) {
>  	       "\n"
>  	       "  -h, --help       display this help and exit\n"
>  	       "  -n, --num N      use console number N\n"
> -	       "  --type TYPE      console type. must be 'pv' or 'serial'\n"
> +	       "  --type TYPE      console type. must be 'pv', 'serial' or 'vuart'\n"
>  	       "  --start-notify-fd N file descriptor used to notify parent\n"
>  	       , program);
>  }
> @@ -264,6 +264,7 @@ typedef enum {
>         CONSOLE_INVAL,
>         CONSOLE_PV,
>         CONSOLE_SERIAL,
> +       CONSOLE_VUART,
>  } console_type;
>  
>  static struct termios stdin_old_attr;
> @@ -361,6 +362,8 @@ int main(int argc, char **argv)
>  				type = CONSOLE_SERIAL;
>  			else if (!strcmp(optarg, "pv"))
>  				type = CONSOLE_PV;
> +			else if (!strcmp(optarg, "vuart"))
> +				type = CONSOLE_VUART;
>  			else {
>  				fprintf(stderr, "Invalid type argument\n");
>  				fprintf(stderr, "Console types supported are: serial, pv\n");
> @@ -436,6 +439,9 @@ int main(int argc, char **argv)
>  		else
>  			snprintf(path, strlen(dom_path) + strlen("/device/console/%d/tty") + 5, "%s/device/console/%d/tty", dom_path, num);
>  	}
> +	if (type == CONSOLE_VUART) {
> +		snprintf(path, strlen(dom_path) + strlen("/console/vtty") + 1, "%s/console/vtty", dom_path);

It looks like this xenstore path is missing a description in patch #10.


> +	}
>  
>  	/* FIXME consoled currently does not assume domain-0 doesn't have a
>  	   console which is good when we break domain-0 up.  To keep us
> -- 
> 2.7.4
>
diff mbox series

Patch

diff --git a/tools/console/client/main.c b/tools/console/client/main.c
index 977779f..ec5c6e1 100644
--- a/tools/console/client/main.c
+++ b/tools/console/client/main.c
@@ -76,7 +76,7 @@  static void usage(const char *program) {
 	       "\n"
 	       "  -h, --help       display this help and exit\n"
 	       "  -n, --num N      use console number N\n"
-	       "  --type TYPE      console type. must be 'pv' or 'serial'\n"
+	       "  --type TYPE      console type. must be 'pv', 'serial' or 'vuart'\n"
 	       "  --start-notify-fd N file descriptor used to notify parent\n"
 	       , program);
 }
@@ -264,6 +264,7 @@  typedef enum {
        CONSOLE_INVAL,
        CONSOLE_PV,
        CONSOLE_SERIAL,
+       CONSOLE_VUART,
 } console_type;
 
 static struct termios stdin_old_attr;
@@ -361,6 +362,8 @@  int main(int argc, char **argv)
 				type = CONSOLE_SERIAL;
 			else if (!strcmp(optarg, "pv"))
 				type = CONSOLE_PV;
+			else if (!strcmp(optarg, "vuart"))
+				type = CONSOLE_VUART;
 			else {
 				fprintf(stderr, "Invalid type argument\n");
 				fprintf(stderr, "Console types supported are: serial, pv\n");
@@ -436,6 +439,9 @@  int main(int argc, char **argv)
 		else
 			snprintf(path, strlen(dom_path) + strlen("/device/console/%d/tty") + 5, "%s/device/console/%d/tty", dom_path, num);
 	}
+	if (type == CONSOLE_VUART) {
+		snprintf(path, strlen(dom_path) + strlen("/console/vtty") + 1, "%s/console/vtty", dom_path);
+	}
 
 	/* FIXME consoled currently does not assume domain-0 doesn't have a
 	   console which is good when we break domain-0 up.  To keep us