Commit 25427793 authored by Dariusz Stojaczyk's avatar Dariusz Stojaczyk Committed by Jim Harris
Browse files

vhost: close callfd on VHOST_USER_GET_VRING_BASE message



This prevents from destroying & recreating user device in "incomplete"
vring state. virtio_is_ready() was returning true for devices with
vrings which did not have valid callfd (their VHOST_USER_SET_VRING_CALL
hasn't arrived yet)

Change-Id: Idc4b41efd544ff5c6b093a5a48798b41c55bbe06
Signed-off-by: default avatarDariusz Stojaczyk <dariuszx.stojaczyk@intel.com>
parent 52b10970
Loading
Loading
Loading
Loading
+5 −0
Original line number Diff line number Diff line
@@ -767,6 +767,11 @@ vhost_user_get_vring_base(struct virtio_net *dev,

	vq->kickfd = VIRTIO_UNINITIALIZED_EVENTFD;

	if (vq->callfd >= 0)
		close(vq->callfd);

	vq->callfd = VIRTIO_UNINITIALIZED_EVENTFD;

	if (dev->dequeue_zero_copy)
		free_zmbufs(vq);
	rte_free(vq->shadow_used_ring);