rpms/qemu/devel qemu-0.9.1-pty-rawmode.patch, NONE, 1.1 qemu.spec, 1.36, 1.37
Daniel P. Berrange (berrange)
fedora-extras-commits at redhat.com
Mon May 5 17:53:04 UTC 2008
- Previous message (by thread): rpms/xsettings-kde/F-8 xsettings-kde.spec,1.1,1.2
- Next message (by thread): 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
- Messages sorted by:
[ date ]
[ thread ]
[ subject ]
[ author ]
Author: berrange
Update of /cvs/extras/rpms/qemu/devel
In directory cvs-int.fedora.redhat.com:/tmp/cvs-serv22639
Modified Files:
qemu.spec
Added Files:
qemu-0.9.1-pty-rawmode.patch
Log Message:
Fix text console PTYs to be in rawmode
qemu-0.9.1-pty-rawmode.patch:
--- NEW FILE qemu-0.9.1-pty-rawmode.patch ---
diff -rup qemu-0.9.1.orig/vl.c qemu-0.9.1.new/vl.c
--- qemu-0.9.1.orig/vl.c 2008-05-05 13:32:55.000000000 -0400
+++ qemu-0.9.1.new/vl.c 2008-05-05 13:33:17.000000000 -0400
@@ -2200,28 +2200,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: qemu.spec
===================================================================
RCS file: /cvs/extras/rpms/qemu/devel/qemu.spec,v
retrieving revision 1.36
retrieving revision 1.37
diff -u -r1.36 -r1.37
--- qemu.spec 27 Apr 2008 09:20:07 -0000 1.36
+++ qemu.spec 5 May 2008 17:52:21 -0000 1.37
@@ -8,7 +8,7 @@
Summary: QEMU is a FAST! processor emulator
Name: qemu
Version: 0.9.1
-Release: 6%{?dist}
+Release: 7%{?dist}
License: GPLv2+ and LGPLv2+
Group: Development/Tools
URL: http://www.qemu.org/
@@ -18,6 +18,8 @@
# Change default NIC to rtl8139 to get link-state detection
Patch3: qemu-0.9.1-nic-defaults.patch
Patch4: qemu-%{version}-block-rw-range-check.patch
+# Upstream SVN changeset #4338
+Patch5: qemu-%{version}-pty-rawmode.patch
BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n)
BuildRequires: SDL-devel compat-gcc-%{gccver} zlib-devel which texi2html gnutls-devel
Requires(post): /sbin/chkconfig
@@ -54,6 +56,7 @@
%patch0 -p1
%patch3 -p1
%patch4 -p1
+%patch5 -p1
%build
./configure \
@@ -125,6 +128,9 @@
%{_mandir}/man1/qemu-img.1*
%changelog
+* Mon May 5 2008 Daniel P. Berrange <berrange at redhat.com> - 0.9.1-7.fc10
+- Fix text console PTYs to be in rawmode
+
* Sun Apr 27 2008 Lubomir Kundrak <lkundrak at redhat.com> - 0.9.1-6
- Register binary handler for SuperH-4 CPU
- Previous message (by thread): rpms/xsettings-kde/F-8 xsettings-kde.spec,1.1,1.2
- Next message (by thread): 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
- Messages sorted by:
[ date ]
[ thread ]
[ subject ]
[ author ]
More information about the fedora-extras-commits
mailing list