Commit f9b5426f authored by Peter Maydell's avatar Peter Maydell Committed by Michael Tokarev

util/qemu-sockets.c: Avoid unused variable warnings

The 'on' variable is never used, and 'off' is only used
if IPV6_V6ONLY is defined; delete 'on' and move 'off' to
the point where it is used. This avoids warnings from
clang 3.4.
Signed-off-by: default avatarPeter Maydell <>
Signed-off-by: default avatarMichael Tokarev <>
parent 71795856
......@@ -30,8 +30,6 @@
# define AI_ADDRCONFIG 0
static const int on=1, off=0;
/* used temporarily until all users are converted to QemuOpts */
QemuOptsList socket_optslist = {
.name = "socket",
......@@ -159,6 +157,7 @@ int inet_listen_opts(QemuOpts *opts, int port_offset, Error **errp)
#ifdef IPV6_V6ONLY
if (e->ai_family == PF_INET6) {
/* listen on both ipv4 and ipv6 */
const int off = 0;
qemu_setsockopt(slisten, IPPROTO_IPV6, IPV6_V6ONLY, &off,
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment