aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPeter Maydell <peter.maydell@linaro.org>2017-04-04 16:25:30 +0100
committerPeter Maydell <peter.maydell@linaro.org>2017-04-04 16:25:30 +0100
commitfa902c8ca0f3b83e0e3dda1e9e00f0b1d28e718a (patch)
tree67715e0711b5019dae8169317e7af0061ef0c0cd
parent87cc4c61020addea6a001b94b662596b1896d1b3 (diff)
parentb8a68728b6a3fad86f15aa5efdc31ea0b3cb8a62 (diff)
downloadqemu-fa902c8ca0f3b83e0e3dda1e9e00f0b1d28e718a.zip
qemu-fa902c8ca0f3b83e0e3dda1e9e00f0b1d28e718a.tar.gz
qemu-fa902c8ca0f3b83e0e3dda1e9e00f0b1d28e718a.tar.bz2
Merge remote-tracking branch 'remotes/berrange/tags/pull-qio-2017-04-04-1' into staging
Merge qio 2017/04/04 v1 # gpg: Signature made Tue 04 Apr 2017 16:17:56 BST # gpg: using RSA key 0xBE86EBB415104FDF # gpg: Good signature from "Daniel P. Berrange <dan@berrange.com>" # gpg: aka "Daniel P. Berrange <berrange@redhat.com>" # Primary key fingerprint: DAF3 A6FD B26B 6291 2D0E 8E3F BE86 EBB4 1510 4FDF * remotes/berrange/tags/pull-qio-2017-04-04-1: io: fix FD socket handling in DNS lookup io: fix incoming client socket initialization Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
-rw-r--r--io/channel-socket.c8
-rw-r--r--io/dns-resolver.c5
-rw-r--r--tests/test-io-channel-socket.c8
3 files changed, 10 insertions, 11 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/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();
}
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);