[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Qemu-devel] [PATCH 2/2] socket: handle ipv4/ipv6 in socket_dgram
From: |
Gerd Hoffmann |
Subject: |
Re: [Qemu-devel] [PATCH 2/2] socket: handle ipv4/ipv6 in socket_dgram |
Date: |
Fri, 28 Feb 2014 14:05:47 +0100 |
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