Skip to contentSkip to conversation

make stdio monitor default

Qemu-devel Jim C. Brown 2 participants 3 messages Mar 19, 2005 – Mar 20, 2005

lore
Share & tools
lore
#0 lore raw

For all users of qemu, with the exception of those who use Windows as the host OS, it is better to make the monitor stdio by default. It is easier to debug bugs in qemu when the monitor and the guest screen can be seen at the same time, having qemu load the monitor in the terminal where qemu is started makes it easy to find and figure out how to use (a lot of new users seem to not know about the monitor until told so), logging of monitor output (state of qemu guest registers, network status, etc) is a lot easier, etc.

The only reason that qemu has the vc monitor as the default is because on Windows, qemu either has to be a console app (and thus has very slow output) or else has to specifically request a console to be used to route stdio to (involving Windows specific code). Even if this was done, a second console window tends to be very confusing for new users, so it may do more harm than good.

I agree that vc should be the default for Windows, but that for Linux (and Unix) having stdio default would be better. (This is of course a policy decision, not a coding or feature one, as both stdio and vc can be used in either Linux or Windows host). It would be nice to get other opinions on this.

The only objection I see to this would be that making vc default only for Windows would give qemu the impression of having different interfaces for different host OSes. I am not sure how this could be dealt with, but I am thinking about it.

I have attached a very short patch that makes stdio monitor the default except when qemu is compiled on windows (then the vc monitor (the ctrl-alt-2 version)) is the default.

Signature · 2 lines
Infinite complexity begets infinite beauty.
Infinite precision begets infinite perfection.
vl.c renamed from vl.c.old +4 -0
@@ -3031,7 +3031,11 @@
     has_cdrom = 1;
     cyls = heads = secs = 0;
     translation = BIOS_ATA_TRANSLATION_AUTO;
+#ifndef _WIN32
     pstrcpy(monitor_device, sizeof(monitor_device), "vc");
+#else
+    pstrcpy(monitor_device, sizeof(monitor_device), "stdio");
+#endif
 
     pstrcpy(serial_devices[0], sizeof(serial_devices[0]), "vc");
     for(i = 1; i < MAX_SERIAL_PORTS; i++)
#1 lore raw
Quoted 5 lines

I agree that vc should be the default for Windows, but that for Linux (and Unix) having stdio default would be better. (This is of course a policy decision, not a coding or feature one, as both stdio and vc can be used in either Linux or Windows host). It would be nice to get other opinions on this.

I agree, although I think the proper fix is to move the logic into the configure script and make it a configure time option.
ie ./configure --enable-monitor=foo would set the default.

Quoted 4 lines
vl.c Fri Mar 18 23:02:03 2005 renamed from vl.c.old Fri Mar 18 23:01:24 2005 +0 -0
@@ -3031,7 +3031,11 @@
     has_cdrom = 1;

vl.c Fri Mar 18 23:02:03 2005 line 3041

Quoted 10 lines
vl.c Fri Mar 18 23:02:03 2005 renamed from vl.c.old Fri Mar 18 23:01:24 2005 +4 -0
     cyls = heads = secs = 0;
     translation = BIOS_ATA_TRANSLATION_AUTO;
+#ifndef _WIN32
     pstrcpy(monitor_device, sizeof(monitor_device), "vc");
+#else
+    pstrcpy(monitor_device, sizeof(monitor_device), "stdio");
+#endif
 
     pstrcpy(serial_devices[0], sizeof(serial_devices[0]), "vc");
     for(i = 1; i < MAX_SERIAL_PORTS; i++)

Have you tested this patch? It looks like it does the opposite of what you are suggesting.

Paul

#2 lore raw
Quoted 6 lines · Paul Brook

Have you tested this patch? It looks like it does the opposite of what you are suggesting.

Paul

Whoops I sent the wrong one. Here is the right version:

vl.c Fri Mar 18 23:02:03 2005 renamed from vl.c.old Fri Mar 18 23:01:24 2005 +4 -0
@@ -3031,7 +3031,11 @@
     has_cdrom = 1;
     cyls = heads = secs = 0;
     translation = BIOS_ATA_TRANSLATION_AUTO;
+#ifdef _WIN32
     pstrcpy(monitor_device, sizeof(monitor_device), "vc");
+#else
+    pstrcpy(monitor_device, sizeof(monitor_device), "stdio");
+#endif
 
     pstrcpy(serial_devices[0], sizeof(serial_devices[0]), "vc");
     for(i = 1; i < MAX_SERIAL_PORTS; i++)
Quoted 3 lines

I agree, although I think the proper fix is to move the logic into the configure script and make it a configure time option.
ie ./configure --enable-monitor=foo would set the default.

Interesting idea. I'll see if I can set this up and send a diff.

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