On Wed, 18 Dec 2019 18:20:09 +0100 Philippe Mathieu-Daudé <phi...@redhat.com> wrote:
> 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 following files were manually modified: > > - include/chardev/char-fe.h > - include/chardev/char.h > - include/chardev/char-mux.h > - chardev/char.c > - chardev/char-mux.c > > Signed-off-by: Philippe Mathieu-Daudé <phi...@redhat.com> (...) > diff --git a/hw/char/terminal3270.c b/hw/char/terminal3270.c > index 2aab04fd4b..f7aba12565 100644 > --- a/hw/char/terminal3270.c > +++ b/hw/char/terminal3270.c > @@ -142,7 +142,7 @@ static void terminal_read(void *opaque, const uint8_t > *buf, int size) > } > } > > -static void chr_event(void *opaque, int event) > +static void chr_event(void *opaque, QEMUChrEvent event) > { > Terminal3270 *t = opaque; > CcwDevice *ccw_dev = CCW_DEVICE(t); Acked-by: Cornelia Huck <coh...@redhat.com>