Add live migration support to (non-dpdk) vhost-user driver 10/410/2
authorYoann Desmouceaux <ydesmouc@cisco.com>
Wed, 24 Feb 2016 21:51:00 +0000 (22:51 +0100)
committerGerrit Code Review <gerrit@fd.io>
Thu, 25 Feb 2016 13:53:14 +0000 (13:53 +0000)
commit4667c229a05458eb7558cf927a44df3d5f585c11
treed2fac70af78c9948aa302546d9512a149a45e87b
parent1f49ed666af8b9cb889f9ea61f084341d0b6c4f4
Add live migration support to (non-dpdk) vhost-user driver

This patch adds live migration support to vhost interfaces, by supporting the VHOST_F_LOG_ALL feature. When qemu starts a migration, it will negotiate this feature, and provide a fd for a "dirty log" shared mem space. This log is a bitmap representing pages in the device memory.
Whenever we touch memory pointed by a "desc" vring, or modify a "used" vring, we log the corresponding page in the bitmap. This allows qemu to send the dirty page to the destination host.
See https://github.com/qemu/qemu/blob/master/docs/specs/vhost-user.txt, ยง "Live migration" for more details.
In addition to this, this code provides support for the VHOST_USER_F_PROTOCOL_FEATURES feature, and to VHOST_USER_{GET,SET}_PROTOCOL_FEATURES and VHOST_USER_SET_VRING_ENABLE messages, required for live migration.

Change-Id: I7577efce8bd67653218f4291af1d651de451e552
Signed-off-by: Yoann Desmouceaux <ydesmouc@cisco.com>
vnet/vnet/devices/virtio/vhost-user.c
vnet/vnet/devices/virtio/vhost-user.h