mbox series

[v6,0/7] VFIO migration related refactor and bug fix

Message ID 20230703071510.160712-1-zhenzhong.duan@intel.com (mailing list archive)
Headers show
Series VFIO migration related refactor and bug fix | expand

Message

Duan, Zhenzhong July 3, 2023, 7:15 a.m. UTC
Hello,

PATCH4,6,7 refactors the VFIO migration blocker related code based on
suggestions from Joao and Cedric, so that code is simpler and
redundant "Migration disabled" isn't printed.

But before that works, also found some hotplug bugs when testing
blocker adding failed case. PATCH1-3,5 fix them.

See patch description for details.

v6: Update patch description with Joao suggested words
    Move rename patch to last and keep int return type for internal
    functions per Joao
    Move a check out from vfio_migration_deinit()
    Add Reviewed-by
v5: PATCH1-2 are not sent in v5 as Cedric already picked them
    Minor adjust on PATCH3 per Joao and Cedric
    Move PATCH4 after refactor patch per Joao
    Split refactor patch to three patches, PATCH4,5,7 per Cedric

v4: Rebased on [1] which contains Avihai's patchset [2]
    Add more patches to fix resource leak issue, split based on
    different fix TAG per Joao
    Change to not print "Migration disabled" with explicit
    enable-migration=off per Avihai
    Rename vfio_block_giommu_migration to vfio_viommu_preset per Joao

v3: Add PATCH1,2 to fix hotplug bug
    Fix bugs in PATCH3 Avihai and Joao pointed out

Tested vfio hotplug/unplug with vfio migration supported and unsupported cases,
and different param of enable-migration=[on/off/auto] and -only-migratable.

[1] https://github.com/legoater/qemu/tree/vfio-next
[2] https://lists.nongnu.org/archive/html/qemu-devel/2023-06/msg06117.html

Thanks

Zhenzhong Duan (5):
  vfio/pci: Disable INTx in vfio_realize error path
  vfio/migration: Change vIOMMU blocker from global to per device
  vfio/migration: Free resources when vfio_migration_realize fails
  vfio/migration: Remove print of "Migration disabled"
  vfio/migration: Return bool type for vfio_migration_realize()

 hw/vfio/common.c              | 51 ++---------------------------------
 hw/vfio/migration.c           | 51 ++++++++++++++++++++++++-----------
 hw/vfio/pci.c                 |  9 ++++---
 include/hw/vfio/vfio-common.h |  5 ++--
 4 files changed, 44 insertions(+), 72 deletions(-)