[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [PATCH v7 64/65] qom: use QAPITypeInfo in object_property_get_enum



Marc-André Lureau <marcandre.lureau@xxxxxxxxxx> writes:

> The typename parameter becomes a QAPITypeInfo pointer, and the
> validation compares prop->qapi_type against it instead of matching
> prop->type strings.
>
> Signed-off-by: Markus Armbruster <armbru@xxxxxxxxxx>
> Signed-off-by: Marc-André Lureau <marcandre.lureau@xxxxxxxxxx>

[...]

> diff --git a/qom/object.c b/qom/object.c
> index 791d981dc689..40b569d4d574 100644
> --- a/qom/object.c
> +++ b/qom/object.c
> @@ -1775,7 +1775,7 @@ uint64_t object_property_get_uint(Object *obj, const 
> char *name,
>  }
>  
>  int object_property_get_enum(Object *obj, const char *name,
> -                             const char *typename, Error **errp)
> +                             const QAPITypeInfo *type_info, Error **errp)
>  {
>      char *str;
>      int ret;
> @@ -1785,10 +1785,10 @@ int object_property_get_enum(Object *obj, const char 
> *name,
>          return -1;
>      }
>  
> -    if (!g_str_equal(prop->type, typename)) {
> +    if (prop->qapi_type != type_info) {
>          error_setg(errp, "Property %s on %s is not '%s' enum type",
> -                   name, object_class_get_name(
> -                       object_get_class(obj)), typename);
> +                   name, object_class_get_name(object_get_class(obj)),
> +                   type_info->name);

How can this happen?  Or is it a programming error?

>          return -1;
>      }
>  

[...]




 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.