[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PULL 27/40] spapr/xive: Rework error handling of kvmppc_xive_source_res
From: |
David Gibson |
Subject: |
[PULL 27/40] spapr/xive: Rework error handling of kvmppc_xive_source_reset() |
Date: |
Tue, 18 Aug 2020 14:19:09 +1000 |
From: Greg Kurz <groug@kaod.org>
Since kvmppc_xive_source_reset_one() has a return value, convert
kvmppc_xive_source_reset() to use it for error checking. This
allows to get rid of the local_err boiler plate.
Propagate the return value so that callers may use it as well to check
failures.
Signed-off-by: Greg Kurz <groug@kaod.org>
Message-Id: <159707845245.1489912.9151822670764690034.stgit@bahia.lan>
Signed-off-by: David Gibson <david@gibson.dropbear.id.au>
---
hw/intc/spapr_xive_kvm.c | 13 +++++++------
1 file changed, 7 insertions(+), 6 deletions(-)
diff --git a/hw/intc/spapr_xive_kvm.c b/hw/intc/spapr_xive_kvm.c
index aa1a2f9153..d801bf5cd1 100644
--- a/hw/intc/spapr_xive_kvm.c
+++ b/hw/intc/spapr_xive_kvm.c
@@ -248,24 +248,25 @@ int kvmppc_xive_source_reset_one(XiveSource *xsrc, int
srcno, Error **errp)
true, errp);
}
-static void kvmppc_xive_source_reset(XiveSource *xsrc, Error **errp)
+static int kvmppc_xive_source_reset(XiveSource *xsrc, Error **errp)
{
SpaprXive *xive = SPAPR_XIVE(xsrc->xive);
int i;
for (i = 0; i < xsrc->nr_irqs; i++) {
- Error *local_err = NULL;
+ int ret;
if (!xive_eas_is_valid(&xive->eat[i])) {
continue;
}
- kvmppc_xive_source_reset_one(xsrc, i, &local_err);
- if (local_err) {
- error_propagate(errp, local_err);
- return;
+ ret = kvmppc_xive_source_reset_one(xsrc, i, errp);
+ if (ret < 0) {
+ return ret;
}
}
+
+ return 0;
}
/*
--
2.26.2
- [PULL 13/40] target/ppc: add vmulh{su}w instructions, (continued)
- [PULL 13/40] target/ppc: add vmulh{su}w instructions, David Gibson, 2020/08/18
- [PULL 18/40] spapr: Clarify error and documentation for broken KVM XICS, David Gibson, 2020/08/18
- [PULL 15/40] target/ppc: Fix SPE unavailable exception triggering, David Gibson, 2020/08/18
- [PULL 17/40] docs: Update POWER9 XIVE support for nested guests, David Gibson, 2020/08/18
- [PULL 19/40] spapr/xive: Fix xive->fd if kvm_create_device() fails, David Gibson, 2020/08/18
- [PULL 22/40] ppc/xive: Rework setup of XiveSource::esb_mmio, David Gibson, 2020/08/18
- [PULL 23/40] ppc/xive: Introduce dedicated kvm_irqchip_in_kernel() wrappers, David Gibson, 2020/08/18
- [PULL 20/40] spapr/xive: Simplify kvmppc_xive_disconnect(), David Gibson, 2020/08/18
- [PULL 21/40] target/ppc: Integrate icount to purr, vtb, and tbu40, David Gibson, 2020/08/18
- [PULL 24/40] spapr/xive: Convert KVM device fd checks to assert(), David Gibson, 2020/08/18
- [PULL 27/40] spapr/xive: Rework error handling of kvmppc_xive_source_reset(),
David Gibson <=
- [PULL 26/40] spapr/xive: Rework error handling of kvmppc_xive_cpu_connect(), David Gibson, 2020/08/18
- [PULL 25/40] spapr: Simplify error handling in spapr_phb_realize(), David Gibson, 2020/08/18
- [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