qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
* [Qemu-devel] [PULL v1 0/2] Merge qio 2017/04/04 v1
@ 2017-04-04 15:20 Daniel P. Berrange
  2017-04-04 15:20 ` [Qemu-devel] [PULL v1 1/2] io: fix incoming client socket initialization Daniel P. Berrange
                   ` (2 more replies)
  0 siblings, 3 replies; 4+ messages in thread
From: Daniel P. Berrange @ 2017-04-04 15:20 UTC (permalink / raw)
  To: qemu-devel; +Cc: Peter Maydell, 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

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(-)

-- 
2.9.3

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

* [Qemu-devel] [PULL v1 1/2] io: fix incoming client socket initialization
  2017-04-04 15:20 [Qemu-devel] [PULL v1 0/2] Merge qio 2017/04/04 v1 Daniel P. Berrange
@ 2017-04-04 15:20 ` Daniel P. Berrange
  2017-04-04 15:20 ` [Qemu-devel] [PULL v1 2/2] io: fix FD socket handling in DNS lookup Daniel P. Berrange
  2017-04-04 16:46 ` [Qemu-devel] [PULL v1 0/2] Merge qio 2017/04/04 v1 Peter Maydell
  2 siblings, 0 replies; 4+ messages in thread
From: Daniel P. Berrange @ 2017-04-04 15:20 UTC (permalink / raw)
  To: qemu-devel; +Cc: Peter Maydell, Wang guang, zhanghailiang, Daniel P . Berrange

From: Wang guang <wang.guang55@zte.com.cn>

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.

Signed-off-by: Wang Guang<wang.guang55@zte.com.cn>
Signed-off-by: zhanghailiang <zhang.zhanghailiang@huawei.com>
Reviewed-by: Eric Blake <eblake@redhat.com>
Signed-off-by: Daniel P. Berrange <berrange@redhat.com>
---
 io/channel-socket.c            | 8 +-------
 tests/test-io-channel-socket.c | 8 ++++++++
 2 files changed, 9 insertions(+), 7 deletions(-)

diff --git a/io/channel-socket.c b/io/channel-socket.c
index f546c68..64b36f5 100644
--- a/io/channel-socket.c
+++ b/io/channel-socket.c
@@ -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,
diff --git a/tests/test-io-channel-socket.c b/tests/test-io-channel-socket.c
index aaa9116..c5c1314 100644
--- a/tests/test-io-channel-socket.c
+++ b/tests/test-io-channel-socket.c
@@ -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);
-- 
2.9.3

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

* [Qemu-devel] [PULL v1 2/2] io: fix FD socket handling in DNS lookup
  2017-04-04 15:20 [Qemu-devel] [PULL v1 0/2] Merge qio 2017/04/04 v1 Daniel P. Berrange
  2017-04-04 15:20 ` [Qemu-devel] [PULL v1 1/2] io: fix incoming client socket initialization Daniel P. Berrange
@ 2017-04-04 15:20 ` Daniel P. Berrange
  2017-04-04 16:46 ` [Qemu-devel] [PULL v1 0/2] Merge qio 2017/04/04 v1 Peter Maydell
  2 siblings, 0 replies; 4+ messages in thread
From: Daniel P. Berrange @ 2017-04-04 15:20 UTC (permalink / raw)
  To: qemu-devel; +Cc: Peter Maydell, 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.

Signed-off-by: Daniel P. Berrange <berrange@redhat.com>
---
 io/dns-resolver.c | 5 +----
 1 file changed, 1 insertion(+), 4 deletions(-)

diff --git a/io/dns-resolver.c b/io/dns-resolver.c
index a407075..759d1b4 100644
--- a/io/dns-resolver.c
+++ b/io/dns-resolver.c
@@ -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();
     }
-- 
2.9.3

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

* Re: [Qemu-devel] [PULL v1 0/2] Merge qio 2017/04/04 v1
  2017-04-04 15:20 [Qemu-devel] [PULL v1 0/2] Merge qio 2017/04/04 v1 Daniel P. Berrange
  2017-04-04 15:20 ` [Qemu-devel] [PULL v1 1/2] io: fix incoming client socket initialization Daniel P. Berrange
  2017-04-04 15:20 ` [Qemu-devel] [PULL v1 2/2] io: fix FD socket handling in DNS lookup Daniel P. Berrange
@ 2017-04-04 16:46 ` Peter Maydell
  2 siblings, 0 replies; 4+ messages in thread
From: Peter Maydell @ 2017-04-04 16:46 UTC (permalink / raw)
  To: Daniel P. Berrange; +Cc: QEMU Developers

On 4 April 2017 at 16:20, Daniel P. Berrange <berrange@redhat.com> wrote:
> 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
>
> ----------------------------------------------------------------

Applied, thanks.

-- PMM

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

end of thread, other threads:[~2017-04-04 16:46 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2017-04-04 15:20 [Qemu-devel] [PULL v1 0/2] Merge qio 2017/04/04 v1 Daniel P. Berrange
2017-04-04 15:20 ` [Qemu-devel] [PULL v1 1/2] io: fix incoming client socket initialization Daniel P. Berrange
2017-04-04 15:20 ` [Qemu-devel] [PULL v1 2/2] io: fix FD socket handling in DNS lookup Daniel P. Berrange
2017-04-04 16:46 ` [Qemu-devel] [PULL v1 0/2] Merge qio 2017/04/04 v1 Peter Maydell

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).