From: Maxime Coquelin Date: Wed, 13 Dec 2017 08:51:07 +0000 (+0100) Subject: vhost: propagate set features handling error X-Git-Tag: spdx-start~514 X-Git-Url: http://git.droids-corp.org/?a=commitdiff_plain;h=59fe5e17d9308b008ffa22ea250ddd363c84c3b5;p=dpdk.git vhost: propagate set features handling error Not propagating VHOST_USER_SET_FEATURES request handling error may result in unpredictable behavior, as host and guests features may no more be synchronized. This patch fixes this by reporting the error to the upper layer, which would result in the device being destroyed and the connection with the master to be closed. Signed-off-by: Maxime Coquelin Acked-by: Laszlo Ersek Acked-by: Yuanhan Liu --- diff --git a/lib/librte_vhost/vhost_user.c b/lib/librte_vhost/vhost_user.c index a3455ff3cd..5ffd8891d9 100644 --- a/lib/librte_vhost/vhost_user.c +++ b/lib/librte_vhost/vhost_user.c @@ -1268,7 +1268,9 @@ vhost_user_msg_handler(int vid, int fd) send_vhost_reply(fd, &msg); break; case VHOST_USER_SET_FEATURES: - vhost_user_set_features(dev, msg.payload.u64); + ret = vhost_user_set_features(dev, msg.payload.u64); + if (ret) + return -1; break; case VHOST_USER_GET_PROTOCOL_FEATURES: