Skip to contentSkip to conversation

chardev: Add macOS to list of OSes that support -chardev serial

PATCH Applied Mikhail Gusarov 3 participants 3 messages Apr 26, 2020 – May 4, 2020

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 chardev: Add macOS to list of OSes that support -chardev serial

macOS API for dealing with serial ports/ttys is identical to BSDs.

---

Note that the same file has a line

Quoted 1 line

#endif /* linux || sun */

that is severely out of date.

 chardev/char-serial.c | 2 +-
 include/qemu/osdep.h  | 2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)
chardev/char-serial.c +1 -1
index 5b833ea077..7c3d84ae24 100644
@@ -53,7 +53,7 @@ static void qmp_chardev_open_serial(Chardev *chr,
 
 #elif defined(__linux__) || defined(__sun__) || defined(__FreeBSD__)      \
     || defined(__NetBSD__) || defined(__OpenBSD__) || defined(__DragonFly__) \
-    || defined(__GLIBC__)
+    || defined(__GLIBC__) || defined(__APPLE__)
 
 static void tty_serial_init(int fd, int speed,
                             int parity, int data_bits, int stop_bits)
include/qemu/osdep.h +1 -1
index 20f5c5f197..ff7c17b857 100644
@@ -379,7 +379,7 @@ void qemu_anon_ram_free(void *ptr, size_t size);
 #define HAVE_CHARDEV_SERIAL 1
 #elif defined(__linux__) || defined(__sun__) || defined(__FreeBSD__)    \
     || defined(__NetBSD__) || defined(__OpenBSD__) || defined(__DragonFly__) \
-    || defined(__GLIBC__)
+    || defined(__GLIBC__) || defined(__APPLE__)
 #define HAVE_CHARDEV_SERIAL 1
 #endif
 
Signature · 1 line
2.19.1
Reviewed-by Tested-by on v1 1/1
#1 lore raw
Quoted 32 lines · Mikhail Gusarov

macOS API for dealing with serial ports/ttys is identical to BSDs.

---

Note that the same file has a line

Quoted 1 line

#endif /* linux || sun */

that is severely out of date.

 chardev/char-serial.c | 2 +-
 include/qemu/osdep.h  | 2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)
chardev/char-serial.c +1 -1
index 5b833ea077..7c3d84ae24 100644
@@ -53,7 +53,7 @@ static void qmp_chardev_open_serial(Chardev *chr,
 
 #elif defined(__linux__) || defined(__sun__) || defined(__FreeBSD__)      \
     || defined(__NetBSD__) || defined(__OpenBSD__) || defined(__DragonFly__) \
-    || defined(__GLIBC__)
+    || defined(__GLIBC__) || defined(__APPLE__)
 
 static void tty_serial_init(int fd, int speed,
                             int parity, int data_bits, int stop_bits)
include/qemu/osdep.h +0 -0
index 20f5c5f197..ff7c17b857 100644

include/qemu/osdep.h void qemu_anon_ram_free(void *ptr, size_t size); · line 385

Quoted 8 lines
include/qemu/osdep.h +1 -1
@@ -379,7 +379,7 @@ void qemu_anon_ram_free(void *ptr, size_t size);
 #define HAVE_CHARDEV_SERIAL 1
 #elif defined(__linux__) || defined(__sun__) || defined(__FreeBSD__)    \
     || defined(__NetBSD__) || defined(__OpenBSD__) || defined(__DragonFly__) \
-    || defined(__GLIBC__)
+    || defined(__GLIBC__) || defined(__APPLE__)
 #define HAVE_CHARDEV_SERIAL 1
 #endif
 
#2 lore raw
In reply to Mikhail Gusarov

Le 26/04/2020 à 23:09, Mikhail Gusarov a écrit :

Quoted 32 lines

macOS API for dealing with serial ports/ttys is identical to BSDs.

---

Note that the same file has a line

Quoted 1 line

#endif /* linux || sun */

that is severely out of date.

 chardev/char-serial.c | 2 +-
 include/qemu/osdep.h  | 2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)
chardev/char-serial.c +1 -1
index 5b833ea077..7c3d84ae24 100644
@@ -53,7 +53,7 @@ static void qmp_chardev_open_serial(Chardev *chr,
 
 #elif defined(__linux__) || defined(__sun__) || defined(__FreeBSD__)      \
     || defined(__NetBSD__) || defined(__OpenBSD__) || defined(__DragonFly__) \
-    || defined(__GLIBC__)
+    || defined(__GLIBC__) || defined(__APPLE__)
 
 static void tty_serial_init(int fd, int speed,
                             int parity, int data_bits, int stop_bits)
include/qemu/osdep.h +0 -0
index 20f5c5f197..ff7c17b857 100644

include/qemu/osdep.h void qemu_anon_ram_free(void *ptr, size_t size); · line 385

Quoted 8 lines
include/qemu/osdep.h +1 -1
@@ -379,7 +379,7 @@ void qemu_anon_ram_free(void *ptr, size_t size);
 #define HAVE_CHARDEV_SERIAL 1
 #elif defined(__linux__) || defined(__sun__) || defined(__FreeBSD__)    \
     || defined(__NetBSD__) || defined(__OpenBSD__) || defined(__DragonFly__) \
-    || defined(__GLIBC__)
+    || defined(__GLIBC__) || defined(__APPLE__)
 #define HAVE_CHARDEV_SERIAL 1
 #endif
 

Applied to my trivial-patches branch.

Thanks,
Laurent