From: Peter Xu <peterx@redhat.com>
To: "Daniel P. Berrangé" <berrange@redhat.com>
Cc: qemu-devel@nongnu.org, Paolo Bonzini <pbonzini@redhat.com>,
Markus Armbruster <armbru@redhat.com>
Subject: Re: [PATCH v2 2/8] qom: allow failure of object_new_with_class
Date: Thu, 14 Nov 2024 15:04:47 -0500 [thread overview]
Message-ID: <ZzZX39AShxOGyqrW@x1n> (raw)
In-Reply-To: <20241111155555.90091-3-berrange@redhat.com>
On Mon, Nov 11, 2024 at 03:55:49PM +0000, Daniel P. Berrangé wrote:
> Since object_new_with_class() accepts a non-const parameter for
> the class, callers should be prepared for failures from unexpected
> input. Add an Error parameter for this and make callers check.
> If the caller does not already have an Error parameter, it is
> satisfactory to use &error_abort if the class parameter choice is
> not driven by untrusted user input.
>
> This conversion allows removal of any object_class_is_abstract()
> checks immediately before object_new_with_class().
>
> Signed-off-by: Daniel P. Berrangé <berrange@redhat.com>
Reviewed-by: Peter Xu <peterx@redhat.com>
--
Peter Xu
next prev parent reply other threads:[~2024-11-14 20:05 UTC|newest]
Thread overview: 18+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-11-11 15:55 [PATCH v2 0/8] Require error handling for dynamically created objects Daniel P. Berrangé
2024-11-11 15:55 ` [PATCH v2 1/8] qom: refactor checking abstract property when creating instances Daniel P. Berrangé
2024-11-14 19:58 ` Peter Xu
2024-11-15 10:41 ` Daniel P. Berrangé
2024-11-11 15:55 ` [PATCH v2 2/8] qom: allow failure of object_new_with_class Daniel P. Berrangé
2024-11-14 20:04 ` Peter Xu [this message]
2024-11-11 15:55 ` [PATCH v2 3/8] qom: introduce object_new_dynamic() Daniel P. Berrangé
2024-11-14 20:15 ` Peter Xu
2024-11-11 15:55 ` [PATCH v2 4/8] convert code to object_new_dynamic() where appropriate Daniel P. Berrangé
2024-11-14 20:24 ` Peter Xu
2024-11-11 15:55 ` [PATCH v2 5/8] qom: enforce use of static, const string with object_new() Daniel P. Berrangé
2024-11-14 20:28 ` Peter Xu
2024-11-11 15:55 ` [PATCH v2 6/8] qom: introduce qdev_new_dynamic() Daniel P. Berrangé
2024-11-14 20:47 ` Peter Xu
2024-11-15 17:26 ` Daniel P. Berrangé
2024-11-11 15:55 ` [PATCH v2 7/8] convert code to qdev_new_dynamic() where appropriate Daniel P. Berrangé
2024-11-14 21:00 ` Peter Xu
2024-11-11 15:55 ` [PATCH v2 8/8] hw: enforce use of static, const string with qdev_new() Daniel P. Berrangé
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=ZzZX39AShxOGyqrW@x1n \
--to=peterx@redhat.com \
--cc=armbru@redhat.com \
--cc=berrange@redhat.com \
--cc=pbonzini@redhat.com \
--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).