aboutsummaryrefslogtreecommitdiff
path: root/tests/test-char.c
diff options
context:
space:
mode:
authorMarkus Armbruster <armbru@redhat.com>2017-04-26 09:36:41 +0200
committerMarkus Armbruster <armbru@redhat.com>2017-05-09 09:14:40 +0200
commitbd269ebc82fbaa5fe7ce5bc7c1770ac8acecd884 (patch)
tree82ef0cd9da0812afc7021d5690c14f72e8e13177 /tests/test-char.c
parent62cf396b5d397948c5ac4d04d09596ca14f6c173 (diff)
sockets: Limit SocketAddressLegacy to external interfaces
SocketAddressLegacy is a simple union, and simple unions are awkward: they have their variant members wrapped in a "data" object on the wire, and require additional indirections in C. SocketAddress is the equivalent flat union. Convert all users of SocketAddressLegacy to SocketAddress, except for existing external interfaces. See also commit fce5d53..9445673 and 85a82e8..c5f1ae3. Signed-off-by: Markus Armbruster <armbru@redhat.com> Message-Id: <1493192202-3184-7-git-send-email-armbru@redhat.com> Reviewed-by: Eric Blake <eblake@redhat.com> [Minor editing accident fixed, commit message and a comment tweaked] Signed-off-by: Markus Armbruster <armbru@redhat.com>
Diffstat (limited to 'tests/test-char.c')
-rw-r--r--tests/test-char.c5
1 files changed, 2 insertions, 3 deletions
diff --git a/tests/test-char.c b/tests/test-char.c
index 773a1c36ba..124d0c5439 100644
--- a/tests/test-char.c
+++ b/tests/test-char.c
@@ -291,7 +291,7 @@ static void char_socket_test(void)
Chardev *chr = qemu_chr_new("server", "tcp:127.0.0.1:0,server,nowait");
Chardev *chr_client;
QObject *addr;
- QDict *qdict, *data;
+ QDict *qdict;
const char *port;
SocketIdleData d = { .chr = chr };
CharBackend be;
@@ -306,8 +306,7 @@ static void char_socket_test(void)
addr = object_property_get_qobject(OBJECT(chr), "addr", &error_abort);
qdict = qobject_to_qdict(addr);
- data = qdict_get_qdict(qdict, "data");
- port = qdict_get_str(data, "port");
+ port = qdict_get_str(qdict, "port");
tmp = g_strdup_printf("tcp:127.0.0.1:%s", port);
QDECREF(qdict);