On Fr, 2014-02-28 at 11:16 +0100, Paolo Bonzini wrote:
> -    case SOCKET_ADDRESS_KIND_INET:
> +    case SOCKET_ADDRESS_KIND_INET: {
> +        bool ipv4 = remote->inet->ipv4 || !remote->inet->has_ipv4;
> +        bool ipv6 = remote->inet->ipv6 || !remote->inet->has_ipv6;
>          qemu_opt_set(opts, "host", remote->inet->host);
>          qemu_opt_set(opts, "port", remote->inet->port);
>          if (local) {
>              qemu_opt_set(opts, "localaddr", local->inet->host);
>              qemu_opt_set(opts, "localport", local->inet->port);
>          }
> +        if (!ipv4 || !ipv6) {
> +            qemu_opt_set_bool(opts, "ipv4", ipv4);
> +            qemu_opt_set_bool(opts, "ipv6", ipv6);
> +        }

I'd go for a simple

        if (remote->inet->has_ipv4) {
                qemu_opt_set_bool(opts, "ipv4", remote->inet->ipv4)
        }

cheers,
  Gerd


Reply via email to