]> git.proxmox.com Git - mirror_qemu.git/commit - chardev/char-mux.c
chardev: Use QEMUChrEvent enum in IOEventHandler typedef
authorPhilippe Mathieu-Daudé <philmd@redhat.com>
Wed, 18 Dec 2019 17:20:09 +0000 (18:20 +0100)
committerPaolo Bonzini <pbonzini@redhat.com>
Wed, 8 Jan 2020 10:15:35 +0000 (11:15 +0100)
commit083b266f69f36195aef22cb224f86b99ca0d6feb
tree03ca4c942976a8eddf418f6e3703c198af1db000
parent2fa9044a4fe8c6c9c215785d1abce4db6063a6f9
chardev: Use QEMUChrEvent enum in IOEventHandler typedef

The Chardev events are listed in the QEMUChrEvent enum.

By using the enum in the IOEventHandler typedef we:

- make the IOEventHandler type more explicit (this handler
  process out-of-band information, while the IOReadHandler
  is in-band),
- help static code analyzers.

This patch was produced with the following spatch script:

  @match@
  expression backend, opaque, context, set_open;
  identifier fd_can_read, fd_read, fd_event, be_change;
  @@
  qemu_chr_fe_set_handlers(backend, fd_can_read, fd_read, fd_event,
                           be_change, opaque, context, set_open);

  @depends on match@
  identifier opaque, event;
  identifier match.fd_event;
  @@
   static
  -void fd_event(void *opaque, int event)
  +void fd_event(void *opaque, QEMUChrEvent event)
   {
   ...
   }

Then the typedef was modified manually in
include/chardev/char-fe.h.

Signed-off-by: Philippe Mathieu-Daudé <philmd@redhat.com>
Acked-by: Corey Minyard <cminyard@mvista.com>
Acked-by: Cornelia Huck <cohuck@redhat.com>
Reviewed-by: Marc-André Lureau <marcandre.lureau@redhat.com>
Message-Id: <20191218172009.8868-15-philmd@redhat.com>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
41 files changed:
backends/cryptodev-vhost-user.c
chardev/char-mux.c
gdbstub.c
hw/arm/pxa2xx.c
hw/arm/strongarm.c
hw/block/vhost-user-blk.c
hw/char/cadence_uart.c
hw/char/digic-uart.c
hw/char/escc.c
hw/char/etraxfs_ser.c
hw/char/exynos4210_uart.c
hw/char/grlib_apbuart.c
hw/char/imx_serial.c
hw/char/ipoctal232.c
hw/char/lm32_juart.c
hw/char/lm32_uart.c
hw/char/mcf_uart.c
hw/char/milkymist-uart.c
hw/char/nrf51_uart.c
hw/char/pl011.c
hw/char/serial.c
hw/char/sh_serial.c
hw/char/terminal3270.c
hw/char/virtio-console.c
hw/char/xilinx_uartlite.c
hw/ipmi/ipmi_bmc_extern.c
hw/mips/boston.c
hw/mips/mips_malta.c
hw/riscv/riscv_htif.c
hw/riscv/sifive_uart.c
hw/usb/ccid-card-passthru.c
hw/usb/dev-serial.c
hw/usb/redirect.c
include/chardev/char-fe.h
monitor/hmp.c
monitor/qmp.c
net/filter-mirror.c
net/vhost-user.c
qtest.c
tests/test-char.c
tests/vhost-user-test.c