]> git.ipfire.org Git - thirdparty/qemu.git/commitdiff
do not call vhost_net_cleanup() on running net from char user event
authorDan Streetman <ddstreet@canonical.com>
Tue, 16 Apr 2019 18:46:24 +0000 (14:46 -0400)
committerMichael Roth <mdroth@linux.vnet.ibm.com>
Tue, 9 Jul 2019 18:31:11 +0000 (13:31 -0500)
Buglink: https://launchpad.net/bugs/1823458
Currently, a user CHR_EVENT_CLOSED event will cause net_vhost_user_event()
to call vhost_user_cleanup(), which calls vhost_net_cleanup() for all
its queues.  However, vhost_net_cleanup() must never be called like
this for fully-initialized nets; when other code later calls
vhost_net_stop() - such as from virtio_net_vhost_status() - it will try
to access the already-cleaned-up fields and fail with assertion errors
or segfaults.

The vhost_net_cleanup() will eventually be called from
qemu_cleanup_net_client().

Signed-off-by: Dan Streetman <ddstreet@canonical.com>
Message-Id: <20190416184624.15397-3-dan.streetman@canonical.com>
Reviewed-by: Michael S. Tsirkin <mst@redhat.com>
Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
(cherry picked from commit 6ab79a20af3a7b3bf610ba9aebb446a9f0b05930)
Signed-off-by: Michael Roth <mdroth@linux.vnet.ibm.com>
net/vhost-user.c

index a39f9c9974dba5905e989e5a309fb1772241cdef..afb5697acf4f058c211d7d1813eda158234cfd16 100644 (file)
@@ -223,7 +223,6 @@ static void chr_closed_bh(void *opaque)
     s = DO_UPCAST(NetVhostUserState, nc, ncs[0]);
 
     qmp_set_link(name, false, &err);
-    vhost_user_stop(queues, ncs);
 
     qemu_chr_fe_set_handlers(&s->chr, NULL, NULL, net_vhost_user_event,
                              NULL, opaque, NULL, true);