ppc/xive: Simplify error handling in xive_tctx_realize()
Now that kvmppc_xive_cpu_connect() returns a negative errno on failure, use that and get rid of the local_err boilerplate. Signed-off-by: Greg Kurz <groug@kaod.org> Message-Id: <159707852234.1489912.16410314514265848075.stgit@bahia.lan> Signed-off-by: David Gibson <david@gibson.dropbear.id.au>
This commit is contained in:
parent
6cdc0e2063
commit
61203f2b35
@ -662,7 +662,6 @@ static void xive_tctx_realize(DeviceState *dev, Error **errp)
|
||||
XiveTCTX *tctx = XIVE_TCTX(dev);
|
||||
PowerPCCPU *cpu;
|
||||
CPUPPCState *env;
|
||||
Error *local_err = NULL;
|
||||
|
||||
assert(tctx->cs);
|
||||
assert(tctx->xptr);
|
||||
@ -683,9 +682,7 @@ static void xive_tctx_realize(DeviceState *dev, Error **errp)
|
||||
|
||||
/* Connect the presenter to the VCPU (required for CPU hotplug) */
|
||||
if (xive_in_kernel(tctx->xptr)) {
|
||||
kvmppc_xive_cpu_connect(tctx, &local_err);
|
||||
if (local_err) {
|
||||
error_propagate(errp, local_err);
|
||||
if (kvmppc_xive_cpu_connect(tctx, errp) < 0) {
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user