qemu-devel
[Top][All Lists]
Advanced

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

Re: [Qemu-devel] [PATCH 0/3] Fix confused output for alias properties


From: Paolo Bonzini
Subject: Re: [Qemu-devel] [PATCH 0/3] Fix confused output for alias properties
Date: Mon, 22 Sep 2014 15:24:19 +0200
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:31.0) Gecko/20100101 Thunderbird/31.0

Il 22/09/2014 15:13, Gonglei (Arei) ha scritto:
> (I don't add alias-sepecific filed into ObjectProperty
> struct, just add a bool property. )
> 
> diff --git a/include/qom/object.h b/include/qom/object.h
> index 8a05a81..8b8ded5 100644
> --- a/include/qom/object.h
> +++ b/include/qom/object.h
> @@ -334,6 +334,11 @@ typedef void (ObjectPropertyRelease)(Object *obj,
>                                       const char *name,
>                                       void *opaque);
> 
> +typedef struct {
> +    Object *target_obj;
> +    const char *target_name;
> +} AliasProperty;
> +
>  typedef struct ObjectProperty
>  {
>      gchar *name;
> @@ -344,6 +349,8 @@ typedef struct ObjectProperty
>      ObjectPropertyRelease *release;
>      void *opaque;
> 
> +    bool is_alias;
> +
>      QTAILQ_ENTRY(ObjectProperty) node;
>  } ObjectProperty;

I don't think this is right.  If the field is called "opaque", it's
opaque.  We already had cases where we were deriving the type of the
opaque, and they caused bugs (though it was using the const char *type
field; admittedly having a separate bool is a bit cleaner).

Paolo



reply via email to

[Prev in Thread] Current Thread [Next in Thread]