diff options
author | Greg Kurz | 2020-08-10 18:54:54 +0200 |
---|---|---|
committer | David Gibson | 2020-08-13 13:03:35 +0200 |
commit | 42a92d925d03ec49dfdefb43c15b46c3ca55f9e4 (patch) | |
tree | 9a99a2b9b678abf08d6de9422b22dc420cbe8b06 /hw/intc | |
parent | spapr/xive: Rework error handling of kvmppc_xive_set_source_config() (diff) | |
download | qemu-42a92d925d03ec49dfdefb43c15b46c3ca55f9e4.tar.gz qemu-42a92d925d03ec49dfdefb43c15b46c3ca55f9e4.tar.xz qemu-42a92d925d03ec49dfdefb43c15b46c3ca55f9e4.zip |
spapr/kvm: Fix error handling in kvmppc_xive_pre_save()
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>
Message-Id: <159707849455.1489912.6034461176847728064.stgit@bahia.lan>
Signed-off-by: David Gibson <david@gibson.dropbear.id.au>
Diffstat (limited to 'hw/intc')
-rw-r--r-- | hw/intc/spapr_xive_kvm.c | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/hw/intc/spapr_xive_kvm.c b/hw/intc/spapr_xive_kvm.c index f2dda69218..1686b036eb 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; |