diff options
Diffstat (limited to 'util/qemu-sockets.c')
-rw-r--r-- | util/qemu-sockets.c | 34 |
1 files changed, 18 insertions, 16 deletions
diff --git a/util/qemu-sockets.c b/util/qemu-sockets.c index 7205dad820..e9085237c6 100644 --- a/util/qemu-sockets.c +++ b/util/qemu-sockets.c @@ -200,10 +200,12 @@ listen: return -1; } snprintf(uport, sizeof(uport), "%d", inet_getport(e) - port_offset); - qemu_opt_set(opts, "host", uaddr); - qemu_opt_set(opts, "port", uport); - qemu_opt_set(opts, "ipv6", (e->ai_family == PF_INET6) ? "on" : "off"); - qemu_opt_set(opts, "ipv4", (e->ai_family != PF_INET6) ? "on" : "off"); + qemu_opt_set(opts, "host", uaddr, &error_abort); + qemu_opt_set(opts, "port", uport, &error_abort); + qemu_opt_set(opts, "ipv6", (e->ai_family == PF_INET6) ? "on" : "off", + &error_abort); + qemu_opt_set(opts, "ipv4", (e->ai_family != PF_INET6) ? "on" : "off", + &error_abort); freeaddrinfo(res); return slisten; } @@ -586,10 +588,10 @@ static void inet_addr_to_opts(QemuOpts *opts, const InetSocketAddress *addr) if (addr->has_to) { char to[20]; snprintf(to, sizeof(to), "%d", addr->to); - qemu_opt_set(opts, "to", to); + qemu_opt_set(opts, "to", to, &error_abort); } - qemu_opt_set(opts, "host", addr->host); - qemu_opt_set(opts, "port", addr->port); + qemu_opt_set(opts, "host", addr->host, &error_abort); + qemu_opt_set(opts, "port", addr->port, &error_abort); } int inet_listen(const char *str, char *ostr, int olen, @@ -726,7 +728,7 @@ int unix_listen_opts(QemuOpts *opts, Error **errp) goto err; } close(fd); - qemu_opt_set(opts, "path", un.sun_path); + qemu_opt_set(opts, "path", un.sun_path, &error_abort); } unlink(un.sun_path); @@ -838,11 +840,11 @@ int unix_listen(const char *str, char *ostr, int olen, Error **errp) if (len) { path = g_malloc(len+1); snprintf(path, len+1, "%.*s", len, str); - qemu_opt_set(opts, "path", path); + qemu_opt_set(opts, "path", path, &error_abort); g_free(path); } } else { - qemu_opt_set(opts, "path", str); + qemu_opt_set(opts, "path", str, &error_abort); } sock = unix_listen_opts(opts, errp); @@ -859,7 +861,7 @@ int unix_connect(const char *path, Error **errp) int sock; opts = qemu_opts_create(&socket_optslist, NULL, 0, &error_abort); - qemu_opt_set(opts, "path", path); + qemu_opt_set(opts, "path", path, &error_abort); sock = unix_connect_opts(opts, errp, NULL, NULL); qemu_opts_del(opts); return sock; @@ -876,7 +878,7 @@ int unix_nonblocking_connect(const char *path, g_assert(callback != NULL); opts = qemu_opts_create(&socket_optslist, NULL, 0, &error_abort); - qemu_opt_set(opts, "path", path); + qemu_opt_set(opts, "path", path, &error_abort); sock = unix_connect_opts(opts, errp, callback, opaque); qemu_opts_del(opts); return sock; @@ -933,7 +935,7 @@ int socket_connect(SocketAddress *addr, Error **errp, break; case SOCKET_ADDRESS_KIND_UNIX: - qemu_opt_set(opts, "path", addr->q_unix->path); + qemu_opt_set(opts, "path", addr->q_unix->path, &error_abort); fd = unix_connect_opts(opts, errp, callback, opaque); break; @@ -965,7 +967,7 @@ int socket_listen(SocketAddress *addr, Error **errp) break; case SOCKET_ADDRESS_KIND_UNIX: - qemu_opt_set(opts, "path", addr->q_unix->path); + qemu_opt_set(opts, "path", addr->q_unix->path, &error_abort); fd = unix_listen_opts(opts, errp); break; @@ -990,8 +992,8 @@ int socket_dgram(SocketAddress *remote, SocketAddress *local, Error **errp) case SOCKET_ADDRESS_KIND_INET: inet_addr_to_opts(opts, remote->inet); if (local) { - qemu_opt_set(opts, "localaddr", local->inet->host); - qemu_opt_set(opts, "localport", local->inet->port); + qemu_opt_set(opts, "localaddr", local->inet->host, &error_abort); + qemu_opt_set(opts, "localport", local->inet->port, &error_abort); } fd = inet_dgram_opts(opts, errp); break; |