mirror of
https://github.com/Motorhead1991/qemu.git
synced 2025-08-02 23:33:54 -06:00
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>
This commit is contained in:
parent
2fa9044a4f
commit
083b266f69
41 changed files with 44 additions and 44 deletions
|
@ -218,7 +218,7 @@ static gboolean net_vhost_user_watch(GIOChannel *chan, GIOCondition cond,
|
|||
return TRUE;
|
||||
}
|
||||
|
||||
static void net_vhost_user_event(void *opaque, int event);
|
||||
static void net_vhost_user_event(void *opaque, QEMUChrEvent event);
|
||||
|
||||
static void chr_closed_bh(void *opaque)
|
||||
{
|
||||
|
@ -249,7 +249,7 @@ static void chr_closed_bh(void *opaque)
|
|||
}
|
||||
}
|
||||
|
||||
static void net_vhost_user_event(void *opaque, int event)
|
||||
static void net_vhost_user_event(void *opaque, QEMUChrEvent event)
|
||||
{
|
||||
const char *name = opaque;
|
||||
NetClientState *ncs[MAX_QUEUE_NUM];
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue