Il 04/09/2013 19:31, Stefan Weil ha scritto: > May I suggest a slightly different approach? Instead of a new function > qemu_set_reuseaddr I'd prefer extending the existing qemu_setsockopt. > These steps / patches are required: > > 1. Move *sock* lines from include/qemu-common.h to include/qemu/sockets.h > and addqemu/sockets.h to the include statements in bt-host.c and > linux-user/syscall.c (I hope this list is complete). > > This step is needed because we don't want to add socket includes to > qemu-common.h (which would be needed when we add a function prototype > for qemu_setsockopt). > > 2. Replace the Win32 defines for qemu_getsockopt, qemu_setsockopt by > function > prototypes (see Linux getsockopt, setsockopt for reference) and > implement both functions in util/oslib-win32.c. Ignore SO_REUSEADDR in > qemu_setsockopt. > > Using these two functions allows easy implementation of OS specific hacks > (we might need more in the future). > > 3. Revert commit efcb7e45290ecc8633f7c5bdf02ac86f6289fa7d. It is no longer > needed after patch 2.
Yeah, that's also an interesting way to do it! Paolo