[PATCH v16 00/22] migration/cpr: support vhost-vsock devices

Andrey Drobyshev posted 22 patches 1 week, 3 days ago
backends/hostmem-memfd.c                        |   5 +-
backends/hostmem-shm.c                          |   5 +-
backends/iommufd.c                              |   4 +-
hw/vfio/container-legacy.c                      |   7 +-
hw/vfio/cpr-legacy.c                            |  29 +-
hw/vfio/cpr.c                                   |   6 +-
hw/vfio/pci.c                                   |   5 +-
hw/virtio/vhost-kernel.c                        |   6 +
hw/virtio/vhost-vsock.c                         | 193 ++++++++++++-
hw/virtio/vhost.c                               | 136 +++++++++-
include/hw/vfio/vfio-cpr.h                      |   7 +-
include/hw/virtio/vhost-backend.h               |   2 +
include/hw/virtio/vhost.h                       |  80 ++++++
include/migration/cpr.h                         |   2 +-
include/migration/misc.h                        |   5 +
migration/cpr.c                                 |  64 +++--
migration/migration.c                           |  10 +
migration/options.c                             |  13 +
system/physmem.c                                |   5 +-
tests/functional/x86_64/meson.build             |   2 +
tests/functional/x86_64/test_vhost_vsock_cpr.py | 347 ++++++++++++++++++++++++
tests/qtest/migration/cpr-tests.c               | 133 ++++++++-
tests/unit/meson.build                          |   1 +
tests/unit/test-cpr.c                           |  98 +++++++
24 files changed, 1084 insertions(+), 81 deletions(-)
[PATCH v16 00/22] migration/cpr: support vhost-vsock devices
Posted by Andrey Drobyshev 1 week, 3 days ago
v15 -> v16:

  * Patch 15:
    - replace the errno filtering in vhost_dev_try_release_owner() with
      a new 'owner_handed_over' flag in struct vhost_dev.  Release the
      ownership only if it was handed over to us, and report any failure;

  * Patch 19:
    - set 'owner_handed_over' in .post_load() on the CPR target;
    - drop the redundant 'owner_reset' flag, use vhost_dev.owner instead;
    - drop Stefano's R-b because of that.

v15: https://lore.kernel.org/qemu-devel/20261008-up-vsock-vhost-v5-v15-0-301b73b3f843@virtuozzo.com

Signed-off-by: Andrey Drobyshev <andrey.drobyshev@virtuozzo.com>
---
Andrey Drobyshev (22):
      migration/cpr: forbid saving duplicate CprFds into hash table
      tests/unit: add test for duplicate keys in CPR FD table
      migration: forbid snapshots in CPR migration modes
      migration: forbid snapshots under Xen
      tests/qtest/migration: add test for snapshot rejection in CPR modes
      vhost-vsock: block CPR migration modes
      vhost: add vhost_reset_owner op
      vhost-vsock: don't reset connections during CPR
      vhost-vsock: fix FD leak in realize()
      vhost-vsock: preserve vhost FD during CPR
      vhost: factor out vhost_dev_init_backend()
      vhost: make vhost_dev_cleanup() safe on a partially initialized device
      vhost: add vhost_dev_set_owner() / vhost_dev_reset_owner() helpers
      vhost: add vhost_dev_is_initialized() helper
      vhost: release ownership in vhost_dev_cleanup()
      migration: add MIG_EVENT_INCOMING_FAILED
      vhost: release ownership when the incoming migration fails
      vhost: release ownership on exit
      vhost-vsock: hand off device ownership across CPR
      tests/qtest/migration: add vhost-vsock tests for cpr-transfer and cpr-exec
      tests/functional: add vhost-vsock CPR test with a live guest
      tests/functional: cover a cpr-transfer target going away with vhost-vsock

 backends/hostmem-memfd.c                        |   5 +-
 backends/hostmem-shm.c                          |   5 +-
 backends/iommufd.c                              |   4 +-
 hw/vfio/container-legacy.c                      |   7 +-
 hw/vfio/cpr-legacy.c                            |  29 +-
 hw/vfio/cpr.c                                   |   6 +-
 hw/vfio/pci.c                                   |   5 +-
 hw/virtio/vhost-kernel.c                        |   6 +
 hw/virtio/vhost-vsock.c                         | 193 ++++++++++++-
 hw/virtio/vhost.c                               | 136 +++++++++-
 include/hw/vfio/vfio-cpr.h                      |   7 +-
 include/hw/virtio/vhost-backend.h               |   2 +
 include/hw/virtio/vhost.h                       |  80 ++++++
 include/migration/cpr.h                         |   2 +-
 include/migration/misc.h                        |   5 +
 migration/cpr.c                                 |  64 +++--
 migration/migration.c                           |  10 +
 migration/options.c                             |  13 +
 system/physmem.c                                |   5 +-
 tests/functional/x86_64/meson.build             |   2 +
 tests/functional/x86_64/test_vhost_vsock_cpr.py | 347 ++++++++++++++++++++++++
 tests/qtest/migration/cpr-tests.c               | 133 ++++++++-
 tests/unit/meson.build                          |   1 +
 tests/unit/test-cpr.c                           |  98 +++++++
 24 files changed, 1084 insertions(+), 81 deletions(-)
