summary refs log tree commit diff stats
diff options
context:
space:
mode:
-rw-r--r--hw/vfio/Kconfig1
-rw-r--r--hw/vfio/pci.c4
2 files changed, 4 insertions, 1 deletions
diff --git a/hw/vfio/Kconfig b/hw/vfio/Kconfig
index 34da2a3cfd..f0eaa75ce7 100644
--- a/hw/vfio/Kconfig
+++ b/hw/vfio/Kconfig
@@ -6,6 +6,7 @@ config VFIO_PCI
     bool
     default y
     select VFIO
+    select EDID
     depends on LINUX && PCI
 
 config VFIO_CCW
diff --git a/hw/vfio/pci.c b/hw/vfio/pci.c
index e6569a7968..0c55883bba 100644
--- a/hw/vfio/pci.c
+++ b/hw/vfio/pci.c
@@ -2737,9 +2737,10 @@ static void vfio_realize(PCIDevice *pdev, Error **errp)
         error_setg(&vdev->migration_blocker,
                 "VFIO device doesn't support migration");
         ret = migrate_add_blocker(vdev->migration_blocker, &err);
-        if (err) {
+        if (ret) {
             error_propagate(errp, err);
             error_free(vdev->migration_blocker);
+            vdev->migration_blocker = NULL;
             return;
         }
     }
@@ -3023,6 +3024,7 @@ error:
     if (vdev->migration_blocker) {
         migrate_del_blocker(vdev->migration_blocker);
         error_free(vdev->migration_blocker);
+        vdev->migration_blocker = NULL;
     }
 }