All of lore.kernel.org
 help / color / mirror / Atom feed
* [Qemu-devel] [PATCH v2] util: socket: Add missing localaddr and localport option for DGRAM socket
@ 2015-05-15  9:31 Peter Krempa
  2015-05-15 12:24 ` Markus Armbruster
  0 siblings, 1 reply; 3+ messages in thread
From: Peter Krempa @ 2015-05-15  9:31 UTC (permalink / raw)
  To: qemu-devel; +Cc: Peter Krempa, Markus Armbruster

The 'socket_optslist' structure does not contain the 'localaddr' and
'localport' options that are parsed in case you are creating a
'connect' type UDP character device.

I've noticed it happening after commit f43e47dbf6de24db20ec9b588bb6cc762
made qemu abort() after seeing the invalid option.

A minimal reproducer for the case is:
$ qemu-system-x86_64 -chardev udp,id=charrng0,host=127.0.0.1,port=1234,localaddr=,localport=1234
qemu-system-x86_64: -chardev udp,id=charrng0,host=127.0.0.1,port=1234,localaddr=,localport=1234: Invalid parameter 'localaddr'
Aborted (core dumped)

Prior to the commit mentioned above the error would be printed but the
value for localaddr and localport was simply ignored. I did not go
trhough the code to find out when it was broken.

Add the two fields so that the options can again be parsed correctly and
qemu doesn't abort().

Resolves: https://bugzilla.redhat.com/show_bug.cgi?id=1220252

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Eric Blake <eblake@redhat.com>
---

Notes:
    Version 2:
    - improved commit message as suggested by Markus
    
Cc: Markus Armbruster <armbru@redhat.com>

 util/qemu-sockets.c | 6 ++++++
 1 file changed, 6 insertions(+)

diff --git a/util/qemu-sockets.c b/util/qemu-sockets.c
index 87c9bc6..72066be 100644
--- a/util/qemu-sockets.c
+++ b/util/qemu-sockets.c
@@ -45,6 +45,12 @@ QemuOptsList socket_optslist = {
             .name = "port",
             .type = QEMU_OPT_STRING,
         },{
+            .name = "localaddr",
+            .type = QEMU_OPT_STRING,
+        },{
+            .name = "localport",
+            .type = QEMU_OPT_STRING,
+        },{
             .name = "to",
             .type = QEMU_OPT_NUMBER,
         },{
-- 
2.3.5

^ permalink raw reply related	[flat|nested] 3+ messages in thread

* Re: [Qemu-devel] [PATCH v2] util: socket: Add missing localaddr and localport option for DGRAM socket
  2015-05-15  9:31 [Qemu-devel] [PATCH v2] util: socket: Add missing localaddr and localport option for DGRAM socket Peter Krempa
@ 2015-05-15 12:24 ` Markus Armbruster
  2015-05-28 11:25   ` Michael Tokarev
  0 siblings, 1 reply; 3+ messages in thread
From: Markus Armbruster @ 2015-05-15 12:24 UTC (permalink / raw)
  To: Peter Krempa; +Cc: qemu-trivial, qemu-devel

Peter Krempa <pkrempa@redhat.com> writes:

> The 'socket_optslist' structure does not contain the 'localaddr' and
> 'localport' options that are parsed in case you are creating a
> 'connect' type UDP character device.
>
> I've noticed it happening after commit f43e47dbf6de24db20ec9b588bb6cc762
> made qemu abort() after seeing the invalid option.
>
> A minimal reproducer for the case is:
> $ qemu-system-x86_64 -chardev udp,id=charrng0,host=127.0.0.1,port=1234,localaddr=,localport=1234
> qemu-system-x86_64: -chardev udp,id=charrng0,host=127.0.0.1,port=1234,localaddr=,localport=1234: Invalid parameter 'localaddr'
> Aborted (core dumped)
>
> Prior to the commit mentioned above the error would be printed but the
> value for localaddr and localport was simply ignored. I did not go
> trhough the code to find out when it was broken.

s/trhough/through/

Perhaps this can be touched up on commit.

>
> Add the two fields so that the options can again be parsed correctly and
> qemu doesn't abort().
>
> Resolves: https://bugzilla.redhat.com/show_bug.cgi?id=1220252
>
> Signed-off-by: Peter Krempa <pkrempa@redhat.com>
> Reviewed-by: Eric Blake <eblake@redhat.com>

File has no maintainer.  Adding qemu-trivial.

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

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [Qemu-devel] [PATCH v2] util: socket: Add missing localaddr and localport option for DGRAM socket
  2015-05-15 12:24 ` Markus Armbruster
@ 2015-05-28 11:25   ` Michael Tokarev
  0 siblings, 0 replies; 3+ messages in thread
From: Michael Tokarev @ 2015-05-28 11:25 UTC (permalink / raw)
  To: Markus Armbruster, Peter Krempa; +Cc: qemu-trivial, qemu-devel

15.05.2015 15:24, Markus Armbruster wrote:
> Peter Krempa <pkrempa@redhat.com> writes:
> 
>> The 'socket_optslist' structure does not contain the 'localaddr' and
>> 'localport' options that are parsed in case you are creating a
>> 'connect' type UDP character device.
..

Applied to -trivial, with commit message fixup suggested by Markus.
Thanks!

/mjt

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2015-05-28 11:26 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2015-05-15  9:31 [Qemu-devel] [PATCH v2] util: socket: Add missing localaddr and localport option for DGRAM socket Peter Krempa
2015-05-15 12:24 ` Markus Armbruster
2015-05-28 11:25   ` Michael Tokarev

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.