aboutsummaryrefslogtreecommitdiff
path: root/target
diff options
context:
space:
mode:
authorPeter Maydell <peter.maydell@linaro.org>2021-08-27 09:57:28 +0100
committerPeter Maydell <peter.maydell@linaro.org>2021-08-27 09:57:28 +0100
commit0289f62335b2af49f6c30296cc00d009995b35f6 (patch)
tree02681ec7cfe183e7db19e53785acd4dd69e37f00 /target
parentf214d8e0150766c31172e16ef4b17674f549d852 (diff)
parentf9dfae9cb6b27649085f662a863f6167650402e0 (diff)
downloadqemu-0289f62335b2af49f6c30296cc00d009995b35f6.zip
qemu-0289f62335b2af49f6c30296cc00d009995b35f6.tar.gz
qemu-0289f62335b2af49f6c30296cc00d009995b35f6.tar.bz2
Merge remote-tracking branch 'remotes/armbru/tags/pull-error-2021-08-26' into staging
Error reporting patches for 2021-08-26 # gpg: Signature made Thu 26 Aug 2021 16:17:05 BST # gpg: using RSA key 354BC8B3D7EB2A6B68674E5F3870B400EB918653 # gpg: issuer "armbru@redhat.com" # gpg: Good signature from "Markus Armbruster <armbru@redhat.com>" [full] # gpg: aka "Markus Armbruster <armbru@pond.sub.org>" [full] # Primary key fingerprint: 354B C8B3 D7EB 2A6B 6867 4E5F 3870 B400 EB91 8653 * remotes/armbru/tags/pull-error-2021-08-26: vl: Clean up -smp error handling Remove superfluous ERRP_GUARD() vhost: Clean up how VhostOpts method vhost_backend_init() fails vhost: Clean up how VhostOpts method vhost_get_config() fails microvm: Drop dead error handling in microvm_machine_state_init() migration: Handle migration_incoming_setup() errors consistently migration: Unify failure check for migrate_add_blocker() whpx nvmm: Drop useless migrate_del_blocker() vfio: Avoid error_propagate() after migrate_add_blocker() i386: Never free migration blocker objects instead of sometimes vhost-scsi: Plug memory leak on migrate_add_blocker() failure multi-process: Fix pci_proxy_dev_realize() error handling spapr: Explain purpose of ->fwnmi_migration_blocker more clearly spapr: Plug memory leak when we can't add a migration blocker error: Use error_fatal to simplify obvious fatal errors (again) Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
Diffstat (limited to 'target')
-rw-r--r--target/i386/kvm/kvm.c9
-rw-r--r--target/i386/nvmm/nvmm-all.c4
-rw-r--r--target/i386/sev.c8
-rw-r--r--target/i386/whpx/whpx-all.c4
4 files changed, 6 insertions, 19 deletions
diff --git a/target/i386/kvm/kvm.c b/target/i386/kvm/kvm.c
index e69abe4..500d2e0 100644
--- a/target/i386/kvm/kvm.c
+++ b/target/i386/kvm/kvm.c
@@ -1435,9 +1435,8 @@ static int hyperv_init_vcpu(X86CPU *cpu)
"'hv-passthrough' CPU flag prevents migration, use explicit"
" set of hv-* flags instead");
ret = migrate_add_blocker(hv_passthrough_mig_blocker, &local_err);
- if (local_err) {
+ if (ret < 0) {
error_report_err(local_err);
- error_free(hv_passthrough_mig_blocker);
return ret;
}
}
@@ -1450,9 +1449,8 @@ static int hyperv_init_vcpu(X86CPU *cpu)
" make sure SMT is disabled and/or that vCPUs are properly"
" pinned)");
ret = migrate_add_blocker(hv_no_nonarch_cs_mig_blocker, &local_err);
- if (local_err) {
+ if (ret < 0) {
error_report_err(local_err);
- error_free(hv_no_nonarch_cs_mig_blocker);
return ret;
}
}
@@ -1890,9 +1888,8 @@ int kvm_arch_init_vcpu(CPUState *cs)
"State blocked by non-migratable CPU device"
" (invtsc flag)");
r = migrate_add_blocker(invtsc_mig_blocker, &local_err);
- if (local_err) {
+ if (r < 0) {
error_report_err(local_err);
- error_free(invtsc_mig_blocker);
return r;
}
}
diff --git a/target/i386/nvmm/nvmm-all.c b/target/i386/nvmm/nvmm-all.c
index dfa690d..28dee4c 100644
--- a/target/i386/nvmm/nvmm-all.c
+++ b/target/i386/nvmm/nvmm-all.c
@@ -926,10 +926,8 @@ nvmm_init_vcpu(CPUState *cpu)
error_setg(&nvmm_migration_blocker,
"NVMM: Migration not supported");
- (void)migrate_add_blocker(nvmm_migration_blocker, &local_error);
- if (local_error) {
+ if (migrate_add_blocker(nvmm_migration_blocker, &local_error) < 0) {
error_report_err(local_error);
- migrate_del_blocker(nvmm_migration_blocker);
error_free(nvmm_migration_blocker);
return -EINVAL;
}
diff --git a/target/i386/sev.c b/target/i386/sev.c
index 83df8c0..0b2c8f5 100644
--- a/target/i386/sev.c
+++ b/target/i386/sev.c
@@ -737,7 +737,6 @@ static void
sev_launch_finish(SevGuestState *sev)
{
int ret, error;
- Error *local_err = NULL;
trace_kvm_sev_launch_finish();
ret = sev_ioctl(sev->sev_fd, KVM_SEV_LAUNCH_FINISH, 0, &error);
@@ -752,12 +751,7 @@ sev_launch_finish(SevGuestState *sev)
/* add migration blocker */
error_setg(&sev_mig_blocker,
"SEV: Migration is not implemented");
- ret = migrate_add_blocker(sev_mig_blocker, &local_err);
- if (local_err) {
- error_report_err(local_err);
- error_free(sev_mig_blocker);
- exit(1);
- }
+ migrate_add_blocker(sev_mig_blocker, &error_fatal);
}
static void
diff --git a/target/i386/whpx/whpx-all.c b/target/i386/whpx/whpx-all.c
index f832f28..3e925b9 100644
--- a/target/i386/whpx/whpx-all.c
+++ b/target/i386/whpx/whpx-all.c
@@ -1346,10 +1346,8 @@ int whpx_init_vcpu(CPUState *cpu)
"State blocked due to non-migratable CPUID feature support,"
"dirty memory tracking support, and XSAVE/XRSTOR support");
- (void)migrate_add_blocker(whpx_migration_blocker, &local_error);
- if (local_error) {
+ if (migrate_add_blocker(whpx_migration_blocker, &local_error) < 0) {
error_report_err(local_error);
- migrate_del_blocker(whpx_migration_blocker);
error_free(whpx_migration_blocker);
ret = -EINVAL;
goto error;