Commit e37d9c9
committed
Add replaceable-mmapped bitmap support
The vhost user protocol supports live migration, and during live
migration, the vhost-user frontend needs to track the modifications the
vhost-user backend makes to the memory mapped regions, marking the
dirty pages in a log (i.e., a bitmap).
If the backend has the VHOST_USER_PROTOCOL_F_LOG_SHMFD protocol feature
it will receive the VHOST_USER_SET_LOG_BASE message with a file
descriptor of the dirty-pages log memory region. This log covers all
known guest addresses, and must be manipulated atomically.
For further info please see
https://qemu-project.gitlab.io/qemu/interop/vhost-user.html#migration
This commit adds support for creating an atomic-memory-mapped bitmap,
and being able to replace it in runtime. The vhost user protocol does
not specify whether the previous bitmap is still active after replying
to the VHOST_USER_SET_LOG_BASE message, so we use an RwLock to be sure
that the in-flight requests are using the new bitmap after the message
reply.
Signed-off-by: German Maglione <[email protected]>1 parent 8912622 commit e37d9c9
0 commit comments