diff options
-rw-r--r-- | io/dns-resolver.c | 7 | ||||
-rw-r--r-- | ui/vnc.c | 18 | ||||
-rw-r--r-- | util/qemu-sockets.c | 4 |
3 files changed, 18 insertions, 11 deletions
diff --git a/io/dns-resolver.c b/io/dns-resolver.c index 0ac6b23c02..a407075934 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(); } } @@ -129,10 +129,13 @@ static void vnc_init_basic_info(SocketAddress *addr, info->family = NETWORK_ADDRESS_FAMILY_UNIX; break; - default: - error_setg(errp, "Unsupported socket kind %d", - addr->type); + case SOCKET_ADDRESS_KIND_VSOCK: + case SOCKET_ADDRESS_KIND_FD: + error_setg(errp, "Unsupported socket address type %s", + SocketAddressKind_lookup[addr->type]); break; + default: + abort(); } return; @@ -411,10 +414,13 @@ VncInfo *qmp_query_vnc(Error **errp) info->family = NETWORK_ADDRESS_FAMILY_UNIX; break; - default: - error_setg(errp, "Unsupported socket kind %d", - addr->type); + case SOCKET_ADDRESS_KIND_VSOCK: + case SOCKET_ADDRESS_KIND_FD: + error_setg(errp, "Unsupported socket address type %s", + SocketAddressKind_lookup[addr->type]); goto out_error; + default: + abort(); } info->has_host = true; diff --git a/util/qemu-sockets.c b/util/qemu-sockets.c index 9b7368113c..4ae37bd2a2 100644 --- a/util/qemu-sockets.c +++ b/util/qemu-sockets.c @@ -1337,9 +1337,7 @@ char *socket_address_to_string(struct SocketAddress *addr, Error **errp) break; default: - error_setg(errp, "socket family %d unsupported", - addr->type); - return NULL; + abort(); } return buf; } |