mirror of
https://github.com/Motorhead1991/qemu.git
synced 2025-08-05 16:53:55 -06:00
chardev: new qemu_chr_be_update_read_handlers()
Add a wrapper for the chr_update_read_handler(). Signed-off-by: Peter Xu <peterx@redhat.com> Message-Id: <1505975754-21555-2-git-send-email-peterx@redhat.com> Reviewed-by: Marc-André Lureau <marcandre.lureau@redhat.com> Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
This commit is contained in:
parent
9bad2a6b9d
commit
07241c205c
3 changed files with 22 additions and 5 deletions
|
@ -253,7 +253,6 @@ void qemu_chr_fe_set_handlers(CharBackend *b,
|
|||
bool set_open)
|
||||
{
|
||||
Chardev *s;
|
||||
ChardevClass *cc;
|
||||
int fe_open;
|
||||
|
||||
s = b->chr;
|
||||
|
@ -261,7 +260,6 @@ void qemu_chr_fe_set_handlers(CharBackend *b,
|
|||
return;
|
||||
}
|
||||
|
||||
cc = CHARDEV_GET_CLASS(s);
|
||||
if (!opaque && !fd_can_read && !fd_read && !fd_event) {
|
||||
fe_open = 0;
|
||||
remove_fd_in_watch(s);
|
||||
|
@ -273,9 +271,8 @@ void qemu_chr_fe_set_handlers(CharBackend *b,
|
|||
b->chr_event = fd_event;
|
||||
b->chr_be_change = be_change;
|
||||
b->opaque = opaque;
|
||||
if (cc->chr_update_read_handler) {
|
||||
cc->chr_update_read_handler(s, context);
|
||||
}
|
||||
|
||||
qemu_chr_be_update_read_handlers(s, context);
|
||||
|
||||
if (set_open) {
|
||||
qemu_chr_fe_set_open(b, fe_open);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue