diff --git a/util/qemu-sockets.c b/util/qemu-sockets.c index 5d38395f2d5b4e7fb2da3dcd02402edce9d2c84f..4a25585b2ef295df1c07e277bacaa67c1e327b12 100644 --- a/util/qemu-sockets.c +++ b/util/qemu-sockets.c @@ -966,8 +966,7 @@ int socket_dgram(SocketAddress *remote, SocketAddress *local, Error **errp) opts = qemu_opts_create(&socket_optslist, NULL, 0, &error_abort); switch (remote->kind) { case SOCKET_ADDRESS_KIND_INET: - qemu_opt_set(opts, "host", remote->inet->host); - qemu_opt_set(opts, "port", remote->inet->port); + 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);