mirror of
https://github.com/Motorhead1991/qemu.git
synced 2025-08-11 03:24:58 -06:00
hw/serial: don't create a char device if none is specified
When creating null devices, there is no way to ensure the unicity of the labels. Bail out with an error message instead. Signed-off-by: Aurelien Jarno <aurelien@aurel32.net>
This commit is contained in:
parent
e09fdfaf32
commit
387f4a5a71
1 changed files with 6 additions and 1 deletions
|
@ -712,9 +712,14 @@ static void serial_reset(void *opaque)
|
||||||
static void serial_init_core(SerialState *s, qemu_irq irq, int baudbase,
|
static void serial_init_core(SerialState *s, qemu_irq irq, int baudbase,
|
||||||
CharDriverState *chr)
|
CharDriverState *chr)
|
||||||
{
|
{
|
||||||
|
if (!chr) {
|
||||||
|
fprintf(stderr, "Can't create serial device, empty char device\n");
|
||||||
|
exit(1);
|
||||||
|
}
|
||||||
|
|
||||||
s->irq = irq;
|
s->irq = irq;
|
||||||
s->baudbase = baudbase;
|
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);
|
s->modem_status_poll = qemu_new_timer(vm_clock, (QEMUTimerCB *) serial_update_msl, s);
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue