[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [PATCH 11/14] ppc/xive: Fix error handling in vmstate_xive_tctx_*()
From: |
David Gibson |
Subject: |
Re: [PATCH 11/14] ppc/xive: Fix error handling in vmstate_xive_tctx_*() callbacks |
Date: |
Thu, 13 Aug 2020 21:05:41 +1000 |
On Mon, Aug 10, 2020 at 06:55:08PM +0200, Greg Kurz wrote:
> 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>
Applied to ppc-for-5.2
> ---
> 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 a453e8f4dcbe..17ca5a1916b4 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;
> }
> }
>
>
>
--
David Gibson | I'll have my music baroque, and my code
david AT gibson.dropbear.id.au | minimalist, thank you. NOT _the_ _other_
| _way_ _around_!
http://www.ozlabs.org/~dgibson
signature.asc
Description: PGP signature
- Re: [PATCH 06/14] spapr/xive: Rework error handling of kvmppc_xive_[gs]et_queue_config(), (continued)
- [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, 2020/08/10
- [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
- Re: [PATCH 11/14] ppc/xive: Fix error handling in vmstate_xive_tctx_*() callbacks,
David Gibson <=
- [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