---
base-commit: 615ece3c406b262996e569f29ea6eed0d81c4d8d
change-id: 20260908-up-vsock-vhost-v5-c781b39f1c1a

Best regards,
--  
Andrey Drobyshev <andrey.drobyshev@virtuozzo.com>
Re: [PATCH v16 00/22] migration/cpr: support vhost-vsock devices
Posted by Akihiko Odaki 1 week ago
On 2026/10/12 19:28, Andrey Drobyshev wrote:
> v15 -> v16:
> 
>    * Patch 15:
>      - replace the errno filtering in vhost_dev_try_release_owner() with
>        a new 'owner_handed_over' flag in struct vhost_dev.  Release the
>        ownership only if it was handed over to us, and report any failure;
> 
>    * Patch 19:
>      - set 'owner_handed_over' in .post_load() on the CPR target;
>      - drop the redundant 'owner_reset' flag, use vhost_dev.owner instead;
>      - drop Stefano's R-b because of that.
> 
> v15: https://lore.kernel.org/qemu-devel/20261008-up-vsock-vhost-v5-v15-0-301b73b3f843@virtuozzo.com
> 
> Signed-off-by: Andrey Drobyshev <andrey.drobyshev@virtuozzo.com>

All comments I raised are now addressed, and other parts of the series 
also look good to me. For the whole series:

Reviewed-by: Akihiko Odaki <odaki@rsg.ci.i.u-tokyo.ac.jp>

Regards,
Akihiko Odaki
Re: [PATCH v16 00/22] migration/cpr: support vhost-vsock devices
Posted by Andrey Drobyshev 1 week ago
On 10/15/26 9:06 AM, Akihiko Odaki wrote:
> On 2026/10/12 19:28, Andrey Drobyshev wrote:
>> v15 -> v16:
>>
>>    * Patch 15:
>>      - replace the errno filtering in vhost_dev_try_release_owner() with
>>        a new 'owner_handed_over' flag in struct vhost_dev.  Release the
>>        ownership only if it was handed over to us, and report any failure;
>>
>>    * Patch 19:
>>      - set 'owner_handed_over' in .post_load() on the CPR target;
>>      - drop the redundant 'owner_reset' flag, use vhost_dev.owner instead;
>>      - drop Stefano's R-b because of that.
>>
>> v15: https://lore.kernel.org/qemu-devel/20261008-up-vsock-vhost-v5-v15-0-301b73b3f843@virtuozzo.com
>>
>> Signed-off-by: Andrey Drobyshev <andrey.drobyshev@virtuozzo.com>
> 
> All comments I raised are now addressed, and other parts of the series 
> also look good to me. For the whole series:
> 
> Reviewed-by: Akihiko Odaki <odaki@rsg.ci.i.u-tokyo.ac.jp>
> 
> Regards,
> Akihiko Odaki

Thank you for your time and efforts!

