From: Xiao Wang <xiao.w.w...@intel.com>

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 <xiao.w.w...@intel.com>
---
 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

Reply via email to