On Sun, Dec 13, 2009 at 8:24 AM, Blue Swirl <blauwir...@gmail.com> wrote:
> I guess e1c09175bc00dd8dfb2ad1b26e1858dcdc109b59 or
> 998bbd74b9d813b14a3a3b5009a5d5a48c7dce51 broke -serial stdio for all
> targets:
> qemu -serial stdio -monitor stdio
> chardev: opening backend "stdio" failed
> qemu: could not open serial device 'stdio': No such file or directory
>

e1c09175bc00dd8dfb2ad1b26e1858dcdc109b59 is first bad commit
commit e1c09175bc00dd8dfb2ad1b26e1858dcdc109b59
Author: Gerd Hoffmann <kra...@redhat.com>
Date:   Tue Dec 8 13:11:44 2009 +0100

    zap serial_monitor_mux

    The logic in this code obviously predates the multiple monitor
    capability of qemu and looks increasingly silly these days.

    I think the intention of this piece of code is to get a reasonable
    default for the -nographic case: have monitor and serial line muxed
    on stdio.

    With the new default_serial and default_monitor variables we have now
    doing just that became much easier ;)

    Signed-off-by: Gerd Hoffmann <kra...@redhat.com>
    Signed-off-by: Anthony Liguori <aligu...@us.ibm.com>

:100644 100644 0d3f5e6687934a94e8586a13b2f5b7432065c430
e3e035f45349c8a2a86317dc46575c899acc8321 M      vl.c

git revert e1c09175bc00dd8dfb2ad1b26e1858dcdc109b59
Auto-merged vl.c
CONFLICT (content): Merge conflict in vl.c
Automatic revert failed.  After resolving the conflicts,
mark the corrected paths with 'git add <paths>' or 'git rm <paths>'
and commit the result.

My attempt to merge (attached) does not compile:
/src/qemu/vl.c: In function 'serial_monitor_mux':
/src/qemu/vl.c:4795: error: 'DEV_MONITOR' undeclared (first use in
this function)
/src/qemu/vl.c:4795: error: (Each undeclared identifier is reported only once
/src/qemu/vl.c:4795: error: for each function it appears in.)

Please fix ASAP, this happens to break my test setup completely.
From 6cd63368ca954d4a87de0e8bade735e631a546c6 Mon Sep 17 00:00:00 2001
From: Blue Swirl <blauwirbel@gmail.com>
Date: Sun, 13 Dec 2009 09:32:18 +0000
Subject: [PATCH] Revert "zap serial_monitor_mux"

This reverts commit e1c09175bc00dd8dfb2ad1b26e1858dcdc109b59. It broke
-serial stdio -monitor stdio case.

Conflicts:

	vl.c
---
 vl.c |   36 ++++++++++++++++++++++++++++++++++--
 1 files changed, 34 insertions(+), 2 deletions(-)

diff --git a/vl.c b/vl.c
index c0d98f5..b3a2388 100644
--- a/vl.c
+++ b/vl.c
@@ -4786,6 +4786,33 @@ static int foreach_device_config(int type, int (*func)(const char *cmdline))
     return 0;
 }
 
+static void serial_monitor_mux(void)
+{
+    struct device_config *mon0, *serial;
+    const char *devname;
+
+    QTAILQ_FOREACH(mon0, &device_configs, next) {
+        if (mon0->type != DEV_MONITOR)
+            continue;
+        if (strcmp(mon0->cmdline,"stdio") != 0)
+            return;
+        break;
+    }
+    QTAILQ_FOREACH(serial, &device_configs, next) {
+        if (serial->type != DEV_SERIAL)
+            continue;
+        devname = serial->cmdline;
+        if (devname && !strcmp(devname,"mon:stdio")) {
+            QTAILQ_REMOVE(&device_configs, mon0, next);
+            break;
+        } else if (devname && !strcmp(devname,"stdio")) {
+            QTAILQ_REMOVE(&device_configs, mon0, next);
+            serial->cmdline = "mon:stdio";
+            break;
+        }
+    }
+}
+
 static int serial_parse(const char *devname)
 {
     static int index = 0;
@@ -5691,10 +5718,12 @@ int main(int argc, char **argv, char **envp)
     }
 
     if (display_type == DT_NOGRAPHIC) {
+        if (default_serial)
+            add_device_config(DEV_SERIAL, "stdio");
         if (default_parallel)
             add_device_config(DEV_PARALLEL, "null");
-        if (default_serial && default_monitor) {
-            add_device_config(DEV_SERIAL, "mon:stdio");
+        if (default_monitor)
+            add_device_config(DEV_MONITOR, "stdio");
         } else if (default_virtcon && default_monitor) {
             add_device_config(DEV_VIRTCON, "mon:stdio");
         } else {
@@ -5866,6 +5895,9 @@ int main(int argc, char **argv, char **envp)
     register_savevm_live("ram", 0, 3, NULL, ram_save_live, NULL, 
                          ram_load, NULL);
 
+    /* Maintain compatibility with multiple stdio monitors */
+    serial_monitor_mux();
+
     if (nb_numa_nodes > 0) {
         int i;
 
-- 
1.5.6.5

Reply via email to