On Fri, May 08, 2026 at 07:18:29PM +0400, [email protected] wrote:
> On Fri, 08 May 2026 12:24:29 +0100, Daniel P. Berrangé <[email protected]> 
> wrote:
> > diff --git a/qom/object_interfaces.c b/qom/object_interfaces.c
> > index e0a3cd8d0f7..7080f85f95f 100644
> > --- a/qom/object_interfaces.c
> > +++ b/qom/object_interfaces.c
> > @@ -44,75 +44,11 @@ bool user_creatable_can_be_deleted(UserCreatable *uc)
> > [ ... skip 25 lines ... ]
> > -    if (!object_class_dynamic_cast(klass, TYPE_USER_CREATABLE)) {
> > -        error_setg(errp, "object type '%s' isn't supported by object-add",
> > -                   type);
> > -        return NULL;
> > -    }
> > -
> 
> It's worth to mention in the commit message that -object and object-add
> go through QAPI ObjectOptions list, and thus don't need the
> now gone TYPE_USER_CREATABLE check.

Actually I hadn't taken that into account as it doesn't matter what
the caller does in this case.

In this user_creatable_add_type method, we needed a TYPE_USER_CREATABLE
check because the method later calls 'user_creatable_complete'
unconditionally.

In the new object_new_with_prop* methods, user_creatable_complete
is conditionally called only if a cast to TYPE_USER_CREATABLE
succeeds.

With regards,
Daniel
-- 
|: https://berrange.com       ~~        https://hachyderm.io/@berrange :|
|: https://libvirt.org          ~~          https://entangle-photo.org :|
|: https://pixelfed.art/berrange   ~~    https://fstop138.berrange.com :|


Reply via email to