summaryrefslogtreecommitdiffstats
path: root/hw/char/grlib_apbuart.c
diff options
context:
space:
mode:
authorAnton Nefedov2017-07-06 14:08:52 +0200
committerPaolo Bonzini2017-07-14 11:04:33 +0200
commit3065070153ef4235659d821c0d6fa28fd0630c57 (patch)
treefa9b9f1378874f727da8faa466946b6ca5d38f23 /hw/char/grlib_apbuart.c
parentchar: forbid direct chardevice access for hotswap devices (diff)
downloadqemu-3065070153ef4235659d821c0d6fa28fd0630c57.tar.gz
qemu-3065070153ef4235659d821c0d6fa28fd0630c57.tar.xz
qemu-3065070153ef4235659d821c0d6fa28fd0630c57.zip
char: avoid chardevice direct access
frontends should avoid accessing CharDriver struct where possible Signed-off-by: Anton Nefedov <anton.nefedov@virtuozzo.com> Reviewed-by: Vladimir Sementsov-Ogievskiy <vsementsov@virtuozzo.com> Reviewed-by: Marc-André Lureau <marcandre.lureau@redhat.com> Message-Id: <1499342940-56739-6-git-send-email-anton.nefedov@virtuozzo.com> Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
Diffstat (limited to 'hw/char/grlib_apbuart.c')
-rw-r--r--hw/char/grlib_apbuart.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/hw/char/grlib_apbuart.c b/hw/char/grlib_apbuart.c
index 12d0c99b31..bac11bec58 100644
--- a/hw/char/grlib_apbuart.c
+++ b/hw/char/grlib_apbuart.c
@@ -201,7 +201,7 @@ static void grlib_apbuart_write(void *opaque, hwaddr addr,
case DATA_OFFSET:
case DATA_OFFSET + 3: /* When only one byte write */
/* Transmit when character device available and transmitter enabled */
- if (qemu_chr_fe_get_driver(&uart->chr) &&
+ if (qemu_chr_fe_backend_connected(&uart->chr) &&
(uart->control & UART_TRANSMIT_ENABLE)) {
c = value & 0xFF;
/* XXX this blocks entire thread. Rewrite to use