Host<-->guest connections via vsock sockets aren't yet supported for live update / CPR-style migration. This series adds such support.
It's based on the vhost-related basis submitted earlier by Steve, Ben and Mark at [0]. Patches 1-3 are rework of this submission, adjusted to the latest master branch and with respect to Fabiano's review comments. Essentially we want the host<-->guest connection to survive the CPR migration. For that to happen, we preserve the vhost FD and issue VHOST_RESET_OWNER ioctl on the source side before the VHOST_SET_OWNER is issued on the target. VHOST_RESET_OWNER is currently not supported by the Linux vsock driver. We've implemented this support and there's a kernel series complementary to this one. I've tested this (patched QEMU + patched kernel) approximately as follows: * Run listener in the guest: socat -u VSOCK-LISTEN:9999 - >/tmp/recv.bin * Run data transfer from host to guest: socat -u FILE:/root/bigfile.bin VSOCK-CONNECT:CID:9999 * Perform CPR migration during transfer (either cpr-exec or cpr-transfer) * Check that file hash sum matches [0] https://lore.kernel.org/qemu-devel/[email protected] Andrey Drobyshev (5): migration: emit SETUP notification before CPR migration: stop VM earlier for CPR vhost: reset vhost devices for CPR vhost-vsock: preserve vhost FD during CPR vhost-vsock: don't reset connections during CPR hw/virtio/vhost-backend.c | 6 ++ hw/virtio/vhost-vsock-pci.c | 5 -- hw/virtio/vhost-vsock.c | 42 ++++++++++++-- hw/virtio/vhost.c | 33 +++++++++++ include/hw/virtio/vhost-backend.h | 1 + include/hw/virtio/vhost-vsock.h | 6 ++ include/hw/virtio/vhost.h | 1 + migration/migration.c | 96 ++++++++++++++++++++++++------- 8 files changed, 157 insertions(+), 33 deletions(-) -- 2.47.1
