Browse Source

do not call vhost_net_cleanup() on running net from char user event

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: <2019041618.15397-3-dan.streetman@canonical.com>
Reviewed-by: Michael S. Tsirkin <mst@redhat.com>
Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
master
Dan Streetman 2 months ago
parent
commit
6ab79a20af
1 changed files with 0 additions and 1 deletions
  1. 0
    1
      net/vhost-user.c

+ 0
- 1
net/vhost-user.c View File

@@ -236,7 +236,6 @@ static void chr_closed_bh(void *opaque)
236 236
     s = DO_UPCAST(NetVhostUserState, nc, ncs[0]);
237 237
 
238 238
     qmp_set_link(name, false, &err);
239
-    vhost_user_stop(queues, ncs);
240 239
 
241 240
     qemu_chr_fe_set_handlers(&s->chr, NULL, NULL, net_vhost_user_event,
242 241
                              NULL, opaque, NULL, true);

Loading…
Cancel
Save