[PATCH 0/8] vfio-user: live migration support

Hugo Komatsu posted 8 patches 3 weeks, 2 days ago
Patches applied successfully (tree, apply log)
git fetch https://github.com/patchew-project/qemu tags/patchew/20260903130833.1437632-1-hugo.komatsu@nutanix.com
Maintainers: John Levon <john.levon@nutanix.com>, Thanos Makatos <thanos.makatos@nutanix.com>, "Cédric Le Goater" <clg@redhat.com>, Pierrick Bouvier <pierrick.bouvier@oss.qualcomm.com>, Alex Williamson <alex@shazbot.org>, Cornelia Huck <cohuck@redhat.com>, Eric Farman <farman@linux.ibm.com>, Matthew Rosato <mjrosato@linux.ibm.com>, Tony Krowiak <akrowiak@linux.ibm.com>, Halil Pasic <pasic@linux.ibm.com>, Jason Herne <jjherne@linux.ibm.com>
There is a newer version of this series
docs/interop/vfio-user.rst    | 132 +++++++++++++---------
hw/vfio-user/device.c         | 206 +++++++++++++++++++++++++++++++++-
hw/vfio-user/pci.c            |  13 ++-
hw/vfio-user/protocol.h       |  19 ++++
hw/vfio-user/trace-events     |   3 +
hw/vfio/ap.c                  |   4 +-
hw/vfio/ccw.c                 |   2 +-
hw/vfio/device.c              |  49 +++++++-
hw/vfio/migration.c           |  79 ++++++-------
hw/vfio/pci.c                 |  31 +++--
hw/vfio/pci.h                 |   3 +
include/hw/vfio/vfio-device.h |  50 +++++++++
12 files changed, 479 insertions(+), 112 deletions(-)
[PATCH 0/8] vfio-user: live migration support
Posted by Hugo Komatsu 3 weeks, 2 days ago
This patch series introduces live migration support for vfio-user PCI
devices, built on top of the VFIO v2 migration interface.

To avoid duplicating the extensive migration logic already present in
QEMU, this series reuses the generic VFIO migration infrastructure
(hw/vfio/migration.c). We achieve this by abstracting the hardcoded
kernel ioctl() and read()/write() calls behind the existing
VFIODeviceIOOps table, allowing the vfio-user transport to supply its
own socket-based implementations.

Kernel VFIO transfers device migration data through a dedicated data_fd.
vfio-user instead uses its already-established UNIX socket. We introduce
three new wire commands (VFIO_USER_MIG_DATA_READ, VFIO_USER_MIG_DATA_WRITE,
and VFIO_USER_GET_PRECOPY_INFO) for streaming migration data and querying
pre-copy information. The protocol documentation and dirty-page logging
behaviors are updated accordingly.

The corresponding SPDK device-side implementation is available as a WIP
series:

https://review.spdk.io/q/topic:vfio-user-live-migration-v2

Current limitations:
1. Peer-to-Peer (P2P) migration states are not currently supported by
   the libvfio-user server, so P2P support is not included.
2. Device state pre-copy is not yet supported over vfio-user. This
   series explicitly strips the PRE_COPY bit from the advertised
   migration flags, forcing the generic migration code to execute a
   standard stop-and-copy migration.
3. Backward migration to older QEMU versions is not explicitly handled with
   compat properties in this series, as older destination binaries lack the
   underlying capability to receive the vfio-user migration state.

Hugo Komatsu (7):
  docs/vfio-user: clarify data_fd and DMA logging behaviors
  vfio: route device_feature through io_ops
  vfio: route device_reset through io_ops
  vfio: use io_ops abstraction for migration related ioctls
  vfio-user: enable DMA logging for dirty page tracking
  vfio-user: implement mig_data read/write socket operations
  vfio-user: enable live migration for pci devices

William Henderson (1):
  vfio-user: add live migration to vfio-user protocol specification

 docs/interop/vfio-user.rst    | 132 +++++++++++++---------
 hw/vfio-user/device.c         | 206 +++++++++++++++++++++++++++++++++-
 hw/vfio-user/pci.c            |  13 ++-
 hw/vfio-user/protocol.h       |  19 ++++
 hw/vfio-user/trace-events     |   3 +
 hw/vfio/ap.c                  |   4 +-
 hw/vfio/ccw.c                 |   2 +-
 hw/vfio/device.c              |  49 +++++++-
 hw/vfio/migration.c           |  79 ++++++-------
 hw/vfio/pci.c                 |  31 +++--
 hw/vfio/pci.h                 |   3 +
 include/hw/vfio/vfio-device.h |  50 +++++++++
 12 files changed, 479 insertions(+), 112 deletions(-)


base-commit: ef1e8668b9f3ab6d6e7826806db1de5326f9df7d
-- 
2.39.3