[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PATCH 09/14] spapr/kvm: Fix error handling in kvmppc_xive_pre_save()
From: |
Greg Kurz |
Subject: |
[PATCH 09/14] spapr/kvm: Fix error handling in kvmppc_xive_pre_save() |
Date: |
Mon, 10 Aug 2020 18:54:54 +0200 |
User-agent: |
StGit/0.21 |
Now that kvmppc_xive_get_queues() returns a negative errno on failure, check
with that because it is preferred to local_err. And most of all, propagate
it because vmstate expects negative errnos.
Signed-off-by: Greg Kurz <groug@kaod.org>
---
hw/intc/spapr_xive_kvm.c | 7 ++++---
1 file changed, 4 insertions(+), 3 deletions(-)
diff --git a/hw/intc/spapr_xive_kvm.c b/hw/intc/spapr_xive_kvm.c
index f2dda692183b..1686b036eb2d 100644
--- a/hw/intc/spapr_xive_kvm.c
+++ b/hw/intc/spapr_xive_kvm.c
@@ -604,16 +604,17 @@ void kvmppc_xive_synchronize_state(SpaprXive *xive, Error
**errp)
int kvmppc_xive_pre_save(SpaprXive *xive)
{
Error *local_err = NULL;
+ int ret;
assert(xive->fd != -1);
/* EAT: there is no extra state to query from KVM */
/* ENDT */
- kvmppc_xive_get_queues(xive, &local_err);
- if (local_err) {
+ ret = kvmppc_xive_get_queues(xive, &local_err);
+ if (ret < 0) {
error_report_err(local_err);
- return -1;
+ return ret;
}
return 0;
- [PATCH 04/14] spapr/xive: Rework error handling of kvmppc_xive_mmap(), (continued)
- [PATCH 04/14] spapr/xive: Rework error handling of kvmppc_xive_mmap(), Greg Kurz, 2020/08/10
- [PATCH 05/14] spapr/xive: Rework error handling of kvmppc_xive_cpu_[gs]et_state(), Greg Kurz, 2020/08/10
- [PATCH 06/14] spapr/xive: Rework error handling of kvmppc_xive_[gs]et_queue_config(), Greg Kurz, 2020/08/10
- [PATCH 07/14] spapr/xive: Rework error handling in kvmppc_xive_get_queues(), Greg Kurz, 2020/08/10
- [PATCH 08/14] spapr/xive: Rework error handling of kvmppc_xive_set_source_config(), Greg Kurz, 2020/08/10
- [PATCH 09/14] spapr/kvm: Fix error handling in kvmppc_xive_pre_save(),
Greg Kurz <=
- [PATCH 10/14] spapr/xive: Fix error handling in kvmppc_xive_post_load(), Greg Kurz, 2020/08/10
- [PATCH 11/14] ppc/xive: Fix error handling in vmstate_xive_tctx_*() callbacks, Greg Kurz, 2020/08/10
- [PATCH 12/14] spapr/xive: Simplify error handling in kvmppc_xive_connect(), Greg Kurz, 2020/08/10
- [PATCH 13/14] ppc/xive: Simplify error handling in xive_tctx_realize(), Greg Kurz, 2020/08/10
- [PATCH 14/14] spapr/xive: Simplify error handling of kvmppc_xive_cpu_synchronize_state(), Greg Kurz, 2020/08/10