vhost: wrong value return for VHOST_USER_VRING_GET_BASE 00/5700/4
authorSteven <sluong@cisco.com>
Fri, 10 Mar 2017 07:49:32 +0000 (23:49 -0800)
committerJohn Lo <loj@cisco.com>
Thu, 16 Mar 2017 14:00:12 +0000 (14:00 +0000)
commitf6dae05b8b5f4e17d1cf7e108bf8a6af3a2f9785
tree97382313bdf0c6a2e33d15228d17f6dba8eadedc
parente9f929b52ddb741ec1e4cb2d92c6be1e798933a0
vhost: wrong value return for VHOST_USER_VRING_GET_BASE

When the VM is migrated, the driver sends VHOST_USER_VRING_GET_BASE
message to the device to get the vring offset. The device is
supposed to shut down the vring, and return the current vring offset.
What the code did was to shutdown the vring, initialize the vring,
and return 0 to the driver.

The fix is to first store last_avail_idx in the message and then close
the vring.

Change-Id: I432e9f50f36d89fe53a45e050edcf5e1218caf7a
Signed-off-by: Steven <sluong@cisco.com>
src/vnet/devices/virtio/vhost-user.c