qemu-devel
[Top][All Lists]
Advanced

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

Re: [PATCH v4 27/32] qdev: Rename qdev_propinfo_* to field_prop_*


From: Igor Mammedov
Subject: Re: [PATCH v4 27/32] qdev: Rename qdev_propinfo_* to field_prop_*
Date: Tue, 15 Dec 2020 15:35:58 +0100

On Fri, 11 Dec 2020 17:05:24 -0500
Eduardo Habkost <ehabkost@redhat.com> wrote:

> These functions will be moved to be part of QOM, so rename them.
> 
> Signed-off-by: Eduardo Habkost <ehabkost@redhat.com>

Reviewed-by: Igor Mammedov <imammedo@redhat.com>

> ---
> Changes v2:
> * Rename to field_prop_* instead of object_propinfo_*
> ---
> Cc: Paolo Bonzini <pbonzini@redhat.com>
> Cc: "Daniel P. Berrangé" <berrange@redhat.com>
> Cc: Eduardo Habkost <ehabkost@redhat.com>
> Cc: qemu-devel@nongnu.org
> ---
>  hw/core/qdev-prop-internal.h     | 28 +++++++--------
>  hw/core/qdev-properties-system.c | 48 ++++++++++++-------------
>  hw/core/qdev-properties.c        | 62 ++++++++++++++++----------------
>  3 files changed, 69 insertions(+), 69 deletions(-)
> 
> diff --git a/hw/core/qdev-prop-internal.h b/hw/core/qdev-prop-internal.h
> index 6f17ddf271..740a5e530b 100644
> --- a/hw/core/qdev-prop-internal.h
> +++ b/hw/core/qdev-prop-internal.h
> @@ -8,22 +8,22 @@
>  #ifndef HW_CORE_QDEV_PROP_INTERNAL_H
>  #define HW_CORE_QDEV_PROP_INTERNAL_H
>  
> -void qdev_propinfo_get_enum(Object *obj, Visitor *v, const char *name,
> -                            void *opaque, Error **errp);
> -void qdev_propinfo_set_enum(Object *obj, Visitor *v, const char *name,
> -                            void *opaque, Error **errp);
> +void field_prop_get_enum(Object *obj, Visitor *v, const char *name,
> +                         void *opaque, Error **errp);
> +void field_prop_set_enum(Object *obj, Visitor *v, const char *name,
> +                         void *opaque, Error **errp);
>  
> -void qdev_propinfo_set_default_value_enum(ObjectProperty *op,
> -                                          const Property *prop);
> -void qdev_propinfo_set_default_value_int(ObjectProperty *op,
> -                                         const Property *prop);
> -void qdev_propinfo_set_default_value_uint(ObjectProperty *op,
> -                                          const Property *prop);
> +void field_prop_set_default_value_enum(ObjectProperty *op,
> +                                       const Property *prop);
> +void field_prop_set_default_value_int(ObjectProperty *op,
> +                                      const Property *prop);
> +void field_prop_set_default_value_uint(ObjectProperty *op,
> +                                       const Property *prop);
>  
> -void qdev_propinfo_get_int32(Object *obj, Visitor *v, const char *name,
> -                             void *opaque, Error **errp);
> -void qdev_propinfo_get_size32(Object *obj, Visitor *v, const char *name,
> -                              void *opaque, Error **errp);
> +void field_prop_get_int32(Object *obj, Visitor *v, const char *name,
> +                          void *opaque, Error **errp);
> +void field_prop_get_size32(Object *obj, Visitor *v, const char *name,
> +                           void *opaque, Error **errp);
>  
>  /**
>   * object_property_add_field: Add a field property to an object instance
> diff --git a/hw/core/qdev-properties-system.c 
> b/hw/core/qdev-properties-system.c
> index f31aea3de1..590c5f3d97 100644
> --- a/hw/core/qdev-properties-system.c
> +++ b/hw/core/qdev-properties-system.c
> @@ -537,9 +537,9 @@ QEMU_BUILD_BUG_ON(sizeof(LostTickPolicy) != sizeof(int));
>  const PropertyInfo qdev_prop_losttickpolicy = {
>      .name  = "LostTickPolicy",
>      .enum_table  = &LostTickPolicy_lookup,
> -    .get   = qdev_propinfo_get_enum,
> -    .set   = qdev_propinfo_set_enum,
> -    .set_default_value = qdev_propinfo_set_default_value_enum,
> +    .get   = field_prop_get_enum,
> +    .set   = field_prop_set_enum,
> +    .set_default_value = field_prop_set_default_value_enum,
>  };
>  
>  /* --- blocksize --- */
> @@ -568,9 +568,9 @@ const PropertyInfo qdev_prop_blocksize = {
>      .name  = "size",
>      .description = "A power of two between " MIN_BLOCK_SIZE_STR
>                     " and " MAX_BLOCK_SIZE_STR,
> -    .get   = qdev_propinfo_get_size32,
> +    .get   = field_prop_get_size32,
>      .set   = set_blocksize,
> -    .set_default_value = qdev_propinfo_set_default_value_uint,
> +    .set_default_value = field_prop_set_default_value_uint,
>  };
>  
>  /* --- Block device error handling policy --- */
> @@ -582,9 +582,9 @@ const PropertyInfo qdev_prop_blockdev_on_error = {
>      .description = "Error handling policy, "
>                     "report/ignore/enospc/stop/auto",
>      .enum_table = &BlockdevOnError_lookup,
> -    .get = qdev_propinfo_get_enum,
> -    .set = qdev_propinfo_set_enum,
> -    .set_default_value = qdev_propinfo_set_default_value_enum,
> +    .get = field_prop_get_enum,
> +    .set = field_prop_set_enum,
> +    .set_default_value = field_prop_set_default_value_enum,
>  };
>  
>  /* --- BIOS CHS translation */
> @@ -596,9 +596,9 @@ const PropertyInfo qdev_prop_bios_chs_trans = {
>      .description = "Logical CHS translation algorithm, "
>                     "auto/none/lba/large/rechs",
>      .enum_table = &BiosAtaTranslation_lookup,
> -    .get = qdev_propinfo_get_enum,
> -    .set = qdev_propinfo_set_enum,
> -    .set_default_value = qdev_propinfo_set_default_value_enum,
> +    .get = field_prop_get_enum,
> +    .set = field_prop_set_enum,
> +    .set_default_value = field_prop_set_default_value_enum,
>  };
>  
>  /* --- FDC default drive types */
> @@ -608,9 +608,9 @@ const PropertyInfo qdev_prop_fdc_drive_type = {
>      .description = "FDC drive type, "
>                     "144/288/120/none/auto",
>      .enum_table = &FloppyDriveType_lookup,
> -    .get = qdev_propinfo_get_enum,
> -    .set = qdev_propinfo_set_enum,
> -    .set_default_value = qdev_propinfo_set_default_value_enum,
> +    .get = field_prop_get_enum,
> +    .set = field_prop_set_enum,
> +    .set_default_value = field_prop_set_default_value_enum,
>  };
>  
>  /* --- MultiFDCompression --- */
> @@ -620,9 +620,9 @@ const PropertyInfo qdev_prop_multifd_compression = {
>      .description = "multifd_compression values, "
>                     "none/zlib/zstd",
>      .enum_table = &MultiFDCompression_lookup,
> -    .get = qdev_propinfo_get_enum,
> -    .set = qdev_propinfo_set_enum,
> -    .set_default_value = qdev_propinfo_set_default_value_enum,
> +    .get = field_prop_get_enum,
> +    .set = field_prop_set_enum,
> +    .set_default_value = field_prop_set_default_value_enum,
>  };
>  
>  /* --- Reserved Region --- */
> @@ -766,9 +766,9 @@ const PropertyInfo qdev_prop_pci_devfn = {
>      .name  = "int32",
>      .description = "Slot and optional function number, example: 06.0 or 06",
>      .print = print_pci_devfn,
> -    .get   = qdev_propinfo_get_int32,
> +    .get   = field_prop_get_int32,
>      .set   = set_pci_devfn,
> -    .set_default_value = qdev_propinfo_set_default_value_int,
> +    .set_default_value = field_prop_set_default_value_int,
>  };
>  
>  /* --- pci host address --- */
> @@ -882,9 +882,9 @@ const PropertyInfo qdev_prop_off_auto_pcibar = {
>      .name = "OffAutoPCIBAR",
>      .description = "off/auto/bar0/bar1/bar2/bar3/bar4/bar5",
>      .enum_table = &OffAutoPCIBAR_lookup,
> -    .get = qdev_propinfo_get_enum,
> -    .set = qdev_propinfo_set_enum,
> -    .set_default_value = qdev_propinfo_set_default_value_enum,
> +    .get = field_prop_get_enum,
> +    .set = field_prop_set_enum,
> +    .set_default_value = field_prop_set_default_value_enum,
>  };
>  
>  /* --- PCIELinkSpeed 2_5/5/8/16 -- */
> @@ -954,7 +954,7 @@ const PropertyInfo qdev_prop_pcie_link_speed = {
>      .enum_table = &PCIELinkSpeed_lookup,
>      .get = get_prop_pcielinkspeed,
>      .set = set_prop_pcielinkspeed,
> -    .set_default_value = qdev_propinfo_set_default_value_enum,
> +    .set_default_value = field_prop_set_default_value_enum,
>  };
>  
>  /* --- PCIELinkWidth 1/2/4/8/12/16/32 -- */
> @@ -1042,7 +1042,7 @@ const PropertyInfo qdev_prop_pcie_link_width = {
>      .enum_table = &PCIELinkWidth_lookup,
>      .get = get_prop_pcielinkwidth,
>      .set = set_prop_pcielinkwidth,
> -    .set_default_value = qdev_propinfo_set_default_value_enum,
> +    .set_default_value = field_prop_set_default_value_enum,
>  };
>  
>  /* --- UUID --- */
> diff --git a/hw/core/qdev-properties.c b/hw/core/qdev-properties.c
> index 8436b60ec4..d2f565f552 100644
> --- a/hw/core/qdev-properties.c
> +++ b/hw/core/qdev-properties.c
> @@ -96,8 +96,8 @@ static ObjectPropertyAccessor *field_prop_setter(const 
> PropertyInfo *info)
>      return info->set ? field_prop_set : NULL;
>  }
>  
> -void qdev_propinfo_get_enum(Object *obj, Visitor *v, const char *name,
> -                            void *opaque, Error **errp)
> +void field_prop_get_enum(Object *obj, Visitor *v, const char *name,
> +                         void *opaque, Error **errp)
>  {
>      Property *prop = opaque;
>      int *ptr = qdev_get_prop_ptr(obj, prop);
> @@ -105,8 +105,8 @@ void qdev_propinfo_get_enum(Object *obj, Visitor *v, 
> const char *name,
>      visit_type_enum(v, name, ptr, prop->info->enum_table, errp);
>  }
>  
> -void qdev_propinfo_set_enum(Object *obj, Visitor *v, const char *name,
> -                            void *opaque, Error **errp)
> +void field_prop_set_enum(Object *obj, Visitor *v, const char *name,
> +                         void *opaque, Error **errp)
>  {
>      Property *prop = opaque;
>      int *ptr = qdev_get_prop_ptr(obj, prop);
> @@ -114,8 +114,8 @@ void qdev_propinfo_set_enum(Object *obj, Visitor *v, 
> const char *name,
>      visit_type_enum(v, name, ptr, prop->info->enum_table, errp);
>  }
>  
> -void qdev_propinfo_set_default_value_enum(ObjectProperty *op,
> -                                          const Property *prop)
> +void field_prop_set_default_value_enum(ObjectProperty *op,
> +                                       const Property *prop)
>  {
>      object_property_set_default_str(op,
>          qapi_enum_lookup(prop->info->enum_table, prop->defval.i));
> @@ -123,9 +123,9 @@ void qdev_propinfo_set_default_value_enum(ObjectProperty 
> *op,
>  
>  const PropertyInfo qdev_prop_enum = {
>      .name  = "enum",
> -    .get   = qdev_propinfo_get_enum,
> -    .set   = qdev_propinfo_set_enum,
> -    .set_default_value = qdev_propinfo_set_default_value_enum,
> +    .get   = field_prop_get_enum,
> +    .set   = field_prop_set_enum,
> +    .set_default_value = field_prop_set_default_value_enum,
>  };
>  
>  /* Bit */
> @@ -278,14 +278,14 @@ static void set_uint8(Object *obj, Visitor *v, const 
> char *name, void *opaque,
>      visit_type_uint8(v, name, ptr, errp);
>  }
>  
> -void qdev_propinfo_set_default_value_int(ObjectProperty *op,
> -                                         const Property *prop)
> +void field_prop_set_default_value_int(ObjectProperty *op,
> +                                      const Property *prop)
>  {
>      object_property_set_default_int(op, prop->defval.i);
>  }
>  
> -void qdev_propinfo_set_default_value_uint(ObjectProperty *op,
> -                                          const Property *prop)
> +void field_prop_set_default_value_uint(ObjectProperty *op,
> +                                       const Property *prop)
>  {
>      object_property_set_default_uint(op, prop->defval.u);
>  }
> @@ -294,7 +294,7 @@ const PropertyInfo qdev_prop_uint8 = {
>      .name  = "uint8",
>      .get   = get_uint8,
>      .set   = set_uint8,
> -    .set_default_value = qdev_propinfo_set_default_value_uint,
> +    .set_default_value = field_prop_set_default_value_uint,
>  };
>  
>  /* --- 16bit integer --- */
> @@ -321,7 +321,7 @@ const PropertyInfo qdev_prop_uint16 = {
>      .name  = "uint16",
>      .get   = get_uint16,
>      .set   = set_uint16,
> -    .set_default_value = qdev_propinfo_set_default_value_uint,
> +    .set_default_value = field_prop_set_default_value_uint,
>  };
>  
>  /* --- 32bit integer --- */
> @@ -344,8 +344,8 @@ static void set_uint32(Object *obj, Visitor *v, const 
> char *name,
>      visit_type_uint32(v, name, ptr, errp);
>  }
>  
> -void qdev_propinfo_get_int32(Object *obj, Visitor *v, const char *name,
> -                             void *opaque, Error **errp)
> +void field_prop_get_int32(Object *obj, Visitor *v, const char *name,
> +                          void *opaque, Error **errp)
>  {
>      Property *prop = opaque;
>      int32_t *ptr = qdev_get_prop_ptr(obj, prop);
> @@ -366,14 +366,14 @@ const PropertyInfo qdev_prop_uint32 = {
>      .name  = "uint32",
>      .get   = get_uint32,
>      .set   = set_uint32,
> -    .set_default_value = qdev_propinfo_set_default_value_uint,
> +    .set_default_value = field_prop_set_default_value_uint,
>  };
>  
>  const PropertyInfo qdev_prop_int32 = {
>      .name  = "int32",
> -    .get   = qdev_propinfo_get_int32,
> +    .get   = field_prop_get_int32,
>      .set   = set_int32,
> -    .set_default_value = qdev_propinfo_set_default_value_int,
> +    .set_default_value = field_prop_set_default_value_int,
>  };
>  
>  /* --- 64bit integer --- */
> @@ -418,14 +418,14 @@ const PropertyInfo qdev_prop_uint64 = {
>      .name  = "uint64",
>      .get   = get_uint64,
>      .set   = set_uint64,
> -    .set_default_value = qdev_propinfo_set_default_value_uint,
> +    .set_default_value = field_prop_set_default_value_uint,
>  };
>  
>  const PropertyInfo qdev_prop_int64 = {
>      .name  = "int64",
>      .get   = get_int64,
>      .set   = set_int64,
> -    .set_default_value = qdev_propinfo_set_default_value_int,
> +    .set_default_value = field_prop_set_default_value_int,
>  };
>  
>  /* --- string --- */
> @@ -477,15 +477,15 @@ const PropertyInfo qdev_prop_on_off_auto = {
>      .name = "OnOffAuto",
>      .description = "on/off/auto",
>      .enum_table = &OnOffAuto_lookup,
> -    .get = qdev_propinfo_get_enum,
> -    .set = qdev_propinfo_set_enum,
> -    .set_default_value = qdev_propinfo_set_default_value_enum,
> +    .get = field_prop_get_enum,
> +    .set = field_prop_set_enum,
> +    .set_default_value = field_prop_set_default_value_enum,
>  };
>  
>  /* --- 32bit unsigned int 'size' type --- */
>  
> -void qdev_propinfo_get_size32(Object *obj, Visitor *v, const char *name,
> -                              void *opaque, Error **errp)
> +void field_prop_get_size32(Object *obj, Visitor *v, const char *name,
> +                           void *opaque, Error **errp)
>  {
>      Property *prop = opaque;
>      uint32_t *ptr = qdev_get_prop_ptr(obj, prop);
> @@ -518,9 +518,9 @@ static void set_size32(Object *obj, Visitor *v, const 
> char *name, void *opaque,
>  
>  const PropertyInfo qdev_prop_size32 = {
>      .name  = "size",
> -    .get = qdev_propinfo_get_size32,
> +    .get = field_prop_get_size32,
>      .set = set_size32,
> -    .set_default_value = qdev_propinfo_set_default_value_uint,
> +    .set_default_value = field_prop_set_default_value_uint,
>  };
>  
>  /* --- support for array properties --- */
> @@ -617,7 +617,7 @@ const PropertyInfo qdev_prop_arraylen = {
>      .name = "uint32",
>      .get = get_uint32,
>      .set = set_prop_arraylen,
> -    .set_default_value = qdev_propinfo_set_default_value_uint,
> +    .set_default_value = field_prop_set_default_value_uint,
>  };
>  
>  /* --- public helpers --- */
> @@ -816,7 +816,7 @@ const PropertyInfo qdev_prop_size = {
>      .name  = "size",
>      .get = get_size,
>      .set = set_size,
> -    .set_default_value = qdev_propinfo_set_default_value_uint,
> +    .set_default_value = field_prop_set_default_value_uint,
>  };
>  
>  /* --- object link property --- */




reply via email to

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