Skip to contentSkip to conversation

niggles

Qemu-devel Bob Barry 3 participants 6 messages Jun 21, 2004 – Jun 27, 2004 Kbuild

lore
Share & tools
lore

Bob Barry

author
#0 lore raw

I'm generally amazed and impressed by qemu, but I've noticed a couple of user-unfriendly quirks which should be eliminated:

1 - If I su to root and invoke qemu without remembering to "xhost +" first,
the screen goes black, the keyboard is completely unresponsive, and I cannot go to a terminal session or kill the X-server. Attached patch vi.c.ckXauth.diff causes quemu to show error and exit gracefully instead of locking the machine.

2 - After using qemu and exiting normally, if I try "su", I get:
asterix:msdos> su - toor
Password:

su: Authentication failure
Sorry.
I ran "env > ~/env_before_qemu" before running a qemu session, and "env > ~/env_after_qemu" after exiting the session, and found the before and after files identical. The host is Gentoo Linux, kernel 2.6.7. Can someone suggest how to find (and restore) what's been changed?

Thanks,

Bob Barry

vl.c renamed from usr/portage/distfiles/cvs-src/qemu/vl.c +11 -0
@@ -38,6 +38,8 @@
 #include <sys/mman.h>
 #include <sys/ioctl.h>
 #include <sys/socket.h>
+#include <X11/Xlib.h>
+#include <X11/Xlibint.h>
 #ifdef _BSD
 #include <sys/stat.h>
 #include <libutil.h>
@@ -2654,6 +2656,15 @@
     if (nographic) {
         dumb_display_init(ds);
     } else {
+        Display *dpy;
+	dpy = XOpenDisplay(NULL);
+	if (!dpy) {
+            fprintf (stderr, "%s:  unable to open display \"%s\".\n",
+            argv[0], XDisplayName(NULL));
+            exit (1);
+        } else {
+            XCloseDisplay(dpy);
+        }
 #ifdef CONFIG_SDL
         sdl_display_init(ds);
 #else
#1 lore raw

[Qemu-devel] Re: qemu - patch to restore tty flags

Patch added to web page. Please update me for any changes..

Thanks,
Hetz

Quoted 21 lines · Bob Barry

Hetz -

The following patch restores the tty flags so that "su" works normally after a qemu session. The patch is against 20040624 CVS. It works on Gentoo x86 Linux, kernel 2.6.7; I can't test other architectures.

Thanks,

Bob Barry

Patch "patch-qemu-restore-tty" restores the tty flags so that "su" works normally after a qemu session.

The patch is against 20040624 CVS.

My setup is Gentoo x86 Linux, kernel 2.6.7 - I can't check other distributions or architectures.

Bob Barry <[email protected]>

#2 lore raw

Re: [Qemu-devel] qemu - patch to check X authorization

In reply to Bob Barry
Quoted 12 lines · Bob Barry

Hetz -

The following has been submitted twice before, but seems to have passed unnoticed:

If I "su" to root and invoke qemu without remembering to "xhost +" first, the screen goes black, the keyboard is completely unresponsive, and
I cannot go to a terminal session or kill the X-server. The following patch causes qemu to display an error message and exit gracefully instead of locking the machine. The patch is against 20040625 CVS. It works on Gentoo x86 Linux, kernel 2.6.7; I can't test other distributions or architectures.

Quoted 4 lines

Thanks,

Bob Barry

That doesn't happen to me. When I try that, I get a few messages from Xlib saying that it can't open the X server and then a message from SDL saying that its quitting. I don't have the problem that you do.

Your patch requires that the user must have X and assumes that SDL uses X/Xv.

Signature · 2 lines
Infinite complexity begets infinite beauty.
Infinite precision begets infinite perfection.
author
#3 lore raw

Re: [Qemu-devel] qemu - patch to check X authorization

Jim -

Quoted 3 lines · you

That doesn't happen to me. When I try that, I get a few messages from Xlib saying that it can't open the X server and then a message from SDL saying that its quitting.

That is the way it should work. Mine didn't. The patch makes mine behave like yours.

Quoted 1 line

I don't have the problem that you do.

Then your SDL must be different from mine. Qemu should not lock any system, so the patch is beneficial for systems like mine, and there are probably a lot of them. My SDL is libsdl-1.2.7 with a few Gentoo patches. Even if the SDL source is patched to act like yours (and it should be), there will still be a lot of qemu users with old SDL who should be accomodated.

Quoted 1 line

Your patch requires that the user must have X and assumes that SDL uses X/Xv.

If there are systems without X which can run qemu with SDL, then the patch code should be excluded from them with "#ifdef". Are there such systems?

Thanks,

Bob Barry

#4 lore raw

Re: [Qemu-devel] qemu - patch to check X authorization

Quoted 8 lines · Bob Barry

Jim -

Quoted 3 lines · you

That doesn't happen to me. When I try that, I get a few messages from Xlib saying that it can't open the X server and then a message from SDL saying that its quitting.

That is the way it should work. Mine didn't. The patch makes mine behave like yours.

As you say below, it's an SDL bug and should be fixed.

Quoted 7 lines
Quoted 2 lines

I don't have the problem that you do.

Then your SDL must be different from mine. Qemu should not lock any system, so the patch is beneficial for systems like mine, and there are probably a lot of them. My SDL is libsdl-1.2.7 with a few Gentoo patches. Even if the SDL source is patched to act like yours (and it should be), there will still be a lot of qemu users with old SDL who should be accomodated.

I have libsdl-1.2.2 .... the bug was clearly introduced in a later version. Of course, we could have the configure script detect the SDL version, and if that version is known to have this bug (and we are on an applicable platform) then it could turn on the #DEFINE that would compile the patch. (I think this was already suggested, in fact... can't remember.)

Quoted 4 lines
Quoted 2 lines

Your patch requires that the user must have X and assumes that SDL uses X/Xv.

If there are systems without X which can run qemu with SDL, then the patch code should be excluded from them with "#ifdef". Are there such systems?

I know of only one - the windows port of qemu. You're right here though, a few simple #ifdef's or #ifndef's would do the trick.

Of course, it could be trickier if someone decided to let qemu use the framebuffer or the SVGAlib interface on Linux... (SDL supports this but apparently qemu does not atm).

Quoted 10 lines

Thanks,

Bob Barry

_______________________________________________
Qemu-devel mailing list
[email protected]
http://lists.nongnu.org/mailman/listinfo/qemu-devel

Signature · 2 lines
Infinite complexity begets infinite beauty.
Infinite precision begets infinite perfection.
#5 lore raw

Re: [Qemu-devel] qemu - patch to restore tty flags

In reply to Bob Barry
Quoted 10 lines · Bob Barry

Hetz -

The following patch restores the tty flags so that "su" works normally after a qemu session. The patch is against 20040624 CVS. It works on Gentoo x86 Linux, kernel 2.6.7; I can't test other architectures.

Thanks,

Bob Barry

I don't see this problem. I can su fine after running qemu. I'm running kernel 2.4.26 and glibc 2.3.2 tho.

Signature · 2 lines
Infinite complexity begets infinite beauty.
Infinite precision begets infinite perfection.