Re: [PATCH v3 7/9] qom: introduce qdev_new_dynamic()

2024-11-15 Thread Peter Xu
On Fri, Nov 15, 2024 at 05:25:19PM +, Daniel P. Berrangé wrote: > qdev_new() has a failure scenario where it will assert() if given > an abstract type. Callers which are creating qdevs based on user > input, or unknown/untrusted type names, must manually check the > result of qdev_class_is_abst

[PATCH v3 7/9] qom: introduce qdev_new_dynamic()

2024-11-15 Thread Daniel P . Berrangé
qdev_new() has a failure scenario where it will assert() if given an abstract type. Callers which are creating qdevs based on user input, or unknown/untrusted type names, must manually check the result of qdev_class_is_abstract() before calling qdev_new() to propagate an Error, instead of asserting