From: David Gibson <david@gibson.dropbear.id.au>
To: Greg Kurz <groug@kaod.org>
Cc: qemu-ppc@nongnu.org, qemu-devel@nongnu.org
Subject: Re: [PATCH 2/4] spapr: Use error_append_hint() in spapr_reallocate_hpt()
Date: Tue, 27 Oct 2020 12:57:34 +1100 [thread overview]
Message-ID: <20201027015734.GC4671@yekko.fritz.box> (raw)
In-Reply-To: <160371604030.305923.17464161378167312662.stgit@bahia.lan>
[-- Attachment #1: Type: text/plain, Size: 2201 bytes --]
On Mon, Oct 26, 2020 at 01:40:40PM +0100, Greg Kurz wrote:
> 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>
Applied to ppc-for-5.2.
> ---
> 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 f098d0ee6d98..f51b663f7dcb 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;
>
>
--
David Gibson | I'll have my music baroque, and my code
david AT gibson.dropbear.id.au | minimalist, thank you. NOT _the_ _other_
| _way_ _around_!
http://www.ozlabs.org/~dgibson
[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 833 bytes --]
next prev parent reply other threads:[~2020-10-27 2:05 UTC|newest]
Thread overview: 17+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-10-26 12:40 [PATCH 0/4] spapr: Error handling fixes and cleanups (round 5) Greg Kurz
2020-10-26 12:40 ` [PATCH 1/4] spapr: qemu_memalign() doesn't return NULL Greg Kurz
2020-10-26 13:43 ` Philippe Mathieu-Daudé
2020-10-26 14:46 ` Greg Kurz
2020-10-27 1:56 ` David Gibson
2020-10-27 7:32 ` Greg Kurz
2020-10-26 12:40 ` [PATCH 2/4] spapr: Use error_append_hint() in spapr_reallocate_hpt() Greg Kurz
2020-10-27 1:57 ` David Gibson [this message]
2020-10-26 12:40 ` [PATCH 3/4] target/ppc: Fix kvmppc_load_htab_chunk() error reporting Greg Kurz
2020-10-26 13:45 ` Philippe Mathieu-Daudé
2020-10-27 2:00 ` David Gibson
2020-10-26 12:40 ` [PATCH 4/4] spapr: Improve spapr_reallocate_hpt() " Greg Kurz
2020-10-26 13:49 ` Philippe Mathieu-Daudé
2020-10-26 14:47 ` Greg Kurz
2020-10-27 8:48 ` Philippe Mathieu-Daudé
2020-10-27 2:03 ` David Gibson
2020-10-26 12:53 ` [PATCH 0/4] spapr: Error handling fixes and cleanups (round 5) Greg Kurz
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20201027015734.GC4671@yekko.fritz.box \
--to=david@gibson.dropbear.id.au \
--cc=groug@kaod.org \
--cc=qemu-devel@nongnu.org \
--cc=qemu-ppc@nongnu.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.