virtio-console: Fix pthread_cond initialization race

When characters are input on the console before virtio_console is
initialized, the term.c poll thread will get stuck in
virtio_console__inject_interrupt, because it ends up doing
pthread_cond_wait on the uninitialized poll_cond, which will hang
indefinitely. As a result it becomes impossible to input characters into
the guest, even when using serial instead of virtio console.

Initialize poll_cond statically to prevent this race.

Signed-off-by: Jean-Philippe Brucker <jean-philippe.brucker@arm.com>
Signed-off-by: Will Deacon <will.deacon@arm.com>
1 file changed