From 81517ba37a6cec59f92396b4722861868eb0a500 Mon Sep 17 00:00:00 2001 From: Anton Nefedov Date: Thu, 6 Jul 2017 15:08:49 +0300 Subject: char: add backend hotswap handler MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 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 Reviewed-by: Vladimir Sementsov-Ogievskiy Reviewed-by: Marc-André Lureau Message-Id: <1499342940-56739-3-git-send-email-anton.nefedov@virtuozzo.com> Signed-off-by: Paolo Bonzini --- net/vhost-user.c | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) (limited to 'net/vhost-user.c') diff --git a/net/vhost-user.c b/net/vhost-user.c index a042ec6a34..36f32a2d84 100644 --- a/net/vhost-user.c +++ b/net/vhost-user.c @@ -211,7 +211,7 @@ static void chr_closed_bh(void *opaque) vhost_user_stop(queues, ncs); qemu_chr_fe_set_handlers(&s->chr, NULL, NULL, net_vhost_user_event, - opaque, NULL, true); + NULL, opaque, NULL, true); if (err) { error_report_err(err); @@ -257,7 +257,7 @@ static void net_vhost_user_event(void *opaque, int event) g_source_remove(s->watch); s->watch = 0; - qemu_chr_fe_set_handlers(&s->chr, NULL, NULL, NULL, + qemu_chr_fe_set_handlers(&s->chr, NULL, NULL, NULL, NULL, NULL, NULL, false); aio_bh_schedule_oneshot(ctx, chr_closed_bh, opaque); @@ -305,7 +305,8 @@ static int net_vhost_user_init(NetClientState *peer, const char *device, return -1; } qemu_chr_fe_set_handlers(&s->chr, NULL, NULL, - net_vhost_user_event, nc0->name, NULL, true); + net_vhost_user_event, NULL, nc0->name, NULL, + true); } while (!s->started); assert(s->vhost_net); -- cgit v1.2.1