From: Paolo Bonzini <pbonzini@redhat.com>
To: "Daniel P. Berrangé" <berrange@redhat.com>, qemu-devel@nongnu.org
Cc: Markus Armbruster <armbru@redhat.com>,
Eduardo Habkost <eduardo@habkost.net>
Subject: Re: [PATCH] qom: use ERRP_GUARD in user_creatable_complete
Date: Fri, 19 Sep 2025 12:33:01 +0200 [thread overview]
Message-ID: <230e44a6-8e8f-4ff8-99a3-7e1438dc84ee@redhat.com> (raw)
In-Reply-To: <20250919101504.1503735-1-berrange@redhat.com>
On 9/19/25 12:15, Daniel P. Berrangé wrote:
> With error_propagate, the stack trace from any error_abort/fatal
> usage will start from the error_propagate() call, which is largely
> useless. Using ERRP_GUARD ensures the stack trace starts from
> the origin that reported the error.
>
> Signed-off-by: Daniel P. Berrangé <berrange@redhat.com>
> ---
> qom/object_interfaces.c | 7 +++----
> 1 file changed, 3 insertions(+), 4 deletions(-)
>
> diff --git a/qom/object_interfaces.c b/qom/object_interfaces.c
> index 1ffea1a728..415cbee8c5 100644
> --- a/qom/object_interfaces.c
> +++ b/qom/object_interfaces.c
> @@ -24,13 +24,12 @@
> bool user_creatable_complete(UserCreatable *uc, Error **errp)
> {
> UserCreatableClass *ucc = USER_CREATABLE_GET_CLASS(uc);
> - Error *err = NULL;
> + ERRP_GUARD();
>
> if (ucc->complete) {
> - ucc->complete(uc, &err);
> - error_propagate(errp, err);
> + ucc->complete(uc, errp);
> }
> - return !err;
> + return !*errp;
> }
>
> bool user_creatable_can_be_deleted(UserCreatable *uc)
Reviewed-by: Paolo Bonzini <pbonzini@redhat.com>
Paolo
next prev parent reply other threads:[~2025-09-19 10:34 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-09-19 10:15 [PATCH] qom: use ERRP_GUARD in user_creatable_complete Daniel P. Berrangé
2025-09-19 10:33 ` Paolo Bonzini [this message]
2025-09-19 11:30 ` Markus Armbruster
2025-09-19 11:41 ` Daniel P. Berrangé
2025-09-19 12:06 ` Markus Armbruster
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=230e44a6-8e8f-4ff8-99a3-7e1438dc84ee@redhat.com \
--to=pbonzini@redhat.com \
--cc=armbru@redhat.com \
--cc=berrange@redhat.com \
--cc=eduardo@habkost.net \
--cc=qemu-devel@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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).