mbox series

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

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

Message

Duan, Zhenzhong June 30, 2023, 7:36 a.m. UTC
Hello,

PATCH4,5,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,6 fix them.

See patch description for details.

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

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: Return bool type for some vfio migration related
    functions
  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"

 hw/vfio/common.c              | 59 ++++-------------------------------
 hw/vfio/migration.c           | 59 +++++++++++++++++++++++------------
 hw/vfio/pci.c                 |  8 +++--
 include/hw/vfio/vfio-common.h |  7 ++---
 4 files changed, 53 insertions(+), 80 deletions(-)