summaryrefslogtreecommitdiffstats
path: root/backends
diff options
context:
space:
mode:
authorMarkus Armbruster2021-07-20 14:54:01 +0200
committerMarkus Armbruster2021-08-26 17:15:28 +0200
commit436c831a281ed950110dbc3e3baea24054c37298 (patch)
treeba538a264b92b5598ec31e177423335f59b22738 /backends
parentwhpx nvmm: Drop useless migrate_del_blocker() (diff)
downloadqemu-436c831a281ed950110dbc3e3baea24054c37298.tar.gz
qemu-436c831a281ed950110dbc3e3baea24054c37298.tar.xz
qemu-436c831a281ed950110dbc3e3baea24054c37298.zip
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 'backends')
-rw-r--r--backends/tpm/tpm_emulator.c3
1 files changed, 1 insertions, 2 deletions
diff --git a/backends/tpm/tpm_emulator.c b/backends/tpm/tpm_emulator.c
index e5f1063ab6..f8095d23d5 100644
--- a/backends/tpm/tpm_emulator.c
+++ b/backends/tpm/tpm_emulator.c
@@ -492,8 +492,7 @@ static int tpm_emulator_block_migration(TPMEmulator *tpm_emu)
error_setg(&tpm_emu->migration_blocker,
"Migration disabled: TPM emulator does not support "
"migration");
- migrate_add_blocker(tpm_emu->migration_blocker, &err);
- if (err) {
+ if (migrate_add_blocker(tpm_emu->migration_blocker, &err) < 0) {
error_report_err(err);
error_free(tpm_emu->migration_blocker);
tpm_emu->migration_blocker = NULL;