From mboxrd@z Thu Jan 1 00:00:00 1970 From: Zhihong Wang Subject: [PATCH 6/7] vhost: get callfd before device setup Date: Fri, 2 Feb 2018 18:28:56 -0500 Message-ID: <1517614137-62926-7-git-send-email-zhihong.wang@intel.com> References: <1517614137-62926-1-git-send-email-zhihong.wang@intel.com> Cc: jianfeng.tan@intel.com, tiwei.bie@intel.com, maxime.coquelin@redhat.com, yliu@fridaylinux.org, cunming.liang@intel.com, xiao.w.wang@intel.com, dan.daly@intel.com To: dev@dpdk.org Return-path: Received: from mga17.intel.com (mga17.intel.com [192.55.52.151]) by dpdk.org (Postfix) with ESMTP id 92A741B1A8 for ; Fri, 2 Feb 2018 12:33:53 +0100 (CET) In-Reply-To: <1517614137-62926-1-git-send-email-zhihong.wang@intel.com> List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org Sender: "dev" From: Xiao Wang This patch is to make sure device is configured with all needed guest info. According to QEMU vhost message sequence, the real callfd comes just before SET_VRING_ENABLE. Signed-off-by: Xiao Wang --- lib/librte_vhost/vhost_user.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/lib/librte_vhost/vhost_user.c b/lib/librte_vhost/vhost_user.c index 05b53fa..3fe1b3d 100644 --- a/lib/librte_vhost/vhost_user.c +++ b/lib/librte_vhost/vhost_user.c @@ -1547,7 +1547,8 @@ vhost_user_msg_handler(int vid, int fd) send_vhost_reply(fd, &msg); } - if (!(dev->flags & VIRTIO_DEV_RUNNING) && virtio_is_ready(dev)) { + if (!(dev->flags & VIRTIO_DEV_RUNNING) && virtio_is_ready(dev) + && msg.request.master == VHOST_USER_SET_VRING_ENABLE) { dev->flags |= VIRTIO_DEV_READY; if (!(dev->flags & VIRTIO_DEV_RUNNING)) { -- 2.7.5