vhost-user: save features if the char dev is closed
PATCH v3 1/1 vhost-user: save features if the char dev is closed
That way the state can be correctly restored when the device is opened again. This might happen if the backend is restarted.
Reported-by Pei Zhang <[email protected]>
Fixes 6ab79a20af3a (do not call vhost_net_cleanup() on running net from char user event)
Cc Michael S. Tsirkin <[email protected]>
Signed-off-by Adrian Moreno <[email protected]>
--- net/vhost-user.c | 4 ++++ 1 file changed, 4 insertions(+)
net/vhost-user.c +4 -0
@@ -235,6 +235,10 @@ static void chr_closed_bh(void *opaque) s =DO_UPCAST (NetVhostUserState, nc, ncs[0 ]); +if (s->vhost_net) { + s->acked_features =vhost_net_get_acked_features (s->vhost_net); + } +qmp_set_link (name, false, &err); qemu_chr_fe_set_handlers(&s->chr, NULL, NULL, net_vhost_user_event,
Signature · 1 line
2.21.0
Quoted 19 lines · Adrian Moreno
That way the state can be correctly restored when the device is opened again. This might happen if the backend is restarted.
Reported-by Pei Zhang <[email protected]>Fixes 6ab79a20af3a (do not call vhost_net_cleanup() on running net from char user event)Cc Michael S. Tsirkin <[email protected]>Signed-off-by Adrian Moreno <[email protected]>--- net/vhost-user.c | 4 ++++ 1 file changed, 4 insertions(+)net/vhost-user.c +0
-0
net/vhost-user.c static void chr_closed_bh(void *opaque) · line 244
Quoted 10 lines
net/vhost-user.c +4
-0@@ -235,6 +235,10 @@ static void chr_closed_bh(void *opaque) s =DO_UPCAST (NetVhostUserState, nc, ncs[0 ]); +if (s->vhost_net) { + s->acked_features =vhost_net_get_acked_features (s->vhost_net); + } +qmp_set_link (name, false, &err); qemu_chr_fe_set_handlers(&s->chr, NULL, NULL, net_vhost_user_event,
Acked-by Jason Wang <[email protected]>