c36cf18
From d7f0078e3a3d838b4ec6a87dca62771246e53db6 Mon Sep 17 00:00:00 2001
c36cf18
From: Maxime Coquelin <maxime.coquelin@redhat.com>
c36cf18
Date: Wed, 13 Dec 2017 09:51:07 +0100
c36cf18
Subject: [PATCH 2/6] vhost: propagate set features handling error
c36cf18
c36cf18
Not propagating VHOST_USER_SET_FEATURES request handling
c36cf18
error may result in unpredictable behavior, as host and
c36cf18
guests features may no more be synchronized.
c36cf18
c36cf18
This patch fixes this by reporting the error to the upper
c36cf18
layer, which would result in the device being destroyed
c36cf18
and the connection with the master to be closed.
c36cf18
c36cf18
Signed-off-by: Maxime Coquelin <maxime.coquelin@redhat.com>
c36cf18
Acked-by: Laszlo Ersek <lersek@redhat.com>
c36cf18
Acked-by: Yuanhan Liu <yliu@fridaylinux.org>
c36cf18
(cherry picked from commit 59fe5e17d9308b008ffa22ea250ddd363c84c3b5)
c36cf18
Signed-off-by: Maxime Coquelin <maxime.coquelin@redhat.com>
c36cf18
---
c36cf18
 dpdk-17.11/lib/librte_vhost/vhost_user.c | 4 +++-
c36cf18
 1 file changed, 3 insertions(+), 1 deletion(-)
c36cf18
c36cf18
diff --git a/dpdk-17.11/lib/librte_vhost/vhost_user.c b/dpdk-17.11/lib/librte_vhost/vhost_user.c
c36cf18
index 545dbcb2b..471b1612c 100644
c36cf18
--- a/dpdk-17.11/lib/librte_vhost/vhost_user.c
c36cf18
+++ b/dpdk-17.11/lib/librte_vhost/vhost_user.c
c36cf18
@@ -1263,7 +1263,9 @@ vhost_user_msg_handler(int vid, int fd)
c36cf18
 		send_vhost_reply(fd, &msg;;
c36cf18
 		break;
c36cf18
 	case VHOST_USER_SET_FEATURES:
c36cf18
-		vhost_user_set_features(dev, msg.payload.u64);
c36cf18
+		ret = vhost_user_set_features(dev, msg.payload.u64);
c36cf18
+		if (ret)
c36cf18
+			return -1;
c36cf18
 		break;
c36cf18
 
c36cf18
 	case VHOST_USER_GET_PROTOCOL_FEATURES:
c36cf18
-- 
c36cf18
2.14.3
c36cf18