* [PATCH 11 of 13] serial: open a null device if the CharDriverState argument is null
@ 2009-03-02 17:22 Stefano Stabellini
0 siblings, 0 replies; only message in thread
From: Stefano Stabellini @ 2009-03-02 17:22 UTC (permalink / raw)
To: xen-devel
Import "serial: open a null device if the CharDriverState argument is
null" from qemu mainstream.
git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@6366 c046a42c-6fe2-441c-8c8c-71466251a162
Signed-off-by: Stefano Stabellini <stefano.stabellini@eu.citrix.com>
---
diff -r 183c9b430c7e hw/serial.c
--- a/hw/serial.c Mon Feb 16 11:19:23 2009 +0000
+++ b/hw/serial.c Mon Feb 16 11:20:28 2009 +0000
@@ -712,7 +712,7 @@
{
s->irq = irq;
s->baudbase = baudbase;
- s->chr = chr;
+ s->chr = chr ?: qemu_chr_open("null", "null", NULL);
s->modem_status_poll = qemu_new_timer(vm_clock, (QEMUTimerCB *) serial_update_msl, s);
@@ -722,6 +722,8 @@
qemu_register_reset(serial_reset, s);
serial_reset(s);
+ qemu_chr_add_handlers(s->chr, serial_can_receive1, serial_receive1,
+ serial_event, s);
}
/* If fd is zero, it means that the serial device uses the console */
@@ -740,8 +742,6 @@
register_ioport_write(base, 8, 1, serial_ioport_write, s);
register_ioport_read(base, 8, 1, serial_ioport_read, s);
- qemu_chr_add_handlers(chr, serial_can_receive1, serial_receive1,
- serial_event, s);
return s;
}
@@ -839,8 +839,6 @@
serial_mm_write, s);
cpu_register_physical_memory(base, 8 << it_shift, s_io_memory);
}
- qemu_chr_add_handlers(chr, serial_can_receive1, serial_receive1,
- serial_event, s);
serial_update_msl(s);
return s;
}
^ permalink raw reply [flat|nested] only message in thread
only message in thread, other threads:[~2009-03-02 17:22 UTC | newest]
Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2009-03-02 17:22 [PATCH 11 of 13] serial: open a null device if the CharDriverState argument is null Stefano Stabellini
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.