From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:36011) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1VHH4g-00087s-Co for qemu-devel@nongnu.org; Wed, 04 Sep 2013 13:41:08 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1VHH4a-0001JZ-8K for qemu-devel@nongnu.org; Wed, 04 Sep 2013 13:41:02 -0400 Received: from mx1.redhat.com ([209.132.183.28]:51309) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1VHH4a-0001JT-1D for qemu-devel@nongnu.org; Wed, 04 Sep 2013 13:40:56 -0400 Message-ID: <522770A0.9080705@redhat.com> Date: Wed, 04 Sep 2013 19:40:48 +0200 From: Paolo Bonzini MIME-Version: 1.0 References: <1378304540-1431-1-git-send-email-ottlik@fzi.de> <52274357.6010509@redhat.com> <52276E59.8090909@weilnetz.de> In-Reply-To: <52276E59.8090909@weilnetz.de> Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit Subject: Re: [Qemu-devel] [PATCH RFC] Do not set SO_REUSEADDR on Windows List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Stefan Weil Cc: Peter Maydell , Anthony Liguori , Jan Kiszka , Sebastian Ottlik , QEMU Developers , Stefan Hajnoczi 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