* [PATCH 12/14 v4] xen/arm: vpl011: Add a new vuart console type to xenconsole client
@ 2017-06-06 10:04 Bhupinder Thakur
0 siblings, 0 replies; 3+ messages in thread
From: Bhupinder Thakur @ 2017-06-06 10:04 UTC (permalink / raw)
To: xen-devel; +Cc: Wei Liu, Julien Grall, Stefano Stabellini, Ian Jackson
Add a new console type VUART to connect to guest's emualated vuart
console.
Signed-off-by: Bhupinder Thakur <bhupinder.thakur@linaro.org>
---
Changes since v3:
- The vuart console support is under CONFIG_VUART_CONSOLE option.
- Since there is a change from last review, I have not included
reviewed-by tag from Stefano and acked-by tag from Wei.
tools/console/Makefile | 1 +
tools/console/client/main.c | 25 ++++++++++++++++++++++++-
2 files changed, 25 insertions(+), 1 deletion(-)
diff --git a/tools/console/Makefile b/tools/console/Makefile
index fcee313..49c02d4 100644
--- a/tools/console/Makefile
+++ b/tools/console/Makefile
@@ -34,6 +34,7 @@ xenconsoled: $(patsubst %.c,%.o,$(wildcard daemon/*.c))
$(CC) $(LDFLAGS) $^ -o $@ $(LDLIBS) $(LDLIBS_libxenevtchn) $(LDLIBS_libxengnttab) $(LDLIBS_xenconsoled) $(APPEND_LDFLAGS)
client/main.o: client/_paths.h
+client/main.o: CFLAGS += $(VUART_CFLAGS-y)
xenconsole: $(patsubst %.c,%.o,$(wildcard client/*.c))
$(CC) $(LDFLAGS) $^ -o $@ $(LDLIBS) $(LDLIBS_xenconsole) $(APPEND_LDFLAGS)
diff --git a/tools/console/client/main.c b/tools/console/client/main.c
index 977779f..8d31fe9 100644
--- a/tools/console/client/main.c
+++ b/tools/console/client/main.c
@@ -76,7 +76,11 @@ static void usage(const char *program) {
"\n"
" -h, --help display this help and exit\n"
" -n, --num N use console number N\n"
+#ifdef CONFIG_VUART_CONSOLE
+ " --type TYPE console type. must be 'pv', 'serial' or 'vuart'\n"
+#else
" --type TYPE console type. must be 'pv' or 'serial'\n"
+#endif
" --start-notify-fd N file descriptor used to notify parent\n"
, program);
}
@@ -264,6 +268,9 @@ typedef enum {
CONSOLE_INVAL,
CONSOLE_PV,
CONSOLE_SERIAL,
+#ifdef CONFIG_VUART_CONSOLE
+ CONSOLE_VUART,
+#endif
} console_type;
static struct termios stdin_old_attr;
@@ -343,6 +350,11 @@ int main(int argc, char **argv)
char *end;
console_type type = CONSOLE_INVAL;
bool interactive = 0;
+#ifdef CONFIG_VUART_CONSOLE
+ char *console_names = "serial, pv, vuart";
+#else
+ char *console_names = "serial, pv";
+#endif
if (isatty(STDIN_FILENO) && isatty(STDOUT_FILENO))
interactive = 1;
@@ -361,9 +373,14 @@ int main(int argc, char **argv)
type = CONSOLE_SERIAL;
else if (!strcmp(optarg, "pv"))
type = CONSOLE_PV;
+#ifdef CONFIG_VUART_CONSOLE
+ else if (!strcmp(optarg, "vuart"))
+ type = CONSOLE_VUART;
+#endif
else {
fprintf(stderr, "Invalid type argument\n");
- fprintf(stderr, "Console types supported are: serial, pv\n");
+ fprintf(stderr, "Console types supported are: %s\n",
+ console_names);
exit(EINVAL);
}
break;
@@ -436,6 +453,12 @@ 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);
}
+#ifdef CONFIG_VUART_CONSOLE
+ if (type == CONSOLE_VUART) {
+ snprintf(path, strlen(dom_path) + strlen("/vuart/0/tty") + 1,
+ "%s/vuart/0/tty", dom_path);
+ }
+#endif
/* 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
_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
https://lists.xen.org/xen-devel
^ permalink raw reply related [flat|nested] 3+ messages in thread
* [PATCH 12/14 v4] xen/arm: vpl011: Add a new vuart console type to xenconsole client
2017-06-06 17:25 [PATCH 00/14 v4] PL011 emulation support in Xen Bhupinder Thakur
@ 2017-06-06 17:25 ` Bhupinder Thakur
2017-06-06 23:41 ` Stefano Stabellini
0 siblings, 1 reply; 3+ messages in thread
From: Bhupinder Thakur @ 2017-06-06 17:25 UTC (permalink / raw)
To: xen-devel; +Cc: Wei Liu, Julien Grall, Stefano Stabellini, Ian Jackson
Add a new console type VUART to connect to guest's emualated vuart
console.
Signed-off-by: Bhupinder Thakur <bhupinder.thakur@linaro.org>
---
CC: ij
CC: wl
CC: ss
CC: jg
Changes since v3:
- The vuart console support is under CONFIG_VUART_CONSOLE option.
- Since there is a change from last review, I have not included
reviewed-by tag from Stefano and acked-by tag from Wei.
tools/console/Makefile | 1 +
tools/console/client/main.c | 25 ++++++++++++++++++++++++-
2 files changed, 25 insertions(+), 1 deletion(-)
diff --git a/tools/console/Makefile b/tools/console/Makefile
index fcee313..49c02d4 100644
--- a/tools/console/Makefile
+++ b/tools/console/Makefile
@@ -34,6 +34,7 @@ xenconsoled: $(patsubst %.c,%.o,$(wildcard daemon/*.c))
$(CC) $(LDFLAGS) $^ -o $@ $(LDLIBS) $(LDLIBS_libxenevtchn) $(LDLIBS_libxengnttab) $(LDLIBS_xenconsoled) $(APPEND_LDFLAGS)
client/main.o: client/_paths.h
+client/main.o: CFLAGS += $(VUART_CFLAGS-y)
xenconsole: $(patsubst %.c,%.o,$(wildcard client/*.c))
$(CC) $(LDFLAGS) $^ -o $@ $(LDLIBS) $(LDLIBS_xenconsole) $(APPEND_LDFLAGS)
diff --git a/tools/console/client/main.c b/tools/console/client/main.c
index 977779f..8d31fe9 100644
--- a/tools/console/client/main.c
+++ b/tools/console/client/main.c
@@ -76,7 +76,11 @@ static void usage(const char *program) {
"\n"
" -h, --help display this help and exit\n"
" -n, --num N use console number N\n"
+#ifdef CONFIG_VUART_CONSOLE
+ " --type TYPE console type. must be 'pv', 'serial' or 'vuart'\n"
+#else
" --type TYPE console type. must be 'pv' or 'serial'\n"
+#endif
" --start-notify-fd N file descriptor used to notify parent\n"
, program);
}
@@ -264,6 +268,9 @@ typedef enum {
CONSOLE_INVAL,
CONSOLE_PV,
CONSOLE_SERIAL,
+#ifdef CONFIG_VUART_CONSOLE
+ CONSOLE_VUART,
+#endif
} console_type;
static struct termios stdin_old_attr;
@@ -343,6 +350,11 @@ int main(int argc, char **argv)
char *end;
console_type type = CONSOLE_INVAL;
bool interactive = 0;
+#ifdef CONFIG_VUART_CONSOLE
+ char *console_names = "serial, pv, vuart";
+#else
+ char *console_names = "serial, pv";
+#endif
if (isatty(STDIN_FILENO) && isatty(STDOUT_FILENO))
interactive = 1;
@@ -361,9 +373,14 @@ int main(int argc, char **argv)
type = CONSOLE_SERIAL;
else if (!strcmp(optarg, "pv"))
type = CONSOLE_PV;
+#ifdef CONFIG_VUART_CONSOLE
+ else if (!strcmp(optarg, "vuart"))
+ type = CONSOLE_VUART;
+#endif
else {
fprintf(stderr, "Invalid type argument\n");
- fprintf(stderr, "Console types supported are: serial, pv\n");
+ fprintf(stderr, "Console types supported are: %s\n",
+ console_names);
exit(EINVAL);
}
break;
@@ -436,6 +453,12 @@ 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);
}
+#ifdef CONFIG_VUART_CONSOLE
+ if (type == CONSOLE_VUART) {
+ snprintf(path, strlen(dom_path) + strlen("/vuart/0/tty") + 1,
+ "%s/vuart/0/tty", dom_path);
+ }
+#endif
/* 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
_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
https://lists.xen.org/xen-devel
^ permalink raw reply related [flat|nested] 3+ messages in thread
* Re: [PATCH 12/14 v4] xen/arm: vpl011: Add a new vuart console type to xenconsole client
2017-06-06 17:25 ` [PATCH 12/14 v4] xen/arm: vpl011: Add a new vuart console type to xenconsole client Bhupinder Thakur
@ 2017-06-06 23:41 ` Stefano Stabellini
0 siblings, 0 replies; 3+ messages in thread
From: Stefano Stabellini @ 2017-06-06 23:41 UTC (permalink / raw)
To: Bhupinder Thakur
Cc: xen-devel, Julien Grall, Stefano Stabellini, Ian Jackson, Wei Liu
On Tue, 6 Jun 2017, Bhupinder Thakur wrote:
> Add a new console type VUART to connect to guest's emualated vuart
> console.
>
> Signed-off-by: Bhupinder Thakur <bhupinder.thakur@linaro.org>
> ---
> CC: ij
> CC: wl
> CC: ss
> CC: jg
>
> Changes since v3:
> - The vuart console support is under CONFIG_VUART_CONSOLE option.
> - Since there is a change from last review, I have not included
> reviewed-by tag from Stefano and acked-by tag from Wei.
>
> tools/console/Makefile | 1 +
> tools/console/client/main.c | 25 ++++++++++++++++++++++++-
> 2 files changed, 25 insertions(+), 1 deletion(-)
>
> diff --git a/tools/console/Makefile b/tools/console/Makefile
> index fcee313..49c02d4 100644
> --- a/tools/console/Makefile
> +++ b/tools/console/Makefile
> @@ -34,6 +34,7 @@ xenconsoled: $(patsubst %.c,%.o,$(wildcard daemon/*.c))
> $(CC) $(LDFLAGS) $^ -o $@ $(LDLIBS) $(LDLIBS_libxenevtchn) $(LDLIBS_libxengnttab) $(LDLIBS_xenconsoled) $(APPEND_LDFLAGS)
>
> client/main.o: client/_paths.h
> +client/main.o: CFLAGS += $(VUART_CFLAGS-y)
> xenconsole: $(patsubst %.c,%.o,$(wildcard client/*.c))
> $(CC) $(LDFLAGS) $^ -o $@ $(LDLIBS) $(LDLIBS_xenconsole) $(APPEND_LDFLAGS)
>
> diff --git a/tools/console/client/main.c b/tools/console/client/main.c
> index 977779f..8d31fe9 100644
> --- a/tools/console/client/main.c
> +++ b/tools/console/client/main.c
> @@ -76,7 +76,11 @@ static void usage(const char *program) {
> "\n"
> " -h, --help display this help and exit\n"
> " -n, --num N use console number N\n"
> +#ifdef CONFIG_VUART_CONSOLE
> + " --type TYPE console type. must be 'pv', 'serial' or 'vuart'\n"
> +#else
> " --type TYPE console type. must be 'pv' or 'serial'\n"
> +#endif
> " --start-notify-fd N file descriptor used to notify parent\n"
> , program);
> }
> @@ -264,6 +268,9 @@ typedef enum {
> CONSOLE_INVAL,
> CONSOLE_PV,
> CONSOLE_SERIAL,
> +#ifdef CONFIG_VUART_CONSOLE
> + CONSOLE_VUART,
> +#endif
> } console_type;
>
> static struct termios stdin_old_attr;
> @@ -343,6 +350,11 @@ int main(int argc, char **argv)
> char *end;
> console_type type = CONSOLE_INVAL;
> bool interactive = 0;
> +#ifdef CONFIG_VUART_CONSOLE
> + char *console_names = "serial, pv, vuart";
> +#else
> + char *console_names = "serial, pv";
> +#endif
>
> if (isatty(STDIN_FILENO) && isatty(STDOUT_FILENO))
> interactive = 1;
> @@ -361,9 +373,14 @@ int main(int argc, char **argv)
> type = CONSOLE_SERIAL;
> else if (!strcmp(optarg, "pv"))
> type = CONSOLE_PV;
> +#ifdef CONFIG_VUART_CONSOLE
> + else if (!strcmp(optarg, "vuart"))
> + type = CONSOLE_VUART;
> +#endif
> else {
> fprintf(stderr, "Invalid type argument\n");
> - fprintf(stderr, "Console types supported are: serial, pv\n");
> + fprintf(stderr, "Console types supported are: %s\n",
> + console_names);
alignment issue
> exit(EINVAL);
> }
> break;
> @@ -436,6 +453,12 @@ 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);
> }
> +#ifdef CONFIG_VUART_CONSOLE
> + if (type == CONSOLE_VUART) {
> + snprintf(path, strlen(dom_path) + strlen("/vuart/0/tty") + 1,
> + "%s/vuart/0/tty", dom_path);
> + }
> +#endif
I don't think it is worth protecting all this code with
CONFIG_VUART_CONSOLE. It's so small I would compile it always.
_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
https://lists.xen.org/xen-devel
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2017-06-06 23:41 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2017-06-06 10:04 [PATCH 12/14 v4] xen/arm: vpl011: Add a new vuart console type to xenconsole client Bhupinder Thakur
-- strict thread matches above, loose matches on Subject: below --
2017-06-06 17:25 [PATCH 00/14 v4] PL011 emulation support in Xen Bhupinder Thakur
2017-06-06 17:25 ` [PATCH 12/14 v4] xen/arm: vpl011: Add a new vuart console type to xenconsole client Bhupinder Thakur
2017-06-06 23:41 ` Stefano Stabellini
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).