vhost: prevent features to be changed while device is running
authorMaxime Coquelin <maxime.coquelin@redhat.com>
Wed, 13 Dec 2017 08:51:06 +0000 (09:51 +0100)
committerFerruh Yigit <ferruh.yigit@intel.com>
Tue, 16 Jan 2018 17:47:49 +0000 (18:47 +0100)
commit07f8db29b8833378dd506f3e197319f8b669aed9
tree158e27b343dd5eeedb09348973c02cf47114bdfd
parent6d18505efaa6d3d7dade969d42ee520738e713cb
vhost: prevent features to be changed while device is running

As section 2.2 of the Virtio spec states about features
negotiation:
"During device initialization, the driver reads this and tells
the device the subset that it accepts. The only way to
renegotiate is to reset the device."

This patch implements a check to prevent illegal features change
while the device is running.

One exception is the VHOST_F_LOG_ALL feature bit, which is enabled
when live-migration is initiated. But this feature is not negotiated
with the Virtio driver, but directly with the Vhost master.

Signed-off-by: Maxime Coquelin <maxime.coquelin@redhat.com>
Acked-by: Laszlo Ersek <lersek@redhat.com>
Acked-by: Yuanhan Liu <yliu@fridaylinux.org>
lib/librte_vhost/vhost_user.c