summaryrefslogtreecommitdiffstats
path: root/tests/unit
diff options
context:
space:
mode:
authorMarkus Armbruster2021-09-17 16:31:19 +0200
committerMarkus Armbruster2021-09-27 08:23:25 +0200
commit935a867c878d1450bf240caa18489649fcdff771 (patch)
treee2ed4270ca8f9ff116e51f29d0ef7352980441d8 /tests/unit
parentqapi: Convert simple union ChardevBackend to flat one (diff)
downloadqemu-935a867c878d1450bf240caa18489649fcdff771.tar.gz
qemu-935a867c878d1450bf240caa18489649fcdff771.tar.xz
qemu-935a867c878d1450bf240caa18489649fcdff771.zip
qapi: Convert simple union SocketAddressLegacy to flat one
Simple unions predate flat unions. Having both complicates the QAPI schema language and the QAPI generator. We haven't been using simple unions in new code for a long time, because they are less flexible and somewhat awkward on the wire. To prepare for their removal, convert simple union SocketAddressLegacy to an equivalent flat one, with existing enum SocketAddressType replacing implicit enum type SocketAddressLegacyKind. Adds some boilerplate to the schema, which is a bit ugly, but a lot easier to maintain than the simple union feature. Cc: "Daniel P. Berrangé" <berrange@redhat.com> Signed-off-by: Markus Armbruster <armbru@redhat.com> Reviewed-by: Eric Blake <eblake@redhat.com> Message-Id: <20210917143134.412106-9-armbru@redhat.com>
Diffstat (limited to 'tests/unit')
-rw-r--r--tests/unit/test-yank.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/tests/unit/test-yank.c b/tests/unit/test-yank.c
index 2383d2908c..e6c036a64d 100644
--- a/tests/unit/test-yank.c
+++ b/tests/unit/test-yank.c
@@ -88,7 +88,7 @@ static void char_change_test(gconstpointer opaque)
.type = CHARDEV_BACKEND_KIND_SOCKET,
.u.socket.data = &(ChardevSocket) {
.addr = &(SocketAddressLegacy) {
- .type = SOCKET_ADDRESS_LEGACY_KIND_INET,
+ .type = SOCKET_ADDRESS_TYPE_INET,
.u.inet.data = &addr->u.inet
},
.has_server = true,
@@ -102,7 +102,7 @@ static void char_change_test(gconstpointer opaque)
.type = CHARDEV_BACKEND_KIND_UDP,
.u.udp.data = &(ChardevUdp) {
.remote = &(SocketAddressLegacy) {
- .type = SOCKET_ADDRESS_LEGACY_KIND_UNIX,
+ .type = SOCKET_ADDRESS_TYPE_UNIX,
.u.q_unix.data = &(UnixSocketAddress) {
.path = (char *)""
}
@@ -114,7 +114,7 @@ static void char_change_test(gconstpointer opaque)
.type = CHARDEV_BACKEND_KIND_SOCKET,
.u.socket.data = &(ChardevSocket) {
.addr = &(SocketAddressLegacy) {
- .type = SOCKET_ADDRESS_LEGACY_KIND_INET,
+ .type = SOCKET_ADDRESS_TYPE_INET,
.u.inet.data = &(InetSocketAddress) {
.host = (char *)"127.0.0.1",
.port = (char *)"0"