target/ppc: Fix kvmppc_load_htab_chunk() error reporting
commit0a06e4d6267ca150d62fbc371afab2fbb5586cb8
authorGreg Kurz <groug@kaod.org>
Mon, 26 Oct 2020 12:40:47 +0000 (26 13:40 +0100)
committerDavid Gibson <david@gibson.dropbear.id.au>
Tue, 27 Oct 2020 14:08:53 +0000 (28 01:08 +1100)
treed048ac9766c0e3a278b646fa163c836f69da99ec
parentc3e051ed6d2a0337fa5172d27231a193f18f92c4
target/ppc: Fix kvmppc_load_htab_chunk() error reporting

If kvmppc_load_htab_chunk() fails, its return value is propagated up
to vmstate_load(). It should thus be a negative errno, not -1 (which
maps to EPERM and would lure the user into thinking that the problem
is necessarily related to a lack of privilege).

Return the error reported by KVM or ENOSPC in case of short write.
While here, propagate the error message through an @errp argument
and have the caller to print it with error_report_err() instead
of relying on fprintf().

Signed-off-by: Greg Kurz <groug@kaod.org>
Message-Id: <160371604713.305923.5264900354159029580.stgit@bahia.lan>
Reviewed-by: Philippe Mathieu-Daudé <philmd@redhat.com>
Signed-off-by: David Gibson <david@gibson.dropbear.id.au>
hw/ppc/spapr.c
target/ppc/kvm.c
target/ppc/kvm_ppc.h