]> Git Repo - qemu.git/commitdiff
Open chr device for all serial ports
authorAurelien Jarno <[email protected]>
Mon, 14 Sep 2009 17:30:16 +0000 (19:30 +0200)
committerAurelien Jarno <[email protected]>
Mon, 14 Sep 2009 17:34:12 +0000 (19:34 +0200)
Now that labels must be unique, the chr devices can't be opened anymore
within the serial port code (in case they are not already opened in
vl.c), as they end up with the same label. Instead opened so
non-assigned one directly in vl.c, with a different label.

This make MIPS Malta board emulation working again.

Signed-off-by: Aurelien Jarno <[email protected]>
vl.c

diff --git a/vl.c b/vl.c
index 0e6133316aa8d6e3d06307abaf464738c30f970a..e877a3cdbdefeb4070bb95b083baa5fe072c6ccb 100644 (file)
--- a/vl.c
+++ b/vl.c
@@ -5688,15 +5688,17 @@ int main(int argc, char **argv, char **envp)
 
     for(i = 0; i < MAX_SERIAL_PORTS; i++) {
         const char *devname = serial_devices[i];
+        char label[32];
+        snprintf(label, sizeof(label), "serial%d", i);
         if (devname && strcmp(devname, "none")) {
-            char label[32];
-            snprintf(label, sizeof(label), "serial%d", i);
             serial_hds[i] = qemu_chr_open(label, devname, NULL);
-            if (!serial_hds[i]) {
-                fprintf(stderr, "qemu: could not open serial device '%s'\n",
-                        devname);
-                exit(1);
-            }
+        } else {
+            serial_hds[i] = qemu_chr_open(label, "null", NULL);
+        }
+        if (!serial_hds[i]) {
+            fprintf(stderr, "qemu: could not open serial device '%s'\n",
+                    devname);
+            exit(1);
         }
     }
 
This page took 0.040228 seconds and 4 git commands to generate.