[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PULL 35/40] ppc/xive: Fix error handling in vmstate_xive_tctx_*() callb
From: |
David Gibson |
Subject: |
[PULL 35/40] ppc/xive: Fix error handling in vmstate_xive_tctx_*() callbacks |
Date: |
Tue, 18 Aug 2020 14:19:17 +1000 |
From: Greg Kurz <groug@kaod.org>
Now that kvmppc_xive_cpu_get_state() and kvmppc_xive_cpu_set_state()
return negative errnos on failures, use that instead local_err because
it is the recommended practice. Also return that instead of -1 since
vmstate expects negative errnos.
Signed-off-by: Greg Kurz <groug@kaod.org>
Message-Id: <159707850840.1489912.14912810818646455474.stgit@bahia.lan>
Signed-off-by: David Gibson <david@gibson.dropbear.id.au>
---
hw/intc/xive.c | 14 ++++++++------
1 file changed, 8 insertions(+), 6 deletions(-)
diff --git a/hw/intc/xive.c b/hw/intc/xive.c
index a453e8f4dc..17ca5a1916 100644
--- a/hw/intc/xive.c
+++ b/hw/intc/xive.c
@@ -695,12 +695,13 @@ static int vmstate_xive_tctx_pre_save(void *opaque)
{
XiveTCTX *tctx = XIVE_TCTX(opaque);
Error *local_err = NULL;
+ int ret;
if (xive_in_kernel(tctx->xptr)) {
- kvmppc_xive_cpu_get_state(tctx, &local_err);
- if (local_err) {
+ ret = kvmppc_xive_cpu_get_state(tctx, &local_err);
+ if (ret < 0) {
error_report_err(local_err);
- return -1;
+ return ret;
}
}
@@ -711,16 +712,17 @@ static int vmstate_xive_tctx_post_load(void *opaque, int
version_id)
{
XiveTCTX *tctx = XIVE_TCTX(opaque);
Error *local_err = NULL;
+ int ret;
if (xive_in_kernel(tctx->xptr)) {
/*
* Required for hotplugged CPU, for which the state comes
* after all states of the machine.
*/
- kvmppc_xive_cpu_set_state(tctx, &local_err);
- if (local_err) {
+ ret = kvmppc_xive_cpu_set_state(tctx, &local_err);
+ if (ret < 0) {
error_report_err(local_err);
- return -1;
+ return ret;
}
}
--
2.26.2
- [PULL 29/40] spapr/xive: Rework error handling of kvmppc_xive_cpu_[gs]et_state(), (continued)
- [PULL 29/40] spapr/xive: Rework error handling of kvmppc_xive_cpu_[gs]et_state(), David Gibson, 2020/08/18
- [PULL 28/40] spapr/xive: Rework error handling of kvmppc_xive_mmap(), David Gibson, 2020/08/18
- [PULL 37/40] ppc/xive: Simplify error handling in xive_tctx_realize(), David Gibson, 2020/08/18
- [PULL 30/40] spapr/xive: Rework error handling of kvmppc_xive_[gs]et_queue_config(), David Gibson, 2020/08/18
- [PULL 31/40] spapr/xive: Rework error handling in kvmppc_xive_get_queues(), David Gibson, 2020/08/18
- [PULL 39/40] nvram: Exit QEMU if NVRAM cannot contain all -prom-env data, David Gibson, 2020/08/18
- [PULL 33/40] spapr/kvm: Fix error handling in kvmppc_xive_pre_save(), David Gibson, 2020/08/18
- [PULL 36/40] spapr/xive: Simplify error handling in kvmppc_xive_connect(), David Gibson, 2020/08/18
- [PULL 38/40] spapr/xive: Simplify error handling of kvmppc_xive_cpu_synchronize_state(), David Gibson, 2020/08/18
- [PULL 32/40] spapr/xive: Rework error handling of kvmppc_xive_set_source_config(), David Gibson, 2020/08/18
- [PULL 35/40] ppc/xive: Fix error handling in vmstate_xive_tctx_*() callbacks,
David Gibson <=
- [PULL 34/40] spapr/xive: Fix error handling in kvmppc_xive_post_load(), David Gibson, 2020/08/18
- [PULL 40/40] spapr/xive: Use xive_source_esb_len(), David Gibson, 2020/08/18
- Re: [PULL 00/40] ppc-for-5.2 queue 20200818, Peter Maydell, 2020/08/23
- Re: [PULL 00/40] ppc-for-5.2 queue 20200818, Peter Maydell, 2020/08/24