From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1NLaIK-0002np-Ew for qemu-devel@nongnu.org; Fri, 18 Dec 2009 05:42:48 -0500 Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1NLaIF-0002n8-9S for qemu-devel@nongnu.org; Fri, 18 Dec 2009 05:42:47 -0500 Received: from [199.232.76.173] (port=47819 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1NLaIF-0002n5-0w for qemu-devel@nongnu.org; Fri, 18 Dec 2009 05:42:43 -0500 Received: from mx1.redhat.com ([209.132.183.28]:20799) by monty-python.gnu.org with esmtp (Exim 4.60) (envelope-from ) id 1NLaIE-0002HA-ES for qemu-devel@nongnu.org; Fri, 18 Dec 2009 05:42:42 -0500 Message-ID: <4B2B5C9C.9080406@redhat.com> Date: Fri, 18 Dec 2009 11:42:36 +0100 From: Paolo Bonzini MIME-Version: 1.0 References: <1261129507-13244-1-git-send-email-andre.przywara@amd.com> In-Reply-To: <1261129507-13244-1-git-send-email-andre.przywara@amd.com> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Subject: [Qemu-devel] Re: [PATCH] osdep: Fix runtime failure on older Linux kernels List-Id: qemu-devel.nongnu.org List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Andre Przywara Cc: qemu-devel@nongnu.org On 12/18/2009 10:45 AM, Andre Przywara wrote: > If QEMU finds newer kernel header files on compilation time, it will use > advertised features like pipe2 or SOCK_CLOEXEC by just doing a compile test. > If later the executables are executed on an older kernel (<2.6.27, > like Xen Dom0 2.6.18), then QEMU will fail on opening sockets and creating > pipes and returns the rather unspecific "qemu_init_main_loop failed". > This patch fixes this by checking the return values of these calls > for EINVAL and ENOSYS and falling back to the older versions automatically. Agreed, most other apps that use *_CLOEXEC do this (including glibc itself and gnulib; the notable exception is APR and there were quite some flames about this). Paolo