Skip to contentSkip to conversation

qemu-char, io: fix ordering of arguments for UDP socket creation

PATCH In review Paolo Bonzini 2 participants 2 messages Feb 9, 2016

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 qemu-char, io: fix ordering of arguments for UDP socket creation

Two wrongs make a right, but they should be fixed anyway.

Cc Daniel P. Berrange <[email protected]>
---
 io/channel-socket.c | 2 +-
 qemu-char.c         | 2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)
io/channel-socket.c +1 -1
index 22d2fd6..bf66a78 100644
@@ -258,7 +258,7 @@ int qio_channel_socket_dgram_sync(QIOChannelSocket *ioc,
     int fd;
 
     trace_qio_channel_socket_dgram_sync(ioc, localAddr, remoteAddr);
-    fd = socket_dgram(localAddr, remoteAddr, errp);
+    fd = socket_dgram(remoteAddr, localAddr, errp);
     if (fd < 0) {
         trace_qio_channel_socket_dgram_fail(ioc);
         return -1;
qemu-char.c +1 -1
index 84eb8a1..2b2c56b 100644
@@ -4386,7 +4386,7 @@ static CharDriverState *qmp_chardev_open_udp(const char *id,
     QIOChannelSocket *sioc = qio_channel_socket_new();
 
     if (qio_channel_socket_dgram_sync(sioc,
-                                      udp->remote, udp->local,
+                                      udp->local, udp->remote,
                                       errp) < 0) {
         object_unref(OBJECT(sioc));
         return NULL;
Signature · 1 line
2.5.0
#1 lore raw
Quoted 8 lines · Paolo Bonzini

Two wrongs make a right, but they should be fixed anyway.

Cc Daniel P. Berrange <[email protected]>
---
 io/channel-socket.c | 2 +-
 qemu-char.c         | 2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)

Looks like motivation for me to write another unit test :-)

Quoted 18 lines
io/channel-socket.c +1 -1
index 22d2fd6..bf66a78 100644
@@ -258,7 +258,7 @@ int qio_channel_socket_dgram_sync(QIOChannelSocket *ioc,
     int fd;
 
     trace_qio_channel_socket_dgram_sync(ioc, localAddr, remoteAddr);
-    fd = socket_dgram(localAddr, remoteAddr, errp);
+    fd = socket_dgram(remoteAddr, localAddr, errp);
     if (fd < 0) {
         trace_qio_channel_socket_dgram_fail(ioc);
         return -1;
qemu-char.c +0 -0
index 84eb8a1..2b2c56b 100644

qemu-char.c static CharDriverState *qmp_chardev_open_udp(const char *id, · line 4392

Quoted 8 lines
qemu-char.c +1 -1
@@ -4386,7 +4386,7 @@ static CharDriverState *qmp_chardev_open_udp(const char *id,
     QIOChannelSocket *sioc = qio_channel_socket_new();
 
     if (qio_channel_socket_dgram_sync(sioc,
-                                      udp->remote, udp->local,
+                                      udp->local, udp->remote,
                                       errp) < 0) {
         object_unref(OBJECT(sioc));
         return NULL;

Regards,
Daniel

Signature · 4 lines
|: http://berrange.com      -o-    http://www.flickr.com/photos/dberrange/ :|
|: http://libvirt.org              -o-             http://virt-manager.org :|
|: http://autobuild.org       -o-         http://search.cpan.org/~danberr/ :|
|: http://entangle-photo.org       -o-       http://live.gnome.org/gtk-vnc :|