Andrey
Re: [PATCH v16 00/22] migration/cpr: support vhost-vsock devices
Posted by Andrey Drobyshev 2 days, 7 hours ago
On 10/12/26 1:28 PM, Andrey Drobyshev wrote:
> v15 -> v16:
> 
>   * Patch 15:
>     - replace the errno filtering in vhost_dev_try_release_owner() with
>       a new 'owner_handed_over' flag in struct vhost_dev.  Release the
>       ownership only if it was handed over to us, and report any failure;
> 
>   * Patch 19:
>     - set 'owner_handed_over' in .post_load() on the CPR target;
>     - drop the redundant 'owner_reset' flag, use vhost_dev.owner instead;
>     - drop Stefano's R-b because of that.
> 
> v15: https://lore.kernel.org/qemu-devel/20261008-up-vsock-vhost-v5-v15-0-301b73b3f843@virtuozzo.com
> 
> Signed-off-by: Andrey Drobyshev <andrey.drobyshev@virtuozzo.com>
> ---
> Andrey Drobyshev (22):
>       migration/cpr: forbid saving duplicate CprFds into hash table
>       tests/unit: add test for duplicate keys in CPR FD table
>       migration: forbid snapshots in CPR migration modes
>       migration: forbid snapshots under Xen
>       tests/qtest/migration: add test for snapshot rejection in CPR modes
>       vhost-vsock: block CPR migration modes
>       vhost: add vhost_reset_owner op
>       vhost-vsock: don't reset connections during CPR
>       vhost-vsock: fix FD leak in realize()
>       vhost-vsock: preserve vhost FD during CPR
>       vhost: factor out vhost_dev_init_backend()
>       vhost: make vhost_dev_cleanup() safe on a partially initialized device
>       vhost: add vhost_dev_set_owner() / vhost_dev_reset_owner() helpers
>       vhost: add vhost_dev_is_initialized() helper
>       vhost: release ownership in vhost_dev_cleanup()
>       migration: add MIG_EVENT_INCOMING_FAILED
>       vhost: release ownership when the incoming migration fails
>       vhost: release ownership on exit
>       vhost-vsock: hand off device ownership across CPR
>       tests/qtest/migration: add vhost-vsock tests for cpr-transfer and cpr-exec
>       tests/functional: add vhost-vsock CPR test with a live guest
>       tests/functional: cover a cpr-transfer target going away with vhost-vsock
> 
>  backends/hostmem-memfd.c                        |   5 +-
>  backends/hostmem-shm.c                          |   5 +-
>  backends/iommufd.c                              |   4 +-
>  hw/vfio/container-legacy.c                      |   7 +-
>  hw/vfio/cpr-legacy.c                            |  29 +-
>  hw/vfio/cpr.c                                   |   6 +-
>  hw/vfio/pci.c                                   |   5 +-
>  hw/virtio/vhost-kernel.c                        |   6 +
>  hw/virtio/vhost-vsock.c                         | 193 ++++++++++++-
>  hw/virtio/vhost.c                               | 136 +++++++++-
>  include/hw/vfio/vfio-cpr.h                      |   7 +-
>  include/hw/virtio/vhost-backend.h               |   2 +
>  include/hw/virtio/vhost.h                       |  80 ++++++
>  include/migration/cpr.h                         |   2 +-
>  include/migration/misc.h                        |   5 +
>  migration/cpr.c                                 |  64 +++--
>  migration/migration.c                           |  10 +
>  migration/options.c                             |  13 +
>  system/physmem.c                                |   5 +-
>  tests/functional/x86_64/meson.build             |   2 +
>  tests/functional/x86_64/test_vhost_vsock_cpr.py | 347 ++++++++++++++++++++++++
>  tests/qtest/migration/cpr-tests.c               | 133 ++++++++-
>  tests/unit/meson.build                          |   1 +
>  tests/unit/test-cpr.c                           |  98 +++++++
>  24 files changed, 1084 insertions(+), 81 deletions(-)
> ---
> base-commit: 615ece3c406b262996e569f29ea6eed0d81c4d8d
> change-id: 20260908-up-vsock-vhost-v5-c781b39f1c1a
> 
> Best regards,
> --  
> Andrey Drobyshev <andrey.drobyshev@virtuozzo.com>
> 

Friendly ping