aboutsummaryrefslogtreecommitdiff
path: root/hw/ppc
diff options
context:
space:
mode:
authorGreg Kurz <groug@kaod.org>2017-09-15 15:16:10 +0200
committerDavid Gibson <david@gibson.dropbear.id.au>2017-09-27 13:05:41 +1000
commit82be8e7394b31fd2d740651365b8ebdd0c847529 (patch)
treec762b6a2511d090f6c485d0b9d5e876308de35b0 /hw/ppc
parent58b62835863db2164002ad843455045c29bcb029 (diff)
downloadqemu-82be8e7394b31fd2d740651365b8ebdd0c847529.zip
qemu-82be8e7394b31fd2d740651365b8ebdd0c847529.tar.gz
qemu-82be8e7394b31fd2d740651365b8ebdd0c847529.tar.bz2
ppc/kvm: change kvmppc_get_htab_fd() to return -errno on error
When kvmppc_get_htab_fd() fails, its return value is propagated up to qemu_savevm_state_iterate() or to qemu_savevm_state_complete_precopy(). All savevm handlers expect to receive a negative errno on error. Let's patch kvmppc_get_htab_fd() accordingly. While here, let's change htab_load() in the spapr code to also propagate the error, since it doesn't make sense to abort() if we couldn't get the htab fd from KVM. Signed-off-by: Greg Kurz <groug@kaod.org> Signed-off-by: David Gibson <david@gibson.dropbear.id.au>
Diffstat (limited to 'hw/ppc')
-rw-r--r--hw/ppc/spapr.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/hw/ppc/spapr.c b/hw/ppc/spapr.c
index 17ea776..ec0ea7b 100644
--- a/hw/ppc/spapr.c
+++ b/hw/ppc/spapr.c
@@ -1218,7 +1218,7 @@ static int get_htab_fd(sPAPRMachineState *spapr)
spapr->htab_fd = kvmppc_get_htab_fd(false);
if (spapr->htab_fd < 0) {
error_report("Unable to open fd for reading hash table from KVM: %s",
- strerror(errno));
+ strerror(spapr->htab_fd));
}
return spapr->htab_fd;
@@ -1958,7 +1958,8 @@ static int htab_load(QEMUFile *f, void *opaque, int version_id)
fd = kvmppc_get_htab_fd(true);
if (fd < 0) {
error_report("Unable to open fd to restore KVM hash table: %s",
- strerror(errno));
+ strerror(fd));
+ return fd;
}
}