All of lore.kernel.org
 help / color / mirror / Atom feed
From: Igor Mammedov <imammedo@redhat.com>
To: Eduardo Habkost <ehabkost@redhat.com>
Cc: "Kevin Wolf" <kwolf@redhat.com>, "Thomas Huth" <thuth@redhat.com>,
	"Daniel P. Berrange" <berrange@redhat.com>,
	"David Hildenbrand" <david@redhat.com>,
	"Philippe Mathieu-Daudé" <philmd@redhat.com>,
	"Cornelia Huck" <cohuck@redhat.com>,
	qemu-devel@nongnu.org, "Markus Armbruster" <armbru@redhat.com>,
	"Halil Pasic" <pasic@linux.ibm.com>,
	"Christian Borntraeger" <borntraeger@de.ibm.com>,
	qemu-s390x@nongnu.org,
	"Marc-André Lureau" <marcandre.lureau@redhat.com>,
	"Paolo Bonzini" <pbonzini@redhat.com>,
	"Stefan Berger" <stefanb@linux.ibm.com>,
	"John Snow" <jsnow@redhat.com>,
	"Richard Henderson" <rth@twiddle.net>
Subject: Re: [PATCH v4 18/32] qdev: Get just property name at error_set_from_qdev_prop_error()
Date: Mon, 14 Dec 2020 15:44:30 +0100	[thread overview]
Message-ID: <20201214154430.71cd1e04@redhat.com> (raw)
In-Reply-To: <20201211220529.2290218-19-ehabkost@redhat.com>

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

> Replace `Property *prop` parameter with `char *name`, to reduce
> dependency of getter and setter functions on the Property struct
> (which will be changed in following patches).
> 
> Signed-off-by: Eduardo Habkost <ehabkost@redhat.com>

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

