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

Hugo Komatsu posted 8 patches 2 weeks, 1 day ago
Patches applied successfully (tree, apply log)
git fetch https://github.com/patchew-project/qemu tags/patchew/20260911140710.2348139-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>, Cornelia Huck <cohuck@redhat.com>, Eric Farman <farman@linux.ibm.com>, Matthew Rosato <mjrosato@linux.ibm.com>, Alex Williamson <alex@shazbot.org>, Tony Krowiak <akrowiak@linux.ibm.com>, Halil Pasic <pasic@linux.ibm.com>, Jason Herne <jjherne@linux.ibm.com>
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              |  84 +++++++++++++-
hw/vfio/migration.c           |  79 ++++++-------
hw/vfio/pci.c                 |  31 +++--
hw/vfio/pci.h                 |   3 +
include/hw/vfio/vfio-device.h |  57 ++++++++++
12 files changed, 522 insertions(+), 111 deletions(-)
[PATCH v2 0/8] vfio-user: live migration support
Posted by Hugo Komatsu 2 weeks, 1 day 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.

Changes in v2:
- Use vfio_device_get_feature() for migration device-feature operations.
- Add a guarded vfio_device_reset() wrapper and route all reset callers
  through it.
- Add guarded wrappers for get_precopy_info, mig_data_read, and
  mig_data_write_from_file, and route their callers through them.
- Preserve the separation between capabilities and callbacks in the
  kernel VFIODeviceIOOps initializer.

v1:
https://lore.kernel.org/qemu-devel/20260903130833.1437632-1-hugo.komatsu@nutanix.com/

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              |  84 +++++++++++++-
 hw/vfio/migration.c           |  79 ++++++-------
 hw/vfio/pci.c                 |  31 +++--
 hw/vfio/pci.h                 |   3 +
 include/hw/vfio/vfio-device.h |  57 ++++++++++
 12 files changed, 522 insertions(+), 111 deletions(-)


base-commit: 55347990687e7bc5b6b0d624f290025726e8fbfa
-- 
2.39.3

Re: [PATCH v2 0/8] vfio-user: live migration support
Posted by Cédric Le Goater 1 week, 5 days ago
John, Thanos,

On 9/11/26 16:19, Hugo Komatsu wrote:
> 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.
> 
> Changes in v2:
> - Use vfio_device_get_feature() for migration device-feature operations.
> - Add a guarded vfio_device_reset() wrapper and route all reset callers
>    through it.
> - Add guarded wrappers for get_precopy_info, mig_data_read, and
>    mig_data_write_from_file, and route their callers through them.
> - Preserve the separation between capabilities and callbacks in the
>    kernel VFIODeviceIOOps initializer.
> 
> v1:
> https://lore.kernel.org/qemu-devel/20260903130833.1437632-1-hugo.komatsu@nutanix.com/
> 
> 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

I just received :

   Dear sender,
   Thank you for your email. This mailbox is no longer active and your email will not be forwarded. Please contact "andrew.dunn@nutanix.com"


Is someone taking over this series ?

Thanks,

C.