[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Qemu-devel] [PATCH for-2.12] chardev/char-fe: Allow NULL chardev in
From: |
Thomas Huth |
Subject: |
Re: [Qemu-devel] [PATCH for-2.12] chardev/char-fe: Allow NULL chardev in qemu_chr_fe_init() |
Date: |
Fri, 23 Mar 2018 17:07:13 +0100 |
User-agent: |
Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.6.0 |
On 23.03.2018 16:29, Peter Maydell wrote:
> All the functions in char-fe.c handle the CharBackend
> having a NULL Chardev pointer, which means that the
> backend exists but is not connected to anything. The
> exception is qemu_chr_fe_init(), which will crash if
> passed a NULL Chardev pointer argument. This can happen
> for various boards if they're started with 'nodefaults':
> arm-softmmu/qemu-system-arm -S -nodefaults -M cubieboard
> riscv32-softmmu/qemu-system-riscv32 -nodefaults -M sifive_e
>
> Make qemu_chr_fe_init() accept a NULL chardev. This allows
> UART models to handle NULL chardev properties without
> generally needing to special case them or to manually
> create a NullChardev.
>
> Reported-by: Thomas Huth <address@hidden>
> Signed-off-by: Peter Maydell <address@hidden>
> ---
> This is my proposal for fixing the crashes with -nodefaults.
> I think we should also change hw/char/serial.c to accept
> a NULL Chardev rather than treating it as an error
> ( "Can't create serial device, empty char device"), and
> similarly for any other devices that currently error out
> on NULL chardevs. I'd rather postpone that part til 2.13, though.
Sounds like a good plan.
Reviewed-by: Thomas Huth <address@hidden>