qemu/util
Paolo Bonzini b77e7c8e99 qemu-sockets: fix conversion of ipv4/ipv6 JSON to QemuOpts
The QemuOpts-based code treats "option not set" and "option set
to false" the same way for the ipv4 and ipv6 options, because it
is meant to handle only the ",ipv4" and ",ipv6" substrings in
hand-crafted option parsers.

When converting InetSocketAddress to QemuOpts, however, it is
necessary to handle all three cases (not set, set to true, set
to false).  Currently we are not handling all cases correctly.
The rules are:

* if none or both options are absent, leave things as is

* if the single present option is Y, the other should be N.
This can be implemented by leaving things as is, or by setting
the other option to N as done in this patch.

* if the single present option is N, the other should be Y.
This is handled by the "else if" branch of this patch.

This ensures that the ipv4 option has an effect on Windows,
where creating the socket with PF_UNSPEC makes an ipv6
socket.  With this patch, ",ipv4" will result in a PF_INET
socket instead.

Reported-by: Sair, Umair <Umair_Sair@mentor.com>
Tested-by: Sair, Umair <Umair_Sair@mentor.com>
Reviewed-by: Daniel P. Berrange <berrange@redhat.com>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
2015-10-12 18:29:26 +02:00
..
acl.c
bitmap.c maint: remove / fix many doubled words 2015-09-11 10:21:38 +03:00
bitops.c
compatfd.c util: Remove unused functions 2015-04-30 16:05:48 +03:00
crc32c.c
cutils.c utils: rename strtosz to use qemu prefix 2015-09-25 12:04:41 +02:00
envlist.c
error.c error: New error_fatal 2015-09-18 14:38:08 +02:00
event_notifier-posix.c event-notifier: Always return 0 for posix implementation 2015-06-12 13:26:21 +01:00
event_notifier-win32.c
fifo8.c
getauxval.c
hbitmap.c util/hbitmap: Add an API to reset all set bits in hbitmap 2015-06-23 15:06:16 +01:00
hexdump.c
host-utils.c
id.c
iov.c iov: don't touch iov in iov_send_recv() 2015-06-23 16:05:34 +01:00
Makefile.objs crypto: move built-in AES implementation into crypto/ 2015-07-07 12:04:13 +02:00
module.c
notify.c
osdep.c qerror: Move #include out of qerror.h 2015-06-22 18:20:40 +02:00
oslib-posix.c oslib: allocate PROT_NONE pages on top of RAM 2015-10-01 16:16:52 +03:00
oslib-win32.c oslib-win32: only provide localtime_r/gmtime_r if missing 2015-09-24 21:13:49 +02:00
path.c
qemu-config.c Include qapi/qmp/qerror.h exactly where needed 2015-06-22 18:20:41 +02:00
qemu-error.c error: only prepend timestamp on stderr 2015-09-18 14:34:39 +02:00
qemu-openpty.c
qemu-option.c hmp: Allow for error message hints on HMP 2015-09-18 14:34:39 +02:00
qemu-progress.c
qemu-sockets.c qemu-sockets: fix conversion of ipv4/ipv6 JSON to QemuOpts 2015-10-12 18:29:26 +02:00
qemu-thread-posix.c * Support for jemalloc 2015-09-14 16:13:16 +01:00
qemu-thread-win32.c qemu-thread: add a fast path to the Win32 QemuEvent 2015-09-24 20:52:28 +02:00
qemu-timer-common.c
rcu.c Revert "rcu: init rcu_registry_lock after fork" 2015-09-16 17:33:32 +02:00
readline.c
rfifolock.c
throttle.c throttle: refuse bps_max/iops_max without bps/iops 2015-08-05 12:53:48 +01:00
unicode.c
uri.c util/uri: Add overflow check to rfc3986_parse_port 2015-03-18 12:05:31 +01:00