summaryrefslogtreecommitdiff
path: root/vl.c
diff options
context:
space:
mode:
authorAurelien Jarno <aurelien@aurel32.net>2009-09-14 19:30:16 +0200
committerAurelien Jarno <aurelien@aurel32.net>2009-09-14 19:34:12 +0200
commit55338f1dd4648d78ee130d83a92f1059ff1f3887 (patch)
tree65ad20dee7b0bec5cd066041810c626b514a6e0a /vl.c
parent7b270ef2a3f1429b3a97aab4f5a3332da61591b9 (diff)
downloadqemu-55338f1dd4648d78ee130d83a92f1059ff1f3887.tar.gz
Open chr device for all serial ports
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 <aurelien@aurel32.net>
Diffstat (limited to 'vl.c')
-rw-r--r--vl.c16
1 files changed, 9 insertions, 7 deletions
diff --git a/vl.c b/vl.c
index 0e6133316a..e877a3cdbd 100644
--- 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);
}
}