summary refs log tree commit diff stats
path: root/hw/serial.c
diff options
context:
space:
mode:
Diffstat (limited to 'hw/serial.c')
-rw-r--r--hw/serial.c7
1 files changed, 6 insertions, 1 deletions
diff --git a/hw/serial.c b/hw/serial.c
index 6f7b30e48a..1f4ce77191 100644
--- a/hw/serial.c
+++ b/hw/serial.c
@@ -712,9 +712,14 @@ static void serial_reset(void *opaque)
 static void serial_init_core(SerialState *s, qemu_irq irq, int baudbase,
 			     CharDriverState *chr)
 {
+    if (!chr) {
+        fprintf(stderr, "Can't create serial device, empty char device\n");
+	exit(1);
+    }
+
     s->irq = irq;
     s->baudbase = baudbase;
-    s->chr = chr ?: qemu_chr_open("null", "null", NULL);
+    s->chr = chr;
 
     s->modem_status_poll = qemu_new_timer(vm_clock, (QEMUTimerCB *) serial_update_msl, s);