From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([208.118.235.92]:50869) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1TQLwM-0003mV-MK for qemu-devel@nongnu.org; Mon, 22 Oct 2012 13:37:28 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1TQLwL-0000Q8-Ny for qemu-devel@nongnu.org; Mon, 22 Oct 2012 13:37:26 -0400 Received: from e1.ny.us.ibm.com ([32.97.182.141]:52298) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1TQLwL-0000Pz-Ig for qemu-devel@nongnu.org; Mon, 22 Oct 2012 13:37:25 -0400 Received: from /spool/local by e1.ny.us.ibm.com with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted for from ; Mon, 22 Oct 2012 13:37:13 -0400 Received: from d01relay02.pok.ibm.com (d01relay02.pok.ibm.com [9.56.227.234]) by d01dlp02.pok.ibm.com (Postfix) with ESMTP id 0FD8C6E8073 for ; Mon, 22 Oct 2012 13:37:05 -0400 (EDT) Received: from d03av01.boulder.ibm.com (d03av01.boulder.ibm.com [9.17.195.167]) by d01relay02.pok.ibm.com (8.13.8/8.13.8/NCO v10.0) with ESMTP id q9MHb4Ss272872 for ; Mon, 22 Oct 2012 13:37:04 -0400 Received: from d03av01.boulder.ibm.com (loopback [127.0.0.1]) by d03av01.boulder.ibm.com (8.14.4/8.13.1/NCO v10.0 AVout) with ESMTP id q9MHZhxw007734 for ; Mon, 22 Oct 2012 11:35:45 -0600 Message-ID: <508583EC.8090301@linux.vnet.ibm.com> Date: Mon, 22 Oct 2012 13:35:40 -0400 From: Corey Bryant MIME-Version: 1.0 References: <1350914024-4794-1-git-send-email-coreyb@linux.vnet.ibm.com> <50857425.3020607@weilnetz.de> In-Reply-To: <50857425.3020607@weilnetz.de> Content-Type: text/plain; charset=ISO-8859-15; format=flowed Content-Transfer-Encoding: 7bit Subject: Re: [Qemu-devel] [PATCH] main: Hide F_GETFD and FD_CLOEXEC use for _WIN32 List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Stefan Weil Cc: kwolf@redhat.com, agraf@suse.de, gollub@b1-systems.de, qemu-devel@nongnu.org, lcapitulino@redhat.com On 10/22/2012 12:28 PM, Stefan Weil wrote: > Am 22.10.2012 15:53, schrieb Corey Bryant: >> Signed-off-by: Corey Bryant >> --- >> vl.c | 2 ++ >> 1 file changed, 2 insertions(+) >> >> diff --git a/vl.c b/vl.c >> index 200d849..94c667d 100644 >> --- a/vl.c >> +++ b/vl.c >> @@ -812,11 +812,13 @@ static int parse_add_fd(QemuOpts *opts, void >> *opaque) >> return -1; >> } >> >> +#ifndef _WIN32 >> if (fcntl(fd, F_GETFD)& FD_CLOEXEC) { >> qerror_report(ERROR_CLASS_GENERIC_ERROR, >> "fd is not valid or already in use"); >> return -1; >> } >> +#endif >> >> if (fdset_id< 0) { >> qerror_report(ERROR_CLASS_GENERIC_ERROR, > > > Are you sure that all other hosts provide F_GETFD and FD_CLOEXEC > and that MinGW will never do that? I don't know for sure but use of F_GETFD and FD_CLOEXEC broke the build for MinGW. > Maybe testing those two macros instead of _WIN32 would be better: > > #if defined(F_GETFD) && defined(FD_CLOEXEC) > ... > #endif > > I also think that this patch should be merged with the one which adds > that code and not applied as a separate patch (otherwise git bisect would > be broken). Kevin ended up providing a fix for this in "[PATCH v5] qemu-config: Add new -add-fd command line option" which fails the -add-fd command for Windows. This is in-line with how the QMP add-fd command behaves. -- Regards, Corey Bryant