Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
We have the following circular references found by Li Zebin: VhostUserBackend ==> VhostUserVsockThread ==> VringEpollHandler In addition to causing a resource leak, this causes also an error after we merged commit 38caab2 ("vsock: Don't allow duplicate CIDs"). When the VM reboot or shutdown, the application exits with the following error: [ERROR vhost_device_vsock] Could not create backend: CID already in use by another vsock device This happened because we have these circular references and VhostUserVsockThread::drop() is never invoked. So, we don't remove the cid from the map. Let's fix this problem by simply removing the reference to VringEpollHandler from VhostUserVsockThread. In fact, we do not need to keep the reference for the lifetime of VhostUserVsockThread, as we only need to add the handlers once. Let's also rename the fields to follow the current VhostUserDaemon API. Closes #438 Reported-by: Li Zebin <cutelizebin@gmail.com> Signed-off-by: Stefano Garzarella <sgarzare@redhat.com>
- Loading branch information