aboutsummaryrefslogtreecommitdiff
path: root/io
diff options
context:
space:
mode:
authorMarkus Armbruster <armbru@redhat.com>2017-03-30 19:43:11 +0200
committerMax Reitz <mreitz@redhat.com>2017-04-03 17:11:39 +0200
commita6c76285f2e41535527a46edf4d158a2779545e1 (patch)
tree2957f1ebb21317f39da1fa2d3e0cb19af585ad0b /io
parentd2e49aad7259af943b72be761ee5c18e14acd71a (diff)
downloadqemu-a6c76285f2e41535527a46edf4d158a2779545e1.zip
qemu-a6c76285f2e41535527a46edf4d158a2779545e1.tar.gz
qemu-a6c76285f2e41535527a46edf4d158a2779545e1.tar.bz2
io vnc sockets: Clean up SocketAddressKind switches
We have quite a few switches over SocketAddressKind. Some have case labels for all enumeration values, others rely on a default label. Some abort when the value isn't a valid SocketAddressKind, others report an error then. Unify as follows. Always provide case labels for all enumeration values, to clarify intent. Abort when the value isn't a valid SocketAddressKind, because the program state is messed up then. Improve a few error messages while there. Signed-off-by: Markus Armbruster <armbru@redhat.com> Reviewed-by: Max Reitz <mreitz@redhat.com> Message-id: 1490895797-29094-4-git-send-email-armbru@redhat.com Signed-off-by: Max Reitz <mreitz@redhat.com>
Diffstat (limited to 'io')
-rw-r--r--io/dns-resolver.c7
1 files changed, 5 insertions, 2 deletions
diff --git a/io/dns-resolver.c b/io/dns-resolver.c
index 0ac6b23..a407075 100644
--- a/io/dns-resolver.c
+++ b/io/dns-resolver.c
@@ -164,9 +164,12 @@ int qio_dns_resolver_lookup_sync(QIODNSResolver *resolver,
addrs,
errp);
- default:
- error_setg(errp, "Unknown socket address kind");
+ case SOCKET_ADDRESS_KIND_FD:
+ error_setg(errp, "Unsupported socket address type 'fd'");
return -1;
+
+ default:
+ abort();
}
}