diff options
author | Anton Nefedov <anton.nefedov@virtuozzo.com> | 2017-07-06 15:08:49 +0300 |
---|---|---|
committer | Paolo Bonzini <pbonzini@redhat.com> | 2017-07-14 11:04:33 +0200 |
commit | 81517ba37a6cec59f92396b4722861868eb0a500 (patch) | |
tree | debc47fba5f9718bc490176419076212e7dc1b57 /include/chardev/char-fe.h | |
parent | 313e45b5fe45542602bfa801db7a13d485c29b04 (diff) |
char: add backend hotswap handler
Frontends should have an interface to setup the handler of a backend change.
The interface will be used in the next commits
Signed-off-by: Anton Nefedov <anton.nefedov@virtuozzo.com>
Reviewed-by: Vladimir Sementsov-Ogievskiy <vsementsov@virtuozzo.com>
Reviewed-by: Marc-André Lureau <marcandre.lureau@redhat.com>
Message-Id: <1499342940-56739-3-git-send-email-anton.nefedov@virtuozzo.com>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
Diffstat (limited to 'include/chardev/char-fe.h')
-rw-r--r-- | include/chardev/char-fe.h | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/include/chardev/char-fe.h b/include/chardev/char-fe.h index 2cbb262f66..9f38060c7e 100644 --- a/include/chardev/char-fe.h +++ b/include/chardev/char-fe.h @@ -4,6 +4,7 @@ #include "chardev/char.h" typedef void IOEventHandler(void *opaque, int event); +typedef int BackendChangeHandler(void *opaque); /* This is the backend as seen by frontend, the actual backend is * Chardev */ @@ -12,6 +13,7 @@ struct CharBackend { IOEventHandler *chr_event; IOCanReadHandler *chr_can_read; IOReadHandler *chr_read; + BackendChangeHandler *chr_be_change; void *opaque; int tag; int fe_open; @@ -54,6 +56,8 @@ Chardev *qemu_chr_fe_get_driver(CharBackend *be); * receive * @fd_read: callback to receive data from char * @fd_event: event callback + * @be_change: backend change callback; passing NULL means hot backend change + * is not supported and will not be attempted * @opaque: an opaque pointer for the callbacks * @context: a main loop context or NULL for the default * @set_open: whether to call qemu_chr_fe_set_open() implicitely when @@ -68,6 +72,7 @@ void qemu_chr_fe_set_handlers(CharBackend *b, IOCanReadHandler *fd_can_read, IOReadHandler *fd_read, IOEventHandler *fd_event, + BackendChangeHandler *be_change, void *opaque, GMainContext *context, bool set_open); |