[PATCH v5 00/14] migration/cpr: support vhost-vsock devices

Andrey Drobyshev posted 14 patches 1 week, 5 days ago
Patches applied successfully (tree, apply log)
git fetch https://github.com/patchew-project/qemu tags/patchew/20260914-up-vsock-vhost-v5-v5-0-d17423589f48@virtuozzo.com
Maintainers: David Hildenbrand <david@kernel.org>, Igor Mammedov <imammedo@redhat.com>, Yi Liu <yi.l.liu@intel.com>, Eric Auger <eric.auger@redhat.com>, Zhenzhong Duan <zhenzhong.duan@intel.com>, Alex Williamson <alex@shazbot.org>, "Cédric Le Goater" <clg@redhat.com>, "Maciej S. Szmigiero" <maciej.szmigiero@oracle.com>, Peter Xu <peterx@redhat.com>, Fabiano Rosas <farosas@suse.de>, Mark Kanda <mark.kanda@oracle.com>, Ben Chaney <bchaney@akamai.com>, "Michael S. Tsirkin" <mst@redhat.com>, Stefano Garzarella <sgarzare@redhat.com>, Paolo Bonzini <pbonzini@redhat.com>, "Philippe Mathieu-Daudé" <philmd@oss.qualcomm.com>, Laurent Vivier <lvivier@redhat.com>
There is a newer version of this series
backends/hostmem-memfd.c          |   5 +-
backends/hostmem-shm.c            |   5 +-
backends/iommufd.c                |   4 +-
hw/vfio/container-legacy.c        |  17 +--
hw/vfio/cpr-legacy.c              |  10 +-
hw/vfio/cpr.c                     |   6 +-
hw/vfio/pci.c                     |   5 +-
hw/virtio/vhost-kernel.c          |   6 ++
hw/virtio/vhost-vsock.c           | 218 +++++++++++++++++++++++++++++++++++---
hw/virtio/vhost.c                 |  57 +++++++---
include/hw/vfio/vfio-cpr.h        |   6 +-
include/hw/virtio/vhost-backend.h |   2 +
include/hw/virtio/vhost-vsock.h   |   2 +
include/hw/virtio/vhost.h         |  61 +++++++++++
include/migration/cpr.h           |   2 +-
migration/cpr.c                   |  55 ++++++----
migration/options.c               |   7 ++
system/physmem.c                  |   5 +-
tests/qtest/migration/cpr-tests.c |  36 ++++++-
tests/unit/meson.build            |   1 +
tests/unit/test-cpr.c             |  98 +++++++++++++++++
21 files changed, 536 insertions(+), 72 deletions(-)
[PATCH v5 00/14] migration/cpr: support vhost-vsock devices
Posted by Andrey Drobyshev 1 week, 5 days ago
v4 -> v5:

  * Patches 1-4 (NEW): fix bugs discussed in v4 thread
    - migration/cpr: forbid saving duplicate CprFds into hash table
    - migration: forbid snapshots in CPR migration modes
    - add tests for both

  * Patch 2 -> 6 ("vhost: add vhost_reset_owner op"): add separate
    vhost_reset_owner_op typedef;

  * Patch 4 -> 8 ("vhost-vsock: fix FD leak in realize()"): add Fixes tags;

  * Patch 5 -> 9 ("vhost-vsock: preserve vhost FD during CPR"):
    - add "vhost-vsock/" prefix to CPR key;
    - fail .realize() if cpr_save_fd() fails;

  * Patch 7 -> 11 ("vhost: make vhost_dev_cleanup() safe on a partially
    initialized device"): reword commit message;

  * Patch 8 -> 12 ("vhost: add vhost_dev_set_owner() /
    vhost_dev_reset_owner() helpers"): split in-comment docs;

  * Patch 10 -> 14 ("vhost-vsock: hand off device ownership across CPR"):
    - drop FAILED notifier;
    - re-acquire ownership in vhost_vsock_set_status() start path;
    - gate RESET_OWNER in .pre_save() on migration_is_running();
    - add cpr_delete_fd() on every error path;
    - print strerror() instead of raw errno in error messages;
    - reword commit message.

v4: https://lore.kernel.org/qemu-devel/20260820113955.509478-1-andrey.drobyshev@virtuozzo.com

Signed-off-by: Andrey Drobyshev <andrey.drobyshev@virtuozzo.com>
---
Andrey Drobyshev (14):
      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
      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-vsock: hand off device ownership across CPR

 backends/hostmem-memfd.c          |   5 +-
 backends/hostmem-shm.c            |   5 +-
 backends/iommufd.c                |   4 +-
 hw/vfio/container-legacy.c        |  17 +--
 hw/vfio/cpr-legacy.c              |  10 +-
 hw/vfio/cpr.c                     |   6 +-
 hw/vfio/pci.c                     |   5 +-
 hw/virtio/vhost-kernel.c          |   6 ++
 hw/virtio/vhost-vsock.c           | 218 +++++++++++++++++++++++++++++++++++---
 hw/virtio/vhost.c                 |  57 +++++++---
 include/hw/vfio/vfio-cpr.h        |   6 +-
 include/hw/virtio/vhost-backend.h |   2 +
 include/hw/virtio/vhost-vsock.h   |   2 +
 include/hw/virtio/vhost.h         |  61 +++++++++++
 include/migration/cpr.h           |   2 +-
 migration/cpr.c                   |  55 ++++++----
 migration/options.c               |   7 ++
 system/physmem.c                  |   5 +-
 tests/qtest/migration/cpr-tests.c |  36 ++++++-
 tests/unit/meson.build            |   1 +
 tests/unit/test-cpr.c             |  98 +++++++++++++++++
 21 files changed, 536 insertions(+), 72 deletions(-)
---
base-commit: 35500e5c41aec76cde59befe750600dac7a9e37a
change-id: 20260908-up-vsock-vhost-v5-c781b39f1c1a

Best regards,
--  
Andrey Drobyshev <andrey.drobyshev@virtuozzo.com>