aboutsummaryrefslogtreecommitdiff
path: root/hw/vfio/migration.c
diff options
context:
space:
mode:
Diffstat (limited to 'hw/vfio/migration.c')
-rw-r--r--hw/vfio/migration.c16
1 files changed, 2 insertions, 14 deletions
diff --git a/hw/vfio/migration.c b/hw/vfio/migration.c
index da43dcd2fe..0aaad65c06 100644
--- a/hw/vfio/migration.c
+++ b/hw/vfio/migration.c
@@ -891,8 +891,6 @@ static void vfio_migration_deinit(VFIODevice *vbasedev)
static int vfio_block_migration(VFIODevice *vbasedev, Error *err, Error **errp)
{
- int ret;
-
if (vbasedev->enable_migration == ON_OFF_AUTO_ON) {
error_propagate(errp, err);
return -EINVAL;
@@ -901,13 +899,7 @@ static int vfio_block_migration(VFIODevice *vbasedev, Error *err, Error **errp)
vbasedev->migration_blocker = error_copy(err);
error_free(err);
- ret = migrate_add_blocker(vbasedev->migration_blocker, errp);
- if (ret < 0) {
- error_free(vbasedev->migration_blocker);
- vbasedev->migration_blocker = NULL;
- }
-
- return ret;
+ return migrate_add_blocker(&vbasedev->migration_blocker, errp);
}
/* ---------------------------------------------------------------------- */
@@ -994,9 +986,5 @@ void vfio_migration_exit(VFIODevice *vbasedev)
vfio_migration_deinit(vbasedev);
}
- if (vbasedev->migration_blocker) {
- migrate_del_blocker(vbasedev->migration_blocker);
- error_free(vbasedev->migration_blocker);
- vbasedev->migration_blocker = NULL;
- }
+ migrate_del_blocker(&vbasedev->migration_blocker);
}