qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: Eduardo Habkost <ehabkost@redhat.com>
To: Peter Maydell <peter.maydell@linaro.org>, qemu-devel@nongnu.org
Cc: Paolo Bonzini <pbonzini@redhat.com>
Subject: [PULL 06/15] qdev: Add name parameter to qdev_class_add_property()
Date: Wed, 23 Dec 2020 16:27:26 -0500	[thread overview]
Message-ID: <20201223212735.512062-7-ehabkost@redhat.com> (raw)
In-Reply-To: <20201223212735.512062-1-ehabkost@redhat.com>

This will make it easier to remove Property.name in the future.

Signed-off-by: Eduardo Habkost <ehabkost@redhat.com>
Message-Id: <20201211220529.2290218-21-ehabkost@redhat.com>
Signed-off-by: Eduardo Habkost <ehabkost@redhat.com>
---
 hw/core/qdev-properties.c | 9 +++++----
 1 file changed, 5 insertions(+), 4 deletions(-)

diff --git a/hw/core/qdev-properties.c b/hw/core/qdev-properties.c
index 50734a1cd4..457c7fe4ba 100644
--- a/hw/core/qdev-properties.c
+++ b/hw/core/qdev-properties.c
@@ -887,7 +887,8 @@ void qdev_property_add_static(DeviceState *dev, Property *prop)
     }
 }
 
-static void qdev_class_add_property(DeviceClass *klass, Property *prop)
+static void qdev_class_add_property(DeviceClass *klass, const char *name,
+                                    Property *prop)
 {
     ObjectClass *oc = OBJECT_CLASS(klass);
 
@@ -897,7 +898,7 @@ static void qdev_class_add_property(DeviceClass *klass, Property *prop)
         ObjectProperty *op;
 
         op = object_class_property_add(oc,
-                                       prop->name, prop->info->name,
+                                       name, prop->info->name,
                                        prop->info->get, prop->info->set,
                                        prop->info->release,
                                        prop);
@@ -905,7 +906,7 @@ static void qdev_class_add_property(DeviceClass *klass, Property *prop)
             prop->info->set_default_value(op, prop);
         }
     }
-    object_class_property_set_description(oc, prop->name,
+    object_class_property_set_description(oc, name,
                                           prop->info->description);
 }
 
@@ -962,7 +963,7 @@ void device_class_set_props(DeviceClass *dc, Property *props)
     dc->props_ = props;
     for (prop = props; prop && prop->name; prop++) {
         qdev_class_add_legacy_property(dc, prop);
-        qdev_class_add_property(dc, prop);
+        qdev_class_add_property(dc, prop->name, prop);
     }
 }
 
-- 
2.28.0



  parent reply	other threads:[~2020-12-23 21:31 UTC|newest]

Thread overview: 17+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-12-23 21:27 [PULL 00/15] Machine queue, 2020-12-23 Eduardo Habkost
2020-12-23 21:27 ` [PULL 01/15] qdev: Move softmmu properties to qdev-properties-system.h Eduardo Habkost
2020-12-23 21:27 ` [PULL 02/15] qdev: Reuse DEFINE_PROP in all DEFINE_PROP_* macros Eduardo Habkost
2020-12-23 21:27 ` [PULL 03/15] sparc: Use DEFINE_PROP for nwindows property Eduardo Habkost
2020-12-23 21:27 ` [PULL 04/15] qdev: Get just property name at error_set_from_qdev_prop_error() Eduardo Habkost
2020-12-23 21:27 ` [PULL 05/15] qdev: Avoid using prop->name unnecessarily Eduardo Habkost
2020-12-23 21:27 ` Eduardo Habkost [this message]
2020-12-23 21:27 ` [PULL 07/15] qdev: Add name argument to PropertyInfo.create method Eduardo Habkost
2020-12-23 21:27 ` [PULL 08/15] qdev: Wrap getters and setters in separate helpers Eduardo Habkost
2020-12-23 21:27 ` [PULL 09/15] qdev: Move dev->realized check to qdev_property_set() Eduardo Habkost
2020-12-23 21:27 ` [PULL 10/15] qdev: Make PropertyInfo.create return ObjectProperty* Eduardo Habkost
2020-12-23 21:27 ` [PULL 11/15] qdev: Make qdev_class_add_property() more flexible Eduardo Habkost
2020-12-23 21:27 ` [PULL 12/15] qdev: Move qdev_prop_tpm declaration to tpm_prop.h Eduardo Habkost
2020-12-23 21:27 ` [PULL 13/15] qdev: Rename qdev_get_prop_ptr() to object_field_prop_ptr() Eduardo Habkost
2020-12-23 21:27 ` [PULL 14/15] qdev: Avoid unnecessary DeviceState* variable at set_prop_arraylen() Eduardo Habkost
2020-12-23 21:27 ` [PULL 15/15] bugfix: hostmem: Free host_nodes list right after visited Eduardo Habkost
2021-01-02 13:12 ` [PULL 00/15] Machine queue, 2020-12-23 Peter Maydell

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=20201223212735.512062-7-ehabkost@redhat.com \
    --to=ehabkost@redhat.com \
    --cc=pbonzini@redhat.com \
    --cc=peter.maydell@linaro.org \
    --cc=qemu-devel@nongnu.org \
    /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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).