spapr: fix xics_system_init() error path
commit844afc54ae229515a37f63519855661ad2d01d19
authorGreg Kurz <groug@kaod.org>
Fri, 15 Jun 2018 16:58:00 +0000 (15 18:58 +0200)
committerDavid Gibson <david@gibson.dropbear.id.au>
Sun, 17 Jun 2018 23:43:19 +0000 (18 09:43 +1000)
treebb751dd9ea88d52ac27f1182d3b3f6d445b4c2a8
parent7388efafc27c2f45d22c8edbc14b3154c0381c2e
spapr: fix xics_system_init() error path

Commit 3d85885a1b1f3 tried to fix error handling, but it actually
went into the wrong direction by dropping the local Error *.

In the default KVM case, the rationale is to try the in-kernel XICS first,
and if not possible, to fallback to userland XICS. Passing errp everywhere
makes this fallback impossible if errp is &error_fatal (which happens to
be the case). And anyway, if the caller would pass a regular &local_err,
things would be worse: we could possibly pass an already set *errp to
error_setg() and crash, or return an error even in case of success.

So we definitely need a local Error * and only propagate it when we're
done with the fallback logic. This is what this patch does.

Signed-off-by: Greg Kurz <groug@kaod.org>
Signed-off-by: David Gibson <david@gibson.dropbear.id.au>
hw/ppc/spapr.c