[PATCH v5 37/37] qdev/qom: remove some TODO limitations now that PROP_PTR is gone

Marc-André Lureau posted 37 patches 6 years, 1 month ago
Maintainers: Paul Burton <pburton@wavecomp.com>, "Edgar E. Iglesias" <edgar.iglesias@gmail.com>, "Michael S. Tsirkin" <mst@redhat.com>, Jason Wang <jasowang@redhat.com>, Artyom Tarasenko <atar4qemu@gmail.com>, "Marc-André Lureau" <marcandre.lureau@redhat.com>, Marcel Apfelbaum <marcel.apfelbaum@gmail.com>, Aleksandar Markovic <amarkovic@wavecomp.com>, Corey Minyard <cminyard@mvista.com>, "Hervé Poussineau" <hpoussin@reactos.org>, Aurelien Jarno <aurelien@aurel32.net>, Aleksandar Rikalo <aleksandar.rikalo@rt-rk.com>, Mark Cave-Ayland <mark.cave-ayland@ilande.co.uk>, Peter Maydell <peter.maydell@linaro.org>, Laurent Vivier <laurent@vivier.eu>, Paolo Bonzini <pbonzini@redhat.com>, BALATON Zoltan <balaton@eik.bme.hu>, Eduardo Habkost <ehabkost@redhat.com>, Magnus Damm <magnus.damm@gmail.com>, "Daniel P. Berrangé" <berrange@redhat.com>, "Philippe Mathieu-Daudé" <philmd@redhat.com>, Fabien Chouteau <chouteau@adacore.com>, KONRAD Frederic <frederic.konrad@adacore.com>, Richard Henderson <rth@twiddle.net>
[PATCH v5 37/37] qdev/qom: remove some TODO limitations now that PROP_PTR is gone
Posted by Marc-André Lureau 6 years, 1 month ago
Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com>
---
 hw/core/qdev.c     |  8 --------
 qom/qom-qmp-cmds.c | 10 ----------
 2 files changed, 18 deletions(-)

diff --git a/hw/core/qdev.c b/hw/core/qdev.c
index 98e786c50f..9feb81cff2 100644
--- a/hw/core/qdev.c
+++ b/hw/core/qdev.c
@@ -736,14 +736,6 @@ void qdev_property_add_static(DeviceState *dev, Property *prop,
     if (prop->info->create) {
         prop->info->create(obj, prop, &local_err);
     } else {
-        /*
-         * TODO qdev_prop_ptr does not have getters or setters.  It must
-         * go now that it can be replaced with links.  The test should be
-         * removed along with it: all static properties are read/write.
-         */
-        if (!prop->info->get && !prop->info->set) {
-            return;
-        }
         object_property_add(obj, prop->name, prop->info->name,
                             prop->info->get, prop->info->set,
                             prop->info->release,
diff --git a/qom/qom-qmp-cmds.c b/qom/qom-qmp-cmds.c
index 236e8e41dd..f4494f98ac 100644
--- a/qom/qom-qmp-cmds.c
+++ b/qom/qom-qmp-cmds.c
@@ -142,16 +142,6 @@ static ObjectPropertyInfo *make_device_property_info(ObjectClass *klass,
                 continue;
             }
 
-            /*
-             * TODO Properties without a parser are just for dirty hacks.
-             * qdev_prop_ptr is the only such PropertyInfo.  It's marked
-             * for removal.  This conditional should be removed along with
-             * it.
-             */
-            if (!prop->info->set && !prop->info->create) {
-                return NULL;           /* no way to set it, don't show */
-            }
-
             info = g_malloc0(sizeof(*info));
             info->name = g_strdup(prop->name);
             info->type = default_type ? g_strdup(default_type)
-- 
2.24.0.308.g228f53135a


Re: [PATCH v5 37/37] qdev/qom: remove some TODO limitations now that PROP_PTR is gone
Posted by Markus Armbruster 6 years, 1 month ago
Marc-André Lureau <marcandre.lureau@redhat.com> writes:

> Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com>
> ---
>  hw/core/qdev.c     |  8 --------
>  qom/qom-qmp-cmds.c | 10 ----------
>  2 files changed, 18 deletions(-)
>
> diff --git a/hw/core/qdev.c b/hw/core/qdev.c
> index 98e786c50f..9feb81cff2 100644
> --- a/hw/core/qdev.c
> +++ b/hw/core/qdev.c
> @@ -736,14 +736,6 @@ void qdev_property_add_static(DeviceState *dev, Property *prop,
>      if (prop->info->create) {
>          prop->info->create(obj, prop, &local_err);
>      } else {
> -        /*
> -         * TODO qdev_prop_ptr does not have getters or setters.  It must
> -         * go now that it can be replaced with links.  The test should be
> -         * removed along with it: all static properties are read/write.
> -         */
> -        if (!prop->info->get && !prop->info->set) {
> -            return;
> -        }
>          object_property_add(obj, prop->name, prop->info->name,
>                              prop->info->get, prop->info->set,
>                              prop->info->release,
> diff --git a/qom/qom-qmp-cmds.c b/qom/qom-qmp-cmds.c
> index 236e8e41dd..f4494f98ac 100644
> --- a/qom/qom-qmp-cmds.c
> +++ b/qom/qom-qmp-cmds.c
> @@ -142,16 +142,6 @@ static ObjectPropertyInfo *make_device_property_info(ObjectClass *klass,
>                  continue;
>              }
>  
> -            /*
> -             * TODO Properties without a parser are just for dirty hacks.
> -             * qdev_prop_ptr is the only such PropertyInfo.  It's marked
> -             * for removal.  This conditional should be removed along with
> -             * it.
> -             */
> -            if (!prop->info->set && !prop->info->create) {
> -                return NULL;           /* no way to set it, don't show */
> -            }
> -
>              info = g_malloc0(sizeof(*info));
>              info->name = g_strdup(prop->name);
>              info->type = default_type ? g_strdup(default_type)

Reviewed-by: Markus Armbruster <armbru@redhat.com>