From mboxrd@z Thu Jan 1 00:00:00 1970 From: Yuanhan Liu Subject: [PATCH v6 05/13] vhost-user: handle VHOST_USER_RESET_OWNER correctly Date: Fri, 9 Oct 2015 13:46:04 +0800 Message-ID: <1444369572-1157-6-git-send-email-yuanhan.liu@linux.intel.com> References: <1444369572-1157-1-git-send-email-yuanhan.liu@linux.intel.com> Cc: marcel@redhat.com, "Michael S. Tsirkin" To: dev@dpdk.org Return-path: Received: from mga11.intel.com (mga11.intel.com [192.55.52.93]) by dpdk.org (Postfix) with ESMTP id 4F8618E6C for ; Fri, 9 Oct 2015 07:46:14 +0200 (CEST) In-Reply-To: <1444369572-1157-1-git-send-email-yuanhan.liu@linux.intel.com> List-Id: patches and discussions about DPDK List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org Sender: "dev" Destroy corresponding device when a VHOST_USER_RESET_OWNER message is received, otherwise, the vhost-switch would still try to access vq of that device, which results to SIGSEG fault, and let vhost-switch crash in the end. Signed-off-by: Changchun Ouyang Signed-off-by: Yuanhan Liu --- lib/librte_vhost/vhost_user/vhost-net-user.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/librte_vhost/vhost_user/vhost-net-user.c b/lib/librte_vhost/vhost_user/vhost-net-user.c index 8675cd4..f802b77 100644 --- a/lib/librte_vhost/vhost_user/vhost-net-user.c +++ b/lib/librte_vhost/vhost_user/vhost-net-user.c @@ -379,7 +379,7 @@ vserver_message_handler(int connfd, void *dat, int *remove) ops->set_owner(ctx); break; case VHOST_USER_RESET_OWNER: - ops->reset_owner(ctx); + user_destroy_device(ctx); break; case VHOST_USER_SET_MEM_TABLE: -- 1.9.0