aboutsummaryrefslogtreecommitdiff
path: root/hw/virtio/vhost.c
diff options
context:
space:
mode:
authorMarkus Armbruster <armbru@redhat.com>2021-07-20 14:54:01 +0200
committerMarkus Armbruster <armbru@redhat.com>2021-08-26 17:15:28 +0200
commit436c831a281ed950110dbc3e3baea24054c37298 (patch)
treeba538a264b92b5598ec31e177423335f59b22738 /hw/virtio/vhost.c
parent650126f838f763fe02f5b41584fd9f13cb8cbf13 (diff)
migration: Unify failure check for migrate_add_blocker()
Most callers check the return value. Some check whether it set an error. Functionally equivalent, but the former tends to be easier on the eyes, so do that everywhere. Prior art: commit c6ecec43b2 "qemu-option: Check return value instead of @err where convenient". Signed-off-by: Markus Armbruster <armbru@redhat.com> Message-Id: <20210720125408.387910-10-armbru@redhat.com> Reviewed-by: Philippe Mathieu-Daudé <philmd@redhat.com> Acked-by: Michael S. Tsirkin <mst@redhat.com>
Diffstat (limited to 'hw/virtio/vhost.c')
-rw-r--r--hw/virtio/vhost.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/hw/virtio/vhost.c b/hw/virtio/vhost.c
index e8f85a5d2d..dbbc6b6915 100644
--- a/hw/virtio/vhost.c
+++ b/hw/virtio/vhost.c
@@ -1372,7 +1372,7 @@ int vhost_dev_init(struct vhost_dev *hdev, void *opaque,
if (hdev->migration_blocker != NULL) {
r = migrate_add_blocker(hdev->migration_blocker, errp);
- if (*errp) {
+ if (r < 0) {
error_free(hdev->migration_blocker);
goto fail_busyloop;
}