diff mbox series

[Xen-devel,09/10] xen/arm: vpl011: Add new virtual console to xenconsole client

Message ID 1491212673-13476-10-git-send-email-bhupinder.thakur@linaro.org
State New
Headers show
Series pl011 emulation support in Xen | expand

Commit Message

Bhupinder Thakur April 3, 2017, 9:44 a.m. UTC
Add a new console type VCON to connect to the virtual console.

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

Comments

Stefano Stabellini April 19, 2017, 6:55 p.m. UTC | #1
On Mon, 3 Apr 2017, Bhupinder Thakur wrote:
> Add a new console type VCON to connect to the virtual console.

VUART is a better name here too. Please add a doc under docs/misc to
document the new xenstore paths.


> Signed-off-by: Bhupinder Thakur <bhupinder.thakur@linaro.org>
> ---
>  tools/console/client/main.c | 6 ++++++
>  1 file changed, 6 insertions(+)
> 
> diff --git a/tools/console/client/main.c b/tools/console/client/main.c
> index 977779f..03b6fb1 100644
> --- a/tools/console/client/main.c
> +++ b/tools/console/client/main.c
> @@ -264,6 +264,7 @@ typedef enum {
>         CONSOLE_INVAL,
>         CONSOLE_PV,
>         CONSOLE_SERIAL,
> +       CONSOLE_VCON,
>  } 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, "vcon"))
> +				type = CONSOLE_VCON;
>  			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_VCON) {
> +		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
> -- 
> 2.7.4
>
diff mbox series

Patch

diff --git a/tools/console/client/main.c b/tools/console/client/main.c
index 977779f..03b6fb1 100644
--- a/tools/console/client/main.c
+++ b/tools/console/client/main.c
@@ -264,6 +264,7 @@  typedef enum {
        CONSOLE_INVAL,
        CONSOLE_PV,
        CONSOLE_SERIAL,
+       CONSOLE_VCON,
 } 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, "vcon"))
+				type = CONSOLE_VCON;
 			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_VCON) {
+		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