> ---
> This is a new patch added in series v2
> ---
> Cc: Paolo Bonzini <pbonzini@redhat.com>
> Cc: "Daniel P. Berrangé" <berrange@redhat.com>
> Cc: Eduardo Habkost <ehabkost@redhat.com>
> Cc: Cornelia Huck <cohuck@redhat.com>
> Cc: Halil Pasic <pasic@linux.ibm.com>
> Cc: Christian Borntraeger <borntraeger@de.ibm.com>
> Cc: Thomas Huth <thuth@redhat.com>
> Cc: Richard Henderson <rth@twiddle.net>
> Cc: David Hildenbrand <david@redhat.com>
> Cc: qemu-devel@nongnu.org
> Cc: qemu-s390x@nongnu.org
> ---
>  include/hw/qdev-properties.h     |  2 +-
>  hw/core/qdev-properties-system.c | 12 ++++++------
>  hw/core/qdev-properties.c        |  8 ++++----
>  hw/s390x/css.c                   |  2 +-
>  4 files changed, 12 insertions(+), 12 deletions(-)
> 
> diff --git a/include/hw/qdev-properties.h b/include/hw/qdev-properties.h
> index 1b58e4f922..476737b9da 100644
> --- a/include/hw/qdev-properties.h
> +++ b/include/hw/qdev-properties.h
> @@ -201,7 +201,7 @@ const GlobalProperty *qdev_find_global_prop(Object *obj,
>  int qdev_prop_check_globals(void);
>  void qdev_prop_set_globals(DeviceState *dev);
>  void error_set_from_qdev_prop_error(Error **errp, int ret, Object *obj,
> -                                    Property *prop, const char *value);
> +                                    const char *name, const char *value);
>  
>  /**
>   * qdev_property_add_static:
> diff --git a/hw/core/qdev-properties-system.c b/hw/core/qdev-properties-system.c
> index e2d523b27a..9cf9bcb39d 100644
> --- a/hw/core/qdev-properties-system.c
> +++ b/hw/core/qdev-properties-system.c
> @@ -354,7 +354,7 @@ static void set_mac(Object *obj, Visitor *v, const char *name, void *opaque,
>      return;
>  
>  inval:
> -    error_set_from_qdev_prop_error(errp, EINVAL, obj, prop, str);
> +    error_set_from_qdev_prop_error(errp, EINVAL, obj, name, str);
>      g_free(str);
>  }
>  
> @@ -442,7 +442,7 @@ static void set_netdev(Object *obj, Visitor *v, const char *name,
>      peers_ptr->queues = queues;
>  
>  out:
> -    error_set_from_qdev_prop_error(errp, err, obj, prop, str);
> +    error_set_from_qdev_prop_error(errp, err, obj, name, str);
>      g_free(str);
>  }
>  
> @@ -494,7 +494,7 @@ static void set_audiodev(Object *obj, Visitor *v, const char* name,
>      card->state = state;
>  
>  out:
> -    error_set_from_qdev_prop_error(errp, err, obj, prop, str);
> +    error_set_from_qdev_prop_error(errp, err, obj, name, str);
>      g_free(str);
>  }
>  
> @@ -792,7 +792,7 @@ static void set_pci_devfn(Object *obj, Visitor *v, const char *name,
>      return;
>  
>  invalid:
> -    error_set_from_qdev_prop_error(errp, EINVAL, obj, prop, str);
> +    error_set_from_qdev_prop_error(errp, EINVAL, obj, name, str);
>      g_free(str);
>  }
>  
> @@ -916,7 +916,7 @@ static void set_pci_host_devaddr(Object *obj, Visitor *v, const char *name,
>      return;
>  
>  inval:
> -    error_set_from_qdev_prop_error(errp, EINVAL, obj, prop, str);
> +    error_set_from_qdev_prop_error(errp, EINVAL, obj, name, str);
>      g_free(str);
>  }
>  
> @@ -1146,7 +1146,7 @@ static void set_uuid(Object *obj, Visitor *v, const char *name, void *opaque,
>      if (!strcmp(str, UUID_VALUE_AUTO)) {
>          qemu_uuid_generate(uuid);
>      } else if (qemu_uuid_parse(str, uuid) < 0) {
> -        error_set_from_qdev_prop_error(errp, EINVAL, obj, prop, str);
> +        error_set_from_qdev_prop_error(errp, EINVAL, obj, name, str);
>      }
>      g_free(str);
>  }
> diff --git a/hw/core/qdev-properties.c b/hw/core/qdev-properties.c
> index a2eaa43831..7495798a66 100644
> --- a/hw/core/qdev-properties.c
> +++ b/hw/core/qdev-properties.c
> @@ -679,21 +679,21 @@ static Property *qdev_prop_find(DeviceState *dev, const char *name)
>  }
>  
>  void error_set_from_qdev_prop_error(Error **errp, int ret, Object *obj,
> -                                    Property *prop, const char *value)
> +                                    const char *name, const char *value)
>  {
>      switch (ret) {
>      case -EEXIST:
>          error_setg(errp, "Property '%s.%s' can't take value '%s', it's in use",
> -                  object_get_typename(obj), prop->name, value);
> +                  object_get_typename(obj), name, value);
>          break;
>      default:
>      case -EINVAL:
>          error_setg(errp, QERR_PROPERTY_VALUE_BAD,
> -                   object_get_typename(obj), prop->name, value);
> +                   object_get_typename(obj), name, value);
>          break;
>      case -ENOENT:
>          error_setg(errp, "Property '%s.%s' can't find value '%s'",
> -                  object_get_typename(obj), prop->name, value);
> +                  object_get_typename(obj), name, value);
>          break;
>      case 0:
>          break;
> diff --git a/hw/s390x/css.c b/hw/s390x/css.c
> index 38fd46b9a9..7a44320d12 100644
> --- a/hw/s390x/css.c
> +++ b/hw/s390x/css.c
> @@ -2390,7 +2390,7 @@ static void set_css_devid(Object *obj, Visitor *v, const char *name,
>  
>      num = sscanf(str, "%2x.%1x%n.%4x%n", &cssid, &ssid, &n1, &devid, &n2);
>      if (num != 3 || (n2 - n1) != 5 || strlen(str) != n2) {
> -        error_set_from_qdev_prop_error(errp, EINVAL, obj, prop, str);
> +        error_set_from_qdev_prop_error(errp, EINVAL, obj, name, str);
>          goto out;
>      }
>      if ((cssid > MAX_CSSID) || (ssid > MAX_SSID)) {



  parent reply	other threads:[~2020-12-14 14:53 UTC|newest]

Thread overview: 81+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-12-11 22:04 [PATCH v4 00/32] qdev property code cleanup Eduardo Habkost
2020-12-11 22:04 ` [PATCH v4 01/32] cs4231: Get rid of empty property array Eduardo Habkost
2020-12-15  8:22   ` Gerd Hoffmann
2020-12-11 22:04 ` [PATCH v4 02/32] cpu: Move cpu_common_props to hw/core/cpu.c Eduardo Habkost
2020-12-11 22:05 ` [PATCH v4 03/32] qdev: Move property code to qdev-properties.[ch] Eduardo Habkost
2020-12-11 22:05 ` [PATCH v4 04/32] qdev: Check dev->realized at set_size() Eduardo Habkost
2020-12-11 22:05 ` [PATCH v4 05/32] sparc: Check dev->realized at sparc_set_nwindows() Eduardo Habkost
2020-12-15 11:45   ` Mark Cave-Ayland
2020-12-11 22:05 ` [PATCH v4 06/32] qdev: Don't use dev->id on set_size32() error message Eduardo Habkost
2020-12-11 22:05 ` [PATCH v4 07/32] qdev: Make PropertyInfo.print method get Object* argument Eduardo Habkost
2020-12-11 22:05 ` [PATCH v4 08/32] qdev: Make bit_prop_set() " Eduardo Habkost
2020-12-11 22:05 ` [PATCH v4 09/32] qdev: Make qdev_get_prop_ptr() get Object* arg Eduardo Habkost
2020-12-11 22:05   ` Eduardo Habkost
2020-12-14  7:46   ` Paul Durrant
2020-12-14  7:46     ` Paul Durrant
2020-12-11 22:05 ` [PATCH v4 10/32] qdev: Make qdev_find_global_prop() get Object* argument Eduardo Habkost
2020-12-11 22:05 ` [PATCH v4 11/32] qdev: Make check_prop_still_unset() " Eduardo Habkost
2020-12-11 22:05 ` [PATCH v4 12/32] qdev: Make error_set_from_qdev_prop_error() " Eduardo Habkost
2020-12-11 22:05 ` [PATCH v4 13/32] qdev: Make qdev_propinfo_get_uint16() static Eduardo Habkost
2020-12-11 22:05 ` [PATCH v4 14/32] qdev: Move UUID property to qdev-properties-system.c Eduardo Habkost
2020-12-14 14:18   ` Igor Mammedov
2020-12-11 22:05 ` [PATCH v4 15/32] qdev: Move softmmu properties to qdev-properties-system.h Eduardo Habkost
2020-12-14 14:25   ` Igor Mammedov
2020-12-14 17:40     ` Eduardo Habkost
2020-12-15 14:40   ` Igor Mammedov
2020-12-11 22:05 ` [PATCH v4 16/32] qdev: Reuse DEFINE_PROP in all DEFINE_PROP_* macros Eduardo Habkost
2020-12-14 14:32   ` Igor Mammedov
2020-12-11 22:05 ` [PATCH v4 17/32] sparc: Use DEFINE_PROP for nwindows property Eduardo Habkost
2020-12-14 14:42   ` Igor Mammedov
2020-12-14 17:30     ` Eduardo Habkost
2020-12-15 14:39       ` Igor Mammedov
2020-12-15 11:52   ` Mark Cave-Ayland
2020-12-11 22:05 ` [PATCH v4 18/32] qdev: Get just property name at error_set_from_qdev_prop_error() Eduardo Habkost
2020-12-14 10:41   ` Cornelia Huck
2020-12-14 14:44   ` Igor Mammedov [this message]
2020-12-11 22:05 ` [PATCH v4 19/32] qdev: Avoid using prop->name unnecessarily Eduardo Habkost
2020-12-14 14:45   ` Igor Mammedov
2020-12-11 22:05 ` [PATCH v4 20/32] qdev: Add name parameter to qdev_class_add_property() Eduardo Habkost
2020-12-11 22:05 ` [PATCH v4 21/32] qdev: Add name argument to PropertyInfo.create method Eduardo Habkost
2020-12-14 14:47   ` Igor Mammedov
2020-12-11 22:05 ` [PATCH v4 22/32] qdev: Wrap getters and setters in separate helpers Eduardo Habkost
2020-12-15 14:42   ` Igor Mammedov
2020-12-11 22:05 ` [PATCH v4 23/32] qdev: Move dev->realized check to qdev_property_set() Eduardo Habkost
2020-12-11 22:05   ` Eduardo Habkost
2020-12-14  7:46   ` Paul Durrant
2020-12-14  7:46     ` Paul Durrant
2020-12-14 10:46   ` Cornelia Huck
2020-12-14 10:46     ` Cornelia Huck
2020-12-14 14:55   ` Igor Mammedov
2020-12-14 14:55     ` Igor Mammedov
2020-12-14 17:24     ` Eduardo Habkost
2020-12-14 17:24       ` Eduardo Habkost
2020-12-15 14:24       ` Igor Mammedov
2020-12-15 14:24         ` Igor Mammedov
2020-12-11 22:05 ` [PATCH v4 24/32] qdev: Make PropertyInfo.create return ObjectProperty* Eduardo Habkost
2020-12-14 14:57   ` Igor Mammedov
2020-12-11 22:05 ` [PATCH v4 25/32] qdev: Make qdev_class_add_property() more flexible Eduardo Habkost
2020-12-14 15:00   ` Igor Mammedov
2020-12-14 18:28     ` Eduardo Habkost
2020-12-15 14:25       ` Igor Mammedov
2020-12-11 22:05 ` [PATCH v4 26/32] qdev: Separate generic and device-specific property registration Eduardo Habkost
2020-12-15 14:33   ` Igor Mammedov
2020-12-11 22:05 ` [PATCH v4 27/32] qdev: Rename qdev_propinfo_* to field_prop_* Eduardo Habkost
2020-12-15 14:35   ` Igor Mammedov
2020-12-11 22:05 ` [PATCH v4 28/32] qdev: Move qdev_prop_tpm declaration to tpm_prop.h Eduardo Habkost
2020-12-15 14:36   ` Igor Mammedov
2020-12-11 22:05 ` [PATCH v4 29/32] qdev: Rename qdev_prop_* to prop_info_* Eduardo Habkost
2020-12-11 22:05 ` [PATCH v4 30/32] qdev: Rename qdev_get_prop_ptr() to object_field_prop_ptr() Eduardo Habkost
2020-12-11 22:05   ` Eduardo Habkost
2020-12-14  7:47   ` Paul Durrant
2020-12-14  7:47     ` Paul Durrant
2020-12-14 10:56   ` Cornelia Huck
2020-12-14 10:56     ` Cornelia Huck
2020-12-14 15:13   ` Igor Mammedov
2020-12-14 15:13     ` Igor Mammedov
2020-12-11 22:05 ` [PATCH v4 31/32] qdev: Avoid unnecessary DeviceState* variable at set_prop_arraylen() Eduardo Habkost
2020-12-14 15:11   ` Igor Mammedov
2020-12-11 22:05 ` [PATCH v4 32/32] tests: Add unit test for qdev array properties Eduardo Habkost
2020-12-14 19:42 ` [PATCH v4 00/32] qdev property code cleanup Eduardo Habkost
2020-12-15 15:40   ` Eduardo Habkost
2020-12-15 16:57     ` Eduardo Habkost

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20201214154430.71cd1e04@redhat.com \
    --to=imammedo@redhat.com \
    --cc=armbru@redhat.com \
    --cc=berrange@redhat.com \
    --cc=borntraeger@de.ibm.com \
    --cc=cohuck@redhat.com \
    --cc=david@redhat.com \
    --cc=ehabkost@redhat.com \
    --cc=jsnow@redhat.com \
    --cc=kwolf@redhat.com \
    --cc=marcandre.lureau@redhat.com \
    --cc=pasic@linux.ibm.com \
    --cc=pbonzini@redhat.com \
    --cc=philmd@redhat.com \
    --cc=qemu-devel@nongnu.org \
    --cc=qemu-s390x@nongnu.org \
    --cc=rth@twiddle.net \
    --cc=stefanb@linux.ibm.com \
    --cc=thuth@redhat.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.