On Mon, Nov 11, 2024 at 03:55:52PM +0000, Daniel P. Berrangé wrote: > Since object_new() will assert(), it should only be used in scenarios > where the caller knows exactly what type it is asking to be created, > and can thus be confident in avoiding abstract types. > > Enforce this by using a macro wrapper which types to paste "" to the > type name. This will generate a compile error if not passed a static > const string, forcing callers to use object_new_dynamic() instead. > > Signed-off-by: Daniel P. Berrangé <berra...@redhat.com>
Reviewed-by: Peter Xu <pet...@redhat.com> -- Peter Xu