From: "Dr. David Alan Gilbert" <dgilb...@redhat.com> Hi, This is the first non-RFC version of this patch set that enables postcopy migration with shared memory to a vhost user process. It's based off current head.
I've tested with vhost-user-bridge and a modified dpdk; both very lightly. Compared to v2 we're now using the just-merged reworks to the vhost code (suggested by Igor), so that the huge page region merging is now a lot simpler in this series. The handshake between the client and the qemu for the set-mem-table is now a bit more complex to resolve a previous race where the client would start sending requests to the qemu prior to the qemu being ready to accept them. Dave Dr. David Alan Gilbert (29): migrate: Update ram_block_discard_range for shared qemu_ram_block_host_offset postcopy: use UFFDIO_ZEROPAGE only when available postcopy: Add notifier chain postcopy: Add vhost-user flag for postcopy and check it vhost-user: Add 'VHOST_USER_POSTCOPY_ADVISE' message libvhost-user: Support sending fds back to qemu libvhost-user: Open userfaultfd postcopy: Allow registering of fd handler vhost+postcopy: Register shared ufd with postcopy vhost+postcopy: Transmit 'listen' to client postcopy+vhost-user: Split set_mem_table for postcopy migration/ram: ramblock_recv_bitmap_test_byte_offset libvhost-user+postcopy: Register new regions with the ufd vhost+postcopy: Send address back to qemu vhost+postcopy: Stash RAMBlock and offset vhost+postcopy: Send requests to source for shared pages vhost+postcopy: Resolve client address postcopy: wake shared postcopy: postcopy_notify_shared_wake vhost+postcopy: Add vhost waker vhost+postcopy: Call wakeups libvhost-user: mprotect & madvises for postcopy vhost-user: Add VHOST_USER_POSTCOPY_END message vhost+postcopy: Wire up POSTCOPY_END notify vhost: Huge page align and merge postcopy: Allow shared memory libvhost-user: Claim support for postcopy postcopy shared docs contrib/libvhost-user/libvhost-user.c | 303 ++++++++++++++++++++++++- contrib/libvhost-user/libvhost-user.h | 8 + docs/devel/migration.rst | 41 ++++ docs/interop/vhost-user.txt | 42 ++++ exec.c | 85 +++++-- hw/virtio/trace-events | 16 +- hw/virtio/vhost-user.c | 411 +++++++++++++++++++++++++++++++++- hw/virtio/vhost.c | 66 +++++- include/exec/cpu-common.h | 4 + migration/migration.c | 6 + migration/migration.h | 4 + migration/postcopy-ram.c | 350 +++++++++++++++++++++++------ migration/postcopy-ram.h | 69 ++++++ migration/ram.c | 5 + migration/ram.h | 1 + migration/savevm.c | 13 ++ migration/trace-events | 6 + trace-events | 3 +- vl.c | 2 + 19 files changed, 1337 insertions(+), 98 deletions(-) -- 2.14.3