aboutsummaryrefslogtreecommitdiff
path: root/chardev/char-fe.c
diff options
context:
space:
mode:
authorAnton Nefedov <anton.nefedov@virtuozzo.com>2017-07-06 15:08:49 +0300
committerPaolo Bonzini <pbonzini@redhat.com>2017-07-14 11:04:33 +0200
commit81517ba37a6cec59f92396b4722861868eb0a500 (patch)
treedebc47fba5f9718bc490176419076212e7dc1b57 /chardev/char-fe.c
parent313e45b5fe45542602bfa801db7a13d485c29b04 (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 'chardev/char-fe.c')
-rw-r--r--chardev/char-fe.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/chardev/char-fe.c b/chardev/char-fe.c
index 3f90f0567c..7054863208 100644
--- a/chardev/char-fe.c
+++ b/chardev/char-fe.c
@@ -216,7 +216,7 @@ void qemu_chr_fe_deinit(CharBackend *b, bool del)
assert(b);
if (b->chr) {
- qemu_chr_fe_set_handlers(b, NULL, NULL, NULL, NULL, NULL, true);
+ qemu_chr_fe_set_handlers(b, NULL, NULL, NULL, NULL, NULL, NULL, true);
if (b->chr->be == b) {
b->chr->be = NULL;
}
@@ -235,6 +235,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)
@@ -258,6 +259,7 @@ void qemu_chr_fe_set_handlers(CharBackend *b,
b->chr_can_read = fd_can_read;
b->chr_read = fd_read;
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);