[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[qemu-xen staging-4.13] vhost-user: save features if the char dev is closed



commit 7b404cae7fa2850d476c29258f03b8e77a5b4bd0
Author:     Adrian Moreno <amorenoz@xxxxxxxxxx>
AuthorDate: Tue Sep 24 18:20:44 2019 +0200
Commit:     Michael Roth <mdroth@xxxxxxxxxxxxxxxxxx>
CommitDate: Mon Nov 4 08:09:49 2019 -0600

    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.
    
    Buglink: https://bugzilla.redhat.com/show_bug.cgi?id=1738768
    Reported-by: Pei Zhang <pezhang@xxxxxxxxxx>
    Fixes: 6ab79a20af3a ("do not call vhost_net_cleanup() on running net from 
char user event")
    Cc: ddstreet@xxxxxxxxxxxxx
    Cc: Michael S. Tsirkin <mst@xxxxxxxxxx>
    Cc: qemu-stable@xxxxxxxxxx
    Signed-off-by: Adrian Moreno <amorenoz@xxxxxxxxxx>
    Message-Id: <20190924162044.11414-1-amorenoz@xxxxxxxxxx>
    Acked-by: Jason Wang <jasowang@xxxxxxxxxx>
    Reviewed-by: Michael S. Tsirkin <mst@xxxxxxxxxx>
    Signed-off-by: Michael S. Tsirkin <mst@xxxxxxxxxx>
    (cherry picked from commit c6beefd674fff8d41b90365dfccad32e53a5abcb)
    Signed-off-by: Michael Roth <mdroth@xxxxxxxxxxxxxxxxxx>
---
 net/vhost-user.c | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/net/vhost-user.c b/net/vhost-user.c
index 51921de443..014199d600 100644
--- a/net/vhost-user.c
+++ b/net/vhost-user.c
@@ -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,
--
generated by git-patchbot for /home/xen/git/qemu-xen.git#staging-4.13



 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.