Patchwork qemu-char.c: fix waiting for telnet connection message

login
register
mail settings
Submitter Igor Mitsyanko
Date March 10, 2013, 1:58 p.m.
Message ID <1362923885-2656-1-git-send-email-i.mitsyanko@gmail.com>
Download mbox | patch
Permalink /patch/226441/
State New
Headers show

Comments

Igor Mitsyanko - March 10, 2013, 1:58 p.m.
Current colon position in "waiting for telnet connection" message template
produces messages like:
QEMU waiting for connection on: telnet::127.0.0.16666,server

After moving a colon to the right, we will get a correct messages like:
QEMU waiting for connection on: telnet:127.0.0.1:6666,server

Signed-off-by: Igor Mitsyanko <i.mitsyanko@gmail.com>
---
 qemu-char.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)
Markus Armbruster - March 11, 2013, 9:28 a.m.
Igor Mitsyanko <i.mitsyanko@gmail.com> writes:

> Current colon position in "waiting for telnet connection" message template
> produces messages like:
> QEMU waiting for connection on: telnet::127.0.0.16666,server
>
> After moving a colon to the right, we will get a correct messages like:
> QEMU waiting for connection on: telnet:127.0.0.1:6666,server
>
> Signed-off-by: Igor Mitsyanko <i.mitsyanko@gmail.com>
> ---
>  qemu-char.c |    2 +-
>  1 files changed, 1 insertions(+), 1 deletions(-)
>
> diff --git a/qemu-char.c b/qemu-char.c
> index 36295b1..789ee35 100644
> --- a/qemu-char.c
> +++ b/qemu-char.c
> @@ -2476,7 +2476,7 @@ static CharDriverState *qemu_chr_open_socket_fd(int fd, bool do_nodelay,
>          s->do_nodelay = do_nodelay;
>          getnameinfo((struct sockaddr *) &ss, ss_len, host, sizeof(host),
>                      serv, sizeof(serv), NI_NUMERICHOST | NI_NUMERICSERV);
> -        snprintf(chr->filename, 256, "%s:%s:%s%s%s%s",
> +        snprintf(chr->filename, 256, "%s:%s%s%s:%s%s",
>                   is_telnet ? "telnet" : "tcp",
>                   left, host, right, serv,
>                   is_listen ? ",server" : "");

Broken in commit f6bd5d6e.  Nice to have that information in the commit
message, but not worth a respin.

Reviewed-by: Markus Armbruster <armbru@redhat.com>

Patch

diff --git a/qemu-char.c b/qemu-char.c
index 36295b1..789ee35 100644
--- a/qemu-char.c
+++ b/qemu-char.c
@@ -2476,7 +2476,7 @@  static CharDriverState *qemu_chr_open_socket_fd(int fd, bool do_nodelay,
         s->do_nodelay = do_nodelay;
         getnameinfo((struct sockaddr *) &ss, ss_len, host, sizeof(host),
                     serv, sizeof(serv), NI_NUMERICHOST | NI_NUMERICSERV);
-        snprintf(chr->filename, 256, "%s:%s:%s%s%s%s",
+        snprintf(chr->filename, 256, "%s:%s%s%s:%s%s",
                  is_telnet ? "telnet" : "tcp",
                  left, host, right, serv,
                  is_listen ? ",server" : "");