* [Qemu-devel] [PATCH 1/1] monitor: correct socket listen port
@ 2015-10-28 22:15 Sam Bobroff
2015-10-29 6:26 ` Markus Armbruster
0 siblings, 1 reply; 3+ messages in thread
From: Sam Bobroff @ 2015-10-28 22:15 UTC (permalink / raw)
To: qemu-devel
Currently when constructing an inet socket monitor (e.g. via "-monitor
telent:localhost:12345,server,nowait") the port is ignored and a
random one is used instead. It appears this behaviour was accidentally
introduced by commit dafd325d "qemu-char: Convert socket backend to
QAPI".
The cause is that the has_port field is not set in the address, so
later it is not copied by qapi_copy_SocketAddress(). This patch simply
adds the missing "has_port = true".
Signed-off-by: Sam Bobroff <sam.bobroff@au1.ibm.com>
---
qemu-char.c | 1 +
1 file changed, 1 insertion(+)
diff --git a/qemu-char.c b/qemu-char.c
index c4eb4ee..4fb9279 100644
--- a/qemu-char.c
+++ b/qemu-char.c
@@ -3605,6 +3605,7 @@ static void qemu_chr_parse_socket(QemuOpts *opts, ChardevBackend *backend,
addr->kind = SOCKET_ADDRESS_KIND_INET;
addr->inet = g_new0(InetSocketAddress, 1);
addr->inet->host = g_strdup(host);
+ addr->inet->has_port = true;
addr->inet->port = g_strdup(port);
addr->inet->has_to = qemu_opt_get(opts, "to");
addr->inet->to = qemu_opt_get_number(opts, "to", 0);
--
2.1.4
^ permalink raw reply related [flat|nested] 3+ messages in thread
* Re: [Qemu-devel] [PATCH 1/1] monitor: correct socket listen port
2015-10-28 22:15 [Qemu-devel] [PATCH 1/1] monitor: correct socket listen port Sam Bobroff
@ 2015-10-29 6:26 ` Markus Armbruster
2015-10-29 22:07 ` Sam Bobroff
0 siblings, 1 reply; 3+ messages in thread
From: Markus Armbruster @ 2015-10-29 6:26 UTC (permalink / raw)
To: Sam Bobroff; +Cc: qemu-devel
Sam Bobroff <sam.bobroff@au1.ibm.com> writes:
> Currently when constructing an inet socket monitor (e.g. via "-monitor
> telent:localhost:12345,server,nowait") the port is ignored and a
> random one is used instead. It appears this behaviour was accidentally
> introduced by commit dafd325d "qemu-char: Convert socket backend to
> QAPI".
>
> The cause is that the has_port field is not set in the address, so
> later it is not copied by qapi_copy_SocketAddress(). This patch simply
> adds the missing "has_port = true".
>
> Signed-off-by: Sam Bobroff <sam.bobroff@au1.ibm.com>
> ---
>
> qemu-char.c | 1 +
> 1 file changed, 1 insertion(+)
>
> diff --git a/qemu-char.c b/qemu-char.c
> index c4eb4ee..4fb9279 100644
> --- a/qemu-char.c
> +++ b/qemu-char.c
> @@ -3605,6 +3605,7 @@ static void qemu_chr_parse_socket(QemuOpts *opts, ChardevBackend *backend,
> addr->kind = SOCKET_ADDRESS_KIND_INET;
> addr->inet = g_new0(InetSocketAddress, 1);
> addr->inet->host = g_strdup(host);
> + addr->inet->has_port = true;
> addr->inet->port = g_strdup(port);
> addr->inet->has_to = qemu_opt_get(opts, "to");
> addr->inet->to = qemu_opt_get_number(opts, "to", 0);
Please see "[PATCH] qapi-schema: mark InetSocketAddress as mandatory
again"
Message-Id: <1445509543-30679-1-git-send-email-berrange@redhat.com>
http://lists.nongnu.org/archive/html/qemu-devel/2015-10/msg05222.html
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [Qemu-devel] [PATCH 1/1] monitor: correct socket listen port
2015-10-29 6:26 ` Markus Armbruster
@ 2015-10-29 22:07 ` Sam Bobroff
0 siblings, 0 replies; 3+ messages in thread
From: Sam Bobroff @ 2015-10-29 22:07 UTC (permalink / raw)
To: Markus Armbruster; +Cc: qemu-devel
On Thu, Oct 29, 2015 at 07:26:14AM +0100, Markus Armbruster wrote:
> Sam Bobroff <sam.bobroff@au1.ibm.com> writes:
>
> > Currently when constructing an inet socket monitor (e.g. via "-monitor
> > telent:localhost:12345,server,nowait") the port is ignored and a
> > random one is used instead. It appears this behaviour was accidentally
> > introduced by commit dafd325d "qemu-char: Convert socket backend to
> > QAPI".
> >
> > The cause is that the has_port field is not set in the address, so
> > later it is not copied by qapi_copy_SocketAddress(). This patch simply
> > adds the missing "has_port = true".
> >
> > Signed-off-by: Sam Bobroff <sam.bobroff@au1.ibm.com>
> > ---
> >
> > qemu-char.c | 1 +
> > 1 file changed, 1 insertion(+)
> >
> > diff --git a/qemu-char.c b/qemu-char.c
> > index c4eb4ee..4fb9279 100644
> > --- a/qemu-char.c
> > +++ b/qemu-char.c
> > @@ -3605,6 +3605,7 @@ static void qemu_chr_parse_socket(QemuOpts *opts, ChardevBackend *backend,
> > addr->kind = SOCKET_ADDRESS_KIND_INET;
> > addr->inet = g_new0(InetSocketAddress, 1);
> > addr->inet->host = g_strdup(host);
> > + addr->inet->has_port = true;
> > addr->inet->port = g_strdup(port);
> > addr->inet->has_to = qemu_opt_get(opts, "to");
> > addr->inet->to = qemu_opt_get_number(opts, "to", 0);
>
> Please see "[PATCH] qapi-schema: mark InetSocketAddress as mandatory
> again"
> Message-Id: <1445509543-30679-1-git-send-email-berrange@redhat.com>
> http://lists.nongnu.org/archive/html/qemu-devel/2015-10/msg05222.html
Ah thanks, that's obviously the correct fix too.
(Guess I'm one of the ones who got bitten ;-)
Cheers,
Sam.
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2015-10-29 22:09 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2015-10-28 22:15 [Qemu-devel] [PATCH 1/1] monitor: correct socket listen port Sam Bobroff
2015-10-29 6:26 ` Markus Armbruster
2015-10-29 22:07 ` Sam Bobroff
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).