aboutsummaryrefslogtreecommitdiff
path: root/hw/vfio
diff options
context:
space:
mode:
authorMarkus Armbruster <armbru@redhat.com>2021-07-20 14:53:59 +0200
committerMarkus Armbruster <armbru@redhat.com>2021-08-26 17:15:28 +0200
commiteb24a23e15580c2c6ab144a6bbf7f825506849ae (patch)
tree8ce65f145495ccece21c0e8743ebcabf86c495e8 /hw/vfio
parenta5c051b2cf11197b1663dfb470e80dbc32d77cd0 (diff)
vfio: Avoid error_propagate() after migrate_add_blocker()
When migrate_add_blocker(blocker, &err) is followed by error_propagate(errp, err), we can often just as well do migrate_add_blocker(..., errp). This is the case in vfio_migration_probe(). Prior art: commit 386f6c07d2 "error: Avoid error_propagate() after migrate_add_blocker()". Cc: Kirti Wankhede <kwankhede@nvidia.com> Cc: Alex Williamson <alex.williamson@redhat.com> Signed-off-by: Markus Armbruster <armbru@redhat.com> Message-Id: <20210720125408.387910-8-armbru@redhat.com> Reviewed-by: Philippe Mathieu-Daudé <philmd@redhat.com> Reviewed by: Kirti Wankhede <kwankhede@nvidia.com> Acked-by: Michael S. Tsirkin <mst@redhat.com>
Diffstat (limited to 'hw/vfio')
-rw-r--r--hw/vfio/migration.c6
1 files changed, 2 insertions, 4 deletions
diff --git a/hw/vfio/migration.c b/hw/vfio/migration.c
index 82f654afb6..ff6b45de6b 100644
--- a/hw/vfio/migration.c
+++ b/hw/vfio/migration.c
@@ -858,7 +858,6 @@ int vfio_migration_probe(VFIODevice *vbasedev, Error **errp)
{
VFIOContainer *container = vbasedev->group->container;
struct vfio_region_info *info = NULL;
- Error *local_err = NULL;
int ret = -ENOTSUP;
if (!vbasedev->enable_migration || !container->dirty_pages_supported) {
@@ -885,9 +884,8 @@ add_blocker:
"VFIO device doesn't support migration");
g_free(info);
- ret = migrate_add_blocker(vbasedev->migration_blocker, &local_err);
- if (local_err) {
- error_propagate(errp, local_err);
+ ret = migrate_add_blocker(vbasedev->migration_blocker, errp);
+ if (ret < 0) {
error_free(vbasedev->migration_blocker);
vbasedev->migration_blocker = NULL;
}