[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PULL 15/18] spapr: Use error_append_hint() in spapr_reallocate_hpt()
From: |
David Gibson |
Subject: |
[PULL 15/18] spapr: Use error_append_hint() in spapr_reallocate_hpt() |
Date: |
Wed, 28 Oct 2020 01:17:32 +1100 |
From: Greg Kurz <groug@kaod.org>
Hints should be added with the dedicated error_append_hint() API
because we don't want to print them when using QMP. This requires
to insert ERRP_GUARD as explained in "qapi/error.h".
Signed-off-by: Greg Kurz <groug@kaod.org>
Message-Id: <160371604030.305923.17464161378167312662.stgit@bahia.lan>
Signed-off-by: David Gibson <david@gibson.dropbear.id.au>
---
hw/ppc/spapr.c | 8 +++++---
1 file changed, 5 insertions(+), 3 deletions(-)
diff --git a/hw/ppc/spapr.c b/hw/ppc/spapr.c
index 0cc19b5863..ba0894e73a 100644
--- a/hw/ppc/spapr.c
+++ b/hw/ppc/spapr.c
@@ -1486,6 +1486,7 @@ void spapr_free_hpt(SpaprMachineState *spapr)
void spapr_reallocate_hpt(SpaprMachineState *spapr, int shift,
Error **errp)
{
+ ERRP_GUARD();
long rc;
/* Clean up any HPT info from a previous boot */
@@ -1500,17 +1501,18 @@ void spapr_reallocate_hpt(SpaprMachineState *spapr, int
shift,
if (rc < 0) {
/* kernel-side HPT needed, but couldn't allocate one */
- error_setg_errno(errp, errno,
- "Failed to allocate KVM HPT of order %d (try smaller
maxmem?)",
+ error_setg_errno(errp, errno, "Failed to allocate KVM HPT of order %d",
shift);
+ error_append_hint(errp, "Try smaller maxmem?\n");
/* This is almost certainly fatal, but if the caller really
* wants to carry on with shift == 0, it's welcome to try */
} else if (rc > 0) {
/* kernel-side HPT allocated */
if (rc != shift) {
error_setg(errp,
- "Requested order %d HPT, but kernel allocated order %ld
(try smaller maxmem?)",
+ "Requested order %d HPT, but kernel allocated order
%ld",
shift, rc);
+ error_append_hint(errp, "Try smaller maxmem?\n");
}
spapr->htab_shift = shift;
--
2.26.2
- [PULL 03/18] hw/net: move allocation to the heap due to very large stack frame, (continued)
- [PULL 03/18] hw/net: move allocation to the heap due to very large stack frame, David Gibson, 2020/10/27
- [PULL 06/18] spapr: Unrealize vCPUs with qdev_unrealize(), David Gibson, 2020/10/27
- [PULL 08/18] spapr: Make spapr_cpu_core_unrealize() idempotent, David Gibson, 2020/10/27
- [PULL 07/18] spapr: Drop spapr_delete_vcpu() unused argument, David Gibson, 2020/10/27
- [PULL 13/18] spapr: Pass &error_abort when getting some PC DIMM properties, David Gibson, 2020/10/27
- [PULL 05/18] spapr: Fix leak of CPU machine specific data, David Gibson, 2020/10/27
- [PULL 11/18] spapr: Use appropriate getter for PC_DIMM_ADDR_PROP, David Gibson, 2020/10/27
- [PULL 09/18] spapr: Simplify spapr_cpu_core_realize() and spapr_cpu_core_unrealize(), David Gibson, 2020/10/27
- [PULL 12/18] spapr: Use appropriate getter for PC_DIMM_SLOT_PROP, David Gibson, 2020/10/27
- [PULL 10/18] pc-dimm: Drop @errp argument of pc_dimm_plug(), David Gibson, 2020/10/27
- [PULL 15/18] spapr: Use error_append_hint() in spapr_reallocate_hpt(),
David Gibson <=
- [PULL 16/18] target/ppc: Fix kvmppc_load_htab_chunk() error reporting, David Gibson, 2020/10/27
- [PULL 14/18] spapr: Simplify error handling in spapr_memory_plug(), David Gibson, 2020/10/27
- [PULL 18/18] ppc/: fix some comment spelling errors, David Gibson, 2020/10/27
- [PULL 17/18] spapr: Improve spapr_reallocate_hpt() error reporting, David Gibson, 2020/10/27
- Re: [PULL 00/18] ppc-for-5.2 queue 20201028, Peter Maydell, 2020/10/30