qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
* [Qemu-devel] [PATCH] main: Hide F_GETFD and FD_CLOEXEC use for _WIN32
@ 2012-10-22 13:53 Corey Bryant
  2012-10-22 16:16 ` Luiz Capitulino
  2012-10-22 16:28 ` Stefan Weil
  0 siblings, 2 replies; 6+ messages in thread
From: Corey Bryant @ 2012-10-22 13:53 UTC (permalink / raw)
  To: qemu-devel; +Cc: kwolf, gollub, Corey Bryant, agraf, lcapitulino


Signed-off-by: Corey Bryant <coreyb@linux.vnet.ibm.com>
---
 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,
-- 
1.7.11.4

^ permalink raw reply related	[flat|nested] 6+ messages in thread

* Re: [Qemu-devel] [PATCH] main: Hide F_GETFD and FD_CLOEXEC use for _WIN32
  2012-10-22 13:53 [Qemu-devel] [PATCH] main: Hide F_GETFD and FD_CLOEXEC use for _WIN32 Corey Bryant
@ 2012-10-22 16:16 ` Luiz Capitulino
  2012-10-22 17:46   ` Corey Bryant
  2012-10-22 16:28 ` Stefan Weil
  1 sibling, 1 reply; 6+ messages in thread
From: Luiz Capitulino @ 2012-10-22 16:16 UTC (permalink / raw)
  To: Corey Bryant; +Cc: kwolf, gollub, qemu-devel, agraf

On Mon, 22 Oct 2012 09:53:44 -0400
Corey Bryant <coreyb@linux.vnet.ibm.com> wrote:

> 
> Signed-off-by: Corey Bryant <coreyb@linux.vnet.ibm.com>
> ---
>  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

Which series is this from? The command-line support for fd sets?

qerror_report() is deprecated.

>  
>      if (fdset_id < 0) {
>          qerror_report(ERROR_CLASS_GENERIC_ERROR,

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [Qemu-devel] [PATCH] main: Hide F_GETFD and FD_CLOEXEC use for _WIN32
  2012-10-22 13:53 [Qemu-devel] [PATCH] main: Hide F_GETFD and FD_CLOEXEC use for _WIN32 Corey Bryant
  2012-10-22 16:16 ` Luiz Capitulino
@ 2012-10-22 16:28 ` Stefan Weil
  2012-10-22 17:35   ` Corey Bryant
  1 sibling, 1 reply; 6+ messages in thread
From: Stefan Weil @ 2012-10-22 16:28 UTC (permalink / raw)
  To: Corey Bryant; +Cc: kwolf, gollub, lcapitulino, qemu-devel, agraf

Am 22.10.2012 15:53, schrieb Corey Bryant:
> Signed-off-by: Corey Bryant<coreyb@linux.vnet.ibm.com>
> ---
>   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?
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).

Regards
Stefan Weil

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [Qemu-devel] [PATCH] main: Hide F_GETFD and FD_CLOEXEC use for _WIN32
  2012-10-22 16:28 ` Stefan Weil
@ 2012-10-22 17:35   ` Corey Bryant
  0 siblings, 0 replies; 6+ messages in thread
From: Corey Bryant @ 2012-10-22 17:35 UTC (permalink / raw)
  To: Stefan Weil; +Cc: kwolf, agraf, gollub, qemu-devel, lcapitulino



On 10/22/2012 12:28 PM, Stefan Weil wrote:
> Am 22.10.2012 15:53, schrieb Corey Bryant:
>> Signed-off-by: Corey Bryant<coreyb@linux.vnet.ibm.com>
>> ---
>>   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

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [Qemu-devel] [PATCH] main: Hide F_GETFD and FD_CLOEXEC use for _WIN32
  2012-10-22 16:16 ` Luiz Capitulino
@ 2012-10-22 17:46   ` Corey Bryant
  2012-10-23  9:47     ` Kevin Wolf
  0 siblings, 1 reply; 6+ messages in thread
From: Corey Bryant @ 2012-10-22 17:46 UTC (permalink / raw)
  To: Luiz Capitulino, kwolf; +Cc: gollub, qemu-devel, agraf



On 10/22/2012 12:16 PM, Luiz Capitulino wrote:
> On Mon, 22 Oct 2012 09:53:44 -0400
> Corey Bryant <coreyb@linux.vnet.ibm.com> wrote:
>
>>
>> Signed-off-by: Corey Bryant <coreyb@linux.vnet.ibm.com>
>> ---
>>   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
>
> Which series is this from? The command-line support for fd sets?
>
> qerror_report() is deprecated.
>

Kevin, please let me know if you want me to fix this.  Otherwise I 
assume you'll modify the v5 patch.

>>
>>       if (fdset_id < 0) {
>>           qerror_report(ERROR_CLASS_GENERIC_ERROR,
>

-- 
Regards,
Corey Bryant

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [Qemu-devel] [PATCH] main: Hide F_GETFD and FD_CLOEXEC use for _WIN32
  2012-10-22 17:46   ` Corey Bryant
@ 2012-10-23  9:47     ` Kevin Wolf
  0 siblings, 0 replies; 6+ messages in thread
From: Kevin Wolf @ 2012-10-23  9:47 UTC (permalink / raw)
  To: Corey Bryant; +Cc: agraf, gollub, qemu-devel, Luiz Capitulino

Am 22.10.2012 19:46, schrieb Corey Bryant:
> 
> 
> On 10/22/2012 12:16 PM, Luiz Capitulino wrote:
>> On Mon, 22 Oct 2012 09:53:44 -0400
>> Corey Bryant <coreyb@linux.vnet.ibm.com> wrote:
>>
>>>
>>> Signed-off-by: Corey Bryant <coreyb@linux.vnet.ibm.com>
>>> ---
>>>   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
>>
>> Which series is this from? The command-line support for fd sets?
>>
>> qerror_report() is deprecated.
>>
> 
> Kevin, please let me know if you want me to fix this.  Otherwise I 
> assume you'll modify the v5 patch.

Any conversion of interfaces should be done on top.

Kevin

^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2012-10-23  9:47 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2012-10-22 13:53 [Qemu-devel] [PATCH] main: Hide F_GETFD and FD_CLOEXEC use for _WIN32 Corey Bryant
2012-10-22 16:16 ` Luiz Capitulino
2012-10-22 17:46   ` Corey Bryant
2012-10-23  9:47     ` Kevin Wolf
2012-10-22 16:28 ` Stefan Weil
2012-10-22 17:35   ` Corey Bryant

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).