qemu-arm
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Qemu-arm] [PATCH 0/5] Global fix / workaround usage of qemu_chr_fe_writ


From: Daniel P. Berrange
Subject: [Qemu-arm] [PATCH 0/5] Global fix / workaround usage of qemu_chr_fe_write
Date: Wed, 3 Aug 2016 17:22:35 +0100

This series does a global fix and/or workaround for bad usage of
qemu_chr_fe_write(). Essentially only about 4/5 places in the code
got the usage correct, by handling errors. Everything else would
silently loose data if used with a chardev backend that can return
EAGAIN. One specific instance of that bug was highlighted when I
fixed the socket backend, such that in connect mode, it would be
non-blocking. https://bugs.launchpad.net/qemu/+bug/1586756

The "correct" fix is to check for short writes, or EAGAIN and
then schedule an event callback to re-try the write later. A
couple of places do that correctly (for example hw/char/serial.c
and hw/char/virtioconsole.c).  Changing existing serial port
impls todo this though is a fair amount of amount, so as a
temporary fix, this series changes all the broken code to simply
use qemu_chr_fe_write_all() instead. Thus we at least stop
silently loosing data, albeit at the cost of blocking the guest
execution while we wait. So we still need to do a proper fix
in all these devices models at some point, hence I've left
comments in the code as a reminder.

This series also includes a patch to virtio-console I sent
previously, but with a fixed commit message that more accurately
describes what is going on.

Daniel P. Berrange (5):
  virtio-console: set frontend open permanently for console devs
  impi: check return of qemu_chr_fe_write() for errors
  sclpconsole: remove bogus check for -EAGAIN
  hw: replace most use of qemu_chr_fe_write with qemu_chr_fe_write_all
  char: convert qemu_chr_fe_write to qemu_chr_fe_write_all

 backends/rng-egd.c          |  4 +++-
 gdbstub.c                   |  4 +++-
 hw/arm/omap2.c              |  8 +++++---
 hw/arm/pxa2xx.c             |  4 +++-
 hw/arm/strongarm.c          |  4 +++-
 hw/char/bcm2835_aux.c       |  4 +++-
 hw/char/debugcon.c          |  4 +++-
 hw/char/digic-uart.c        |  2 ++
 hw/char/escc.c              |  4 +++-
 hw/char/etraxfs_ser.c       |  4 +++-
 hw/char/exynos4210_uart.c   |  4 +++-
 hw/char/grlib_apbuart.c     |  4 +++-
 hw/char/imx_serial.c        |  4 +++-
 hw/char/ipoctal232.c        |  4 +++-
 hw/char/lm32_juart.c        |  2 ++
 hw/char/lm32_uart.c         |  2 ++
 hw/char/mcf_uart.c          |  4 +++-
 hw/char/parallel.c          |  4 +++-
 hw/char/pl011.c             |  4 +++-
 hw/char/sclpconsole-lm.c    | 22 ++++++----------------
 hw/char/sclpconsole.c       |  2 ++
 hw/char/sh_serial.c         |  4 +++-
 hw/char/spapr_vty.c         |  5 +++--
 hw/char/stm32f2xx_usart.c   |  2 ++
 hw/char/virtio-console.c    | 46 +++++++++++++++++++++++++++++++++++++++++----
 hw/char/xilinx_uartlite.c   |  4 +++-
 hw/ipmi/ipmi_bmc_extern.c   |  8 ++++++--
 hw/usb/ccid-card-passthru.c |  7 +++++--
 hw/usb/dev-serial.c         |  4 +++-
 qemu-char.c                 | 18 ++++++++++++------
 slirp/slirp.c               |  4 +++-
 31 files changed, 146 insertions(+), 54 deletions(-)

-- 
2.7.4




reply via email to

[Prev in Thread] Current Thread [Next in Thread]