spapr/xive: Rework error handling of kvmppc_xive_cpu_connect()
commit3885ca66881f1d2568e169dcbf793fd493146d14
authorGreg Kurz <groug@kaod.org>
Mon, 10 Aug 2020 16:54:05 +0000 (10 18:54 +0200)
committerDavid Gibson <david@gibson.dropbear.id.au>
Thu, 13 Aug 2020 11:00:52 +0000 (13 21:00 +1000)
tree0e508949f339939b6137a640a4ed832b117f0384
parent4a6891b838e4914d25ab97a2a03f946e3c085a8f
spapr/xive: Rework error handling of kvmppc_xive_cpu_connect()

Use error_setg_errno() instead of error_setg(strerror()). While here,
use -ret instead of errno since kvm_vcpu_enable_cap() returns a negative
errno on failure.

Use ERRP_GUARD() to ensure that errp can be passed to error_append_hint(),
and get rid of the local_err boilerplate.

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: <159707844549.1489912.4862921680328017645.stgit@bahia.lan>
Signed-off-by: David Gibson <david@gibson.dropbear.id.au>
hw/intc/spapr_xive_kvm.c
include/hw/ppc/xive.h