rpms/kvm/devel kvm-68-pty-rawmode.patch, NONE, 1.1 .cvsignore, 1.30, 1.31 kvm.spec, 1.53, 1.54 sources, 1.29, 1.30

Daniel P. Berrange (berrange) fedora-extras-commits at redhat.com
Mon May 5 17:55:51 UTC 2008


Author: berrange

Update of /cvs/pkgs/rpms/kvm/devel
In directory cvs-int.fedora.redhat.com:/tmp/cvs-serv22807

Modified Files:
	.cvsignore kvm.spec sources 
Added Files:
	kvm-68-pty-rawmode.patch 
Log Message:
Update to kvm-68 and put text console PTY in rawmode

kvm-68-pty-rawmode.patch:

--- NEW FILE kvm-68-pty-rawmode.patch ---
diff -rup kvm-68.orig/qemu/vl.c kvm-68.new/qemu/vl.c
--- kvm-68.orig/qemu/vl.c	2008-05-02 07:20:13.000000000 -0400
+++ kvm-68.new/qemu/vl.c	2008-05-05 13:45:59.000000000 -0400
@@ -2301,28 +2301,78 @@ static CharDriverState *qemu_chr_open_st
     return chr;
 }
 
+#ifdef __sun__
+/* Once Solaris has openpty(), this is going to be removed. */
+int openpty(int *amaster, int *aslave, char *name,
+            struct termios *termp, struct winsize *winp)
+{
+        const char *slave;
+        int mfd = -1, sfd = -1;
+
+        *amaster = *aslave = -1;
+
+        mfd = open("/dev/ptmx", O_RDWR | O_NOCTTY);
+        if (mfd < 0)
+                goto err;
+
+        if (grantpt(mfd) == -1 || unlockpt(mfd) == -1)
+                goto err;
+
+        if ((slave = ptsname(mfd)) == NULL)
+                goto err;
+
+        if ((sfd = open(slave, O_RDONLY | O_NOCTTY)) == -1)
+                goto err;
+
+        if (ioctl(sfd, I_PUSH, "ptem") == -1 ||
+            (termp != NULL && tcgetattr(sfd, termp) < 0))
+                goto err;
+
+        if (amaster)
+                *amaster = mfd;
+        if (aslave)
+                *aslave = sfd;
+        if (winp)
+                ioctl(sfd, TIOCSWINSZ, winp);
+
+        return 0;
+
+err:
+        if (sfd != -1)
+                close(sfd);
+        close(mfd);
+        return -1;
+}
+
+void cfmakeraw (struct termios *termios_p)
+{
+        termios_p->c_iflag &=
+                ~(IGNBRK|BRKINT|PARMRK|ISTRIP|INLCR|IGNCR|ICRNL|IXON);
+        termios_p->c_oflag &= ~OPOST;
+        termios_p->c_lflag &= ~(ECHO|ECHONL|ICANON|ISIG|IEXTEN);
+        termios_p->c_cflag &= ~(CSIZE|PARENB);
+        termios_p->c_cflag |= CS8;
+
+        termios_p->c_cc[VMIN] = 0;
+        termios_p->c_cc[VTIME] = 0;
+}
+#endif
+
 #if defined(__linux__) || defined(__sun__)
 static CharDriverState *qemu_chr_open_pty(void)
 {
     struct termios tty;
-    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) {
+    if (openpty(&master_fd, &slave_fd, NULL, NULL, NULL) < 0) {
         return NULL;
     }
-#endif
 
-    /* Disabling local echo and line-buffered output */
-    tcgetattr (master_fd, &tty);
-    tty.c_lflag &= ~(ECHO|ICANON|ISIG);
-    tty.c_cc[VMIN] = 1;
-    tty.c_cc[VTIME] = 0;
-    tcsetattr (master_fd, TCSAFLUSH, &tty);
+    /* Set raw attributes on the pty. */
+    cfmakeraw(&tty);
+    tcsetattr(slave_fd, TCSAFLUSH, &tty);
 
-    fprintf(stderr, "char device redirected to %s\n", slave_name);
+    fprintf(stderr, "char device redirected to %s\n", ptsname(master_fd));
     return qemu_chr_open_fd(master_fd, master_fd);
 }
 


Index: .cvsignore
===================================================================
RCS file: /cvs/pkgs/rpms/kvm/devel/.cvsignore,v
retrieving revision 1.30
retrieving revision 1.31
diff -u -r1.30 -r1.31
--- .cvsignore	8 Apr 2008 19:47:56 -0000	1.30
+++ .cvsignore	5 May 2008 17:55:12 -0000	1.31
@@ -1 +1 @@
-kvm-65.tar.gz
+kvm-68.tar.gz


Index: kvm.spec
===================================================================
RCS file: /cvs/pkgs/rpms/kvm/devel/kvm.spec,v
retrieving revision 1.53
retrieving revision 1.54
diff -u -r1.53 -r1.54
--- kvm.spec	29 Apr 2008 13:38:27 -0000	1.53
+++ kvm.spec	5 May 2008 17:55:12 -0000	1.54
@@ -1,7 +1,7 @@
 Summary: Kernel-based Virtual Machine
 Name: kvm
-Version: 65
-Release: 2%{?dist}
+Version: 68
+Release: 1%{?dist}
 License: GPLv2+ and LGPLv2+
 Group: Development/Tools
 URL: http://%{name}.sf.net
@@ -11,7 +11,7 @@
 Patch1: %{name}-bootmenu.patch
 Patch2: %{name}-62-block-rw-range-check.patch
 Patch3: %{name}-62-e1000-default.patch
-Patch4: %{name}-65-kernel-virtio-boot.patch
+Patch4: %{name}-68-pty-rawmode.patch
 # patches from upstream qemu
 BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n)
 BuildRequires: SDL-devel
@@ -99,6 +99,10 @@
 %{_sysconfdir}/sysconfig/modules/%{name}.modules
 
 %changelog
+* Mon May  5 2008 Daniel P. Berrange <berrange at redhat.com> - 68-1
+- Update to kvm-68
+- Put text console PTY in rawmode
+
 * Tue Apr 29 2008 Mark McLoughlin <markmc at redhat.com> - 65-2
 - Fix -kernel with virtio/extboot drives (#444578)
 


Index: sources
===================================================================
RCS file: /cvs/pkgs/rpms/kvm/devel/sources,v
retrieving revision 1.29
retrieving revision 1.30
diff -u -r1.29 -r1.30
--- sources	8 Apr 2008 19:47:56 -0000	1.29
+++ sources	5 May 2008 17:55:12 -0000	1.30
@@ -1 +1 @@
-4d623ffae0e0cdc52b20640dafce619e  kvm-65.tar.gz
+0e13f2b9e210c90779216e085e1e0a5f  kvm-68.tar.gz




More information about the fedora-extras-commits mailing list