Skip to contentSkip to conversation

Merge qio 2017/04/04 v1

GIT PULL Applied Daniel P. Berrange 2 participants 4 messages Apr 4, 2017

lore
Share & tools
lore
#0 lore raw

The following changes since commit 87cc4c61020addea6a001b94b662596b1896d1b3:

Merge remote-tracking branch 'remotes/bonzini/tags/for-upstream' into staging (2017-04-04 11:40:55 +0100)

are available in the git repository at:

git://github.com/berrange/qemu tags/pull-qio-2017-04-04-1

for you to fetch changes up to b8a68728b6a3fad86f15aa5efdc31ea0b3cb8a62:

io: fix FD socket handling in DNS lookup (2017-04-04 16:17:03 +0100)

----------------------------------------------------------------
Merge qio 2017/04/04 v1

----------------------------------------------------------------

Daniel P. Berrange (1):
io: fix FD socket handling in DNS lookup

Wang guang (1):
io: fix incoming client socket initialization

 io/channel-socket.c            | 8 +-------
 io/dns-resolver.c              | 5 +----
 tests/test-io-channel-socket.c | 8 ++++++++
 3 files changed, 10 insertions(+), 11 deletions(-)
Signature · 1 line
2.9.3
#1 lore raw

[Qemu-devel] [PULL v1 1/2] io: fix incoming client socket initialization

From: Wang guang <[email protected]>

The channel socket was initialized manually, but forgot to set QIO_CHANNEL_FEATURE_SHUTDOWN. Thus, the colo_process_incoming_thread would hang at recvmsg. This patch just call qio_channel_socket_new to get channel, Which set QIO_CHANNEL_FEATURE_SHUTDOWN already.

---
 io/channel-socket.c            | 8 +-------
 tests/test-io-channel-socket.c | 8 ++++++++
 2 files changed, 9 insertions(+), 7 deletions(-)
io/channel-socket.c +1 -7
index f546c68..64b36f5 100644
@@ -331,16 +331,10 @@ qio_channel_socket_accept(QIOChannelSocket *ioc,
 {
     QIOChannelSocket *cioc;
 
-    cioc = QIO_CHANNEL_SOCKET(object_new(TYPE_QIO_CHANNEL_SOCKET));
-    cioc->fd = -1;
+    cioc = qio_channel_socket_new();
     cioc->remoteAddrLen = sizeof(ioc->remoteAddr);
     cioc->localAddrLen = sizeof(ioc->localAddr);
 
-#ifdef WIN32
-    QIO_CHANNEL(cioc)->event = CreateEvent(NULL, FALSE, FALSE, NULL);
-#endif
-
-
  retry:
     trace_qio_channel_socket_accept(ioc);
     cioc->fd = qemu_accept(ioc->fd, (struct sockaddr *)&cioc->remoteAddr,
tests/test-io-channel-socket.c +8 -0
index aaa9116..c5c1314 100644
@@ -234,6 +234,8 @@ static void test_io_channel(bool async,
                  qio_channel_has_feature(src, QIO_CHANNEL_FEATURE_FD_PASS));
         g_assert(!passFD ||
                  qio_channel_has_feature(dst, QIO_CHANNEL_FEATURE_FD_PASS));
+        g_assert(qio_channel_has_feature(src, QIO_CHANNEL_FEATURE_SHUTDOWN));
+        g_assert(qio_channel_has_feature(dst, QIO_CHANNEL_FEATURE_SHUTDOWN));
 
         test = qio_channel_test_new();
         qio_channel_test_run_threads(test, true, src, dst);
@@ -248,6 +250,8 @@ static void test_io_channel(bool async,
                  qio_channel_has_feature(src, QIO_CHANNEL_FEATURE_FD_PASS));
         g_assert(!passFD ||
                  qio_channel_has_feature(dst, QIO_CHANNEL_FEATURE_FD_PASS));
+        g_assert(qio_channel_has_feature(src, QIO_CHANNEL_FEATURE_SHUTDOWN));
+        g_assert(qio_channel_has_feature(dst, QIO_CHANNEL_FEATURE_SHUTDOWN));
 
         test = qio_channel_test_new();
         qio_channel_test_run_threads(test, false, src, dst);
@@ -262,6 +266,8 @@ static void test_io_channel(bool async,
                  qio_channel_has_feature(src, QIO_CHANNEL_FEATURE_FD_PASS));
         g_assert(!passFD ||
                  qio_channel_has_feature(dst, QIO_CHANNEL_FEATURE_FD_PASS));
+        g_assert(qio_channel_has_feature(src, QIO_CHANNEL_FEATURE_SHUTDOWN));
+        g_assert(qio_channel_has_feature(dst, QIO_CHANNEL_FEATURE_SHUTDOWN));
 
         test = qio_channel_test_new();
         qio_channel_test_run_threads(test, true, src, dst);
@@ -276,6 +282,8 @@ static void test_io_channel(bool async,
                  qio_channel_has_feature(src, QIO_CHANNEL_FEATURE_FD_PASS));
         g_assert(!passFD ||
                  qio_channel_has_feature(dst, QIO_CHANNEL_FEATURE_FD_PASS));
+        g_assert(qio_channel_has_feature(src, QIO_CHANNEL_FEATURE_SHUTDOWN));
+        g_assert(qio_channel_has_feature(dst, QIO_CHANNEL_FEATURE_SHUTDOWN));
 
         test = qio_channel_test_new();
         qio_channel_test_run_threads(test, false, src, dst);
Signature · 1 line
2.9.3
#2 lore raw

[Qemu-devel] [PULL v1 2/2] io: fix FD socket handling in DNS lookup

In reply to Daniel P. Berrange

The qio_dns_resolver_lookup_sync() method is required to be a no-op for socket kinds that don't require name resolution. Thus the KIND_FD handling should not return an error.

---
 io/dns-resolver.c | 5 +----
 1 file changed, 1 insertion(+), 4 deletions(-)
io/dns-resolver.c +1 -4
index a407075..759d1b4 100644
@@ -158,16 +158,13 @@ int qio_dns_resolver_lookup_sync(QIODNSResolver *resolver,
 
     case SOCKET_ADDRESS_KIND_UNIX:
     case SOCKET_ADDRESS_KIND_VSOCK:
+    case SOCKET_ADDRESS_KIND_FD:
         return qio_dns_resolver_lookup_sync_nop(resolver,
                                                 addr,
                                                 naddrs,
                                                 addrs,
                                                 errp);
 
-    case SOCKET_ADDRESS_KIND_FD:
-        error_setg(errp, "Unsupported socket address type 'fd'");
-        return -1;
-
     default:
         abort();
     }
Signature · 1 line
2.9.3
#3 lore raw
In reply to Daniel P. Berrange
Quoted 8 lines · Daniel P. Berrange

The following changes since commit 87cc4c61020addea6a001b94b662596b1896d1b3:

Merge remote-tracking branch 'remotes/bonzini/tags/for-upstream' into staging (2017-04-04 11:40:55 +0100)

are available in the git repository at:

git://github.com/berrange/qemu tags/pull-qio-2017-04-04-1

Quoted 8 lines

for you to fetch changes up to b8a68728b6a3fad86f15aa5efdc31ea0b3cb8a62:

io: fix FD socket handling in DNS lookup (2017-04-04 16:17:03 +0100)

----------------------------------------------------------------
Merge qio 2017/04/04 v1

----------------------------------------------------------------

Applied, thanks.

-- PMM