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 <maxime.coquelin@redhat.com>
Acked-by: Laszlo Ersek <lersek@redhat.com>
Acked-by: Yuanhan Liu <yliu@fridaylinux.org>
This commit is contained in:
Maxime Coquelin 2017-12-13 09:51:07 +01:00 committed by Ferruh Yigit
parent 07f8db29b8
commit 59fe5e17d9

View File

@ -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: