[qemu-discuss] Re: patch enabling serial (tty) support

Marion Hakanson
Wed, 20 Jun 2007 02:32:21 -0000

Hmm, the patch was in an attachment, and it came to me via the list
intact, but there''s no such attachment visible here.  I''ll try
the cut-and-
paste approach, below.

I''ve also done a "file attachment" via the browser interface
to the list;
Whitespace is probably better preserved within the attachment above.
Suspenders and a belt.

Marion

====================================================--- ./vl.c.0    Sun Jun 10
12:21:04 2007
+++ ./vl.c      Sun Jun 17 16:16:15 2007
@@ -1761,7 +1761,7 @@
     return chr;
 }

-#if defined(__linux__)
+#if defined(__linux__) || defined(__sun__)
 static CharDriverState *qemu_chr_open_pty(void)
 {
     struct termios tty;
@@ -1768,10 +1768,12 @@
     char slave_name[1024];
     int master_fd, slave_fd;

+#if defined(__linux__)
     /* Not satisfying */
     if (openpty(&master_fd, &slave_fd, slave_name, NULL, NULL) < 0)
{
         return NULL;
     }
+#endif

     /* Disabling local echo and line-buffered output */
     tcgetattr (master_fd, &tty);
@@ -1919,6 +1921,7 @@
     return chr;
 }

+#if defined(__linux__)
 typedef struct {
     int fd;
     int mode;
@@ -2061,8 +2064,9 @@

     return chr;
 }
+#endif /* __linux__ */

-#else
+#else  /*! __linux__ && ! __sun__ */
 static CharDriverState *qemu_chr_open_pty(void)
 {
     return NULL;
@@ -2951,11 +2955,11 @@
     } else if (!strcmp(filename, "stdio")) {
         return qemu_chr_open_stdio();
     } else
-#endif
 #if defined(__linux__)
     if (strstart(filename, "/dev/parport", NULL)) {
         return qemu_chr_open_pp(filename);
     } else
+#endif
     if (strstart(filename, "/dev/", NULL)) {
         return qemu_chr_open_tty(filename);
     } else
=====================================================--
This message posted from opensolaris.org
-------------- next part --------------
A non-text attachment was scrubbed...
Name: qemu.patch
Type: application/octet-stream
Size: 1281 bytes
Desc: not available
URL:
<http://mail.opensolaris.org/pipermail/qemu-discuss/attachments/20070619/e7b214bd/attachment.obj>