qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
* [Qemu-devel] [PATCH] char: Enable build of pty on macOS
@ 2018-08-21 17:23 Roman Bolshakov
  2018-08-21 18:19 ` Eric Blake
  2018-08-21 18:29 ` Peter Maydell
  0 siblings, 2 replies; 4+ messages in thread
From: Roman Bolshakov @ 2018-08-21 17:23 UTC (permalink / raw)
  To: qemu-devel; +Cc: Roman Bolshakov, Paolo Bonzini, Marc-André Lureau

For some reason __APPLE__ was not checked in pty code. pty chardev
should be available on macOS, according to man page.

Signed-off-by: Roman Bolshakov <r.bolshakov@yadro.com>
---
 chardev/char-pty.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/chardev/char-pty.c b/chardev/char-pty.c
index 68fd4e20c3..cb00257ebe 100644
--- a/chardev/char-pty.c
+++ b/chardev/char-pty.c
@@ -33,7 +33,7 @@
 
 #if defined(__linux__) || defined(__sun__) || defined(__FreeBSD__)      \
     || defined(__NetBSD__) || defined(__OpenBSD__) || defined(__DragonFly__) \
-    || defined(__GLIBC__)
+    || defined(__GLIBC__) || defined(__APPLE__)
 
 typedef struct {
     Chardev parent;
-- 
2.15.2 (Apple Git-101.1)

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

* Re: [Qemu-devel] [PATCH] char: Enable build of pty on macOS
  2018-08-21 17:23 [Qemu-devel] [PATCH] char: Enable build of pty on macOS Roman Bolshakov
@ 2018-08-21 18:19 ` Eric Blake
  2018-08-21 18:29 ` Peter Maydell
  1 sibling, 0 replies; 4+ messages in thread
From: Eric Blake @ 2018-08-21 18:19 UTC (permalink / raw)
  To: Roman Bolshakov, qemu-devel; +Cc: Paolo Bonzini, Marc-André Lureau

On 08/21/2018 12:23 PM, Roman Bolshakov wrote:
> For some reason __APPLE__ was not checked in pty code. pty chardev
> should be available on macOS, according to man page.
> 
> Signed-off-by: Roman Bolshakov <r.bolshakov@yadro.com>
> ---
>   chardev/char-pty.c | 2 +-
>   1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/chardev/char-pty.c b/chardev/char-pty.c
> index 68fd4e20c3..cb00257ebe 100644
> --- a/chardev/char-pty.c
> +++ b/chardev/char-pty.c
> @@ -33,7 +33,7 @@
>   
>   #if defined(__linux__) || defined(__sun__) || defined(__FreeBSD__)      \
>       || defined(__NetBSD__) || defined(__OpenBSD__) || defined(__DragonFly__) \
> -    || defined(__GLIBC__)
> +    || defined(__GLIBC__) || defined(__APPLE__)
> 

Rather than maintaining an ever-growing fragile list of platforms, could 
we instead replace this whole mess with a single define determined at 
configure time based on a feature test?

-- 
Eric Blake, Principal Software Engineer
Red Hat, Inc.           +1-919-301-3266
Virtualization:  qemu.org | libvirt.org

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

* Re: [Qemu-devel] [PATCH] char: Enable build of pty on macOS
  2018-08-21 17:23 [Qemu-devel] [PATCH] char: Enable build of pty on macOS Roman Bolshakov
  2018-08-21 18:19 ` Eric Blake
@ 2018-08-21 18:29 ` Peter Maydell
  2018-08-22 10:38   ` Paolo Bonzini
  1 sibling, 1 reply; 4+ messages in thread
From: Peter Maydell @ 2018-08-21 18:29 UTC (permalink / raw)
  To: Roman Bolshakov; +Cc: QEMU Developers, Paolo Bonzini, Marc-André Lureau

On 21 August 2018 at 18:23, Roman Bolshakov <r.bolshakov@yadro.com> wrote:
> For some reason __APPLE__ was not checked in pty code. pty chardev
> should be available on macOS, according to man page.
>
> Signed-off-by: Roman Bolshakov <r.bolshakov@yadro.com>
> ---
>  chardev/char-pty.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/chardev/char-pty.c b/chardev/char-pty.c
> index 68fd4e20c3..cb00257ebe 100644
> --- a/chardev/char-pty.c
> +++ b/chardev/char-pty.c
> @@ -33,7 +33,7 @@
>
>  #if defined(__linux__) || defined(__sun__) || defined(__FreeBSD__)      \
>      || defined(__NetBSD__) || defined(__OpenBSD__) || defined(__DragonFly__) \
> -    || defined(__GLIBC__)
> +    || defined(__GLIBC__) || defined(__APPLE__)

We should fix this by figuring out what the code is actually looking
for (ie what OS functions), having a configure test for those
functions, and dropping the big long list of OS ifdefs. Otherwise
we've just got exactly the same problem for the next unix-ish
OS that comes along...

thanks
-- PMM

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

* Re: [Qemu-devel] [PATCH] char: Enable build of pty on macOS
  2018-08-21 18:29 ` Peter Maydell
@ 2018-08-22 10:38   ` Paolo Bonzini
  0 siblings, 0 replies; 4+ messages in thread
From: Paolo Bonzini @ 2018-08-22 10:38 UTC (permalink / raw)
  To: Peter Maydell, Roman Bolshakov; +Cc: QEMU Developers, Marc-André Lureau

On 21/08/2018 20:29, Peter Maydell wrote:
>>
>>  #if defined(__linux__) || defined(__sun__) || defined(__FreeBSD__)      \
>>      || defined(__NetBSD__) || defined(__OpenBSD__) || defined(__DragonFly__) \
>> -    || defined(__GLIBC__)
>> +    || defined(__GLIBC__) || defined(__APPLE__)
> We should fix this by figuring out what the code is actually looking
> for (ie what OS functions), having a configure test for those
> functions, and dropping the big long list of OS ifdefs. Otherwise
> we've just got exactly the same problem for the next unix-ish
> OS that comes along...

It's really looking only for qemu_openpty_raw, which in turn is compiled
for all CONFIG_POSIX systems.  Because the file is already compiled for
CONFIG_POSIX only, the #ifdef is a legacy of the time before
chardev/char-pty.c was split out of qemu-char.c.  It can be removed.

Paolo

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

end of thread, other threads:[~2018-08-22 10:44 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2018-08-21 17:23 [Qemu-devel] [PATCH] char: Enable build of pty on macOS Roman Bolshakov
2018-08-21 18:19 ` Eric Blake
2018-08-21 18:29 ` Peter Maydell
2018-08-22 10:38   ` Paolo Bonzini

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).