qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
* [Qemu-devel] [PATCH] vhost-user: save features if the char dev is closed
@ 2019-09-17 19:19 Adrian Moreno
  2019-09-17 21:40 ` Michael S. Tsirkin
  0 siblings, 1 reply; 3+ messages in thread
From: Adrian Moreno @ 2019-09-17 19:19 UTC (permalink / raw)
  To: qemu-devel; +Cc: ddstreet, Adrian Moreno, Pei Zhang, Michael S . Tsirkin

That way the state can be correctly restored when the device is opened
again. This might happen if the backend is restarted.

Buglink: https://bugzilla.redhat.com/show_bug.cgi?id=1738768
Reported-by: Pei Zhang <pezhang@redhat.com>
Fixes: 6ab79a20af3a (do not call vhost_net_cleanup() on running net from char user event)
Cc: ddstreet@canonical.com
Cc: Michael S. Tsirkin <mst@redhat.com>

Signed-off-by: Adrian Moreno <amorenoz@redhat.com>
---
 net/vhost-user.c | 7 +++++++
 1 file changed, 7 insertions(+)

diff --git a/net/vhost-user.c b/net/vhost-user.c
index 51921de443..acf20cb9e0 100644
--- a/net/vhost-user.c
+++ b/net/vhost-user.c
@@ -235,6 +235,13 @@ static void chr_closed_bh(void *opaque)
 
     s = DO_UPCAST(NetVhostUserState, nc, ncs[0]);
 
+    if (s->vhost_net) {
+        uint64_t features = vhost_net_get_acked_features(s->vhost_net);
+        if (features) {
+            s->acked_features = features;
+         }
+    }
+
     qmp_set_link(name, false, &err);
 
     qemu_chr_fe_set_handlers(&s->chr, NULL, NULL, net_vhost_user_event,
-- 
2.21.0



^ permalink raw reply related	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2019-09-18  8:41 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2019-09-17 19:19 [Qemu-devel] [PATCH] vhost-user: save features if the char dev is closed Adrian Moreno
2019-09-17 21:40 ` Michael S. Tsirkin
2019-09-18  8:40   ` Adrian Moreno

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).