[PATCH 0/3] qom: Simplify pointer property getters/setters

Eduardo Habkost posted 3 patches 5 years, 1 month ago
Test checkpatch passed
Patches applied successfully (tree, apply log)
git fetch https://github.com/patchew-project/qemu tags/patchew/20201009191520.1799419-1-ehabkost@redhat.com
Maintainers: "Philippe Mathieu-Daudé" <f4bug@amsat.org>, Paolo Bonzini <pbonzini@redhat.com>, "Daniel P. Berrangé" <berrange@redhat.com>, Aurelien Jarno <aurelien@aurel32.net>, Marcel Apfelbaum <marcel.apfelbaum@gmail.com>, Igor Mammedov <imammedo@redhat.com>, Eduardo Habkost <ehabkost@redhat.com>, "Michael S. Tsirkin" <mst@redhat.com>, Aleksandar Markovic <aleksandar.qemu.devel@gmail.com>
include/qom/object.h |   8 +--
hw/acpi/ich9.c       |   2 +-
hw/acpi/piix4.c      |  10 ++--
hw/isa/lpc_ich9.c    |   4 +-
qom/object.c         | 122 +++++++++----------------------------------
5 files changed, 38 insertions(+), 108 deletions(-)
[PATCH 0/3] qom: Simplify pointer property getters/setters
Posted by Eduardo Habkost 5 years, 1 month ago
The existing pointer property getters/setters are awkward because
they are expected to work with const variables.  If we remove
that requirement, they can become a lot simpler and simply call
the visit_type_uint*() functions directly.

Git tree: https://github.com/ehabkost/qemu work/qom-ptr-prop-not-const
Based-on: 20201009160122.1662082-1-ehabkost@redhat.com

Eduardo Habkost (3):
  acpi: Don't pass const pointers to object_property_add_uint*_ptr()
  qom: Make object_property_add_uint*_ptr() get non-const pointers
  qom: Simplify and merge pointer property getters/setters

 include/qom/object.h |   8 +--
 hw/acpi/ich9.c       |   2 +-
 hw/acpi/piix4.c      |  10 ++--
 hw/isa/lpc_ich9.c    |   4 +-
 qom/object.c         | 122 +++++++++----------------------------------
 5 files changed, 38 insertions(+), 108 deletions(-)

-- 
2.26.2



Re: [PATCH 0/3] qom: Simplify pointer property getters/setters
Posted by Igor Mammedov 5 years ago
On Fri,  9 Oct 2020 15:15:17 -0400
Eduardo Habkost <ehabkost@redhat.com> wrote:

> The existing pointer property getters/setters are awkward because
> they are expected to work with const variables.  If we remove
> that requirement, they can become a lot simpler and simply call
> the visit_type_uint*() functions directly.

see my reply on 'qom: Make all -object types use only class properties' thread.
we should drop  pointer property getters/setter instead of extending it.

> 
> Git tree: https://github.com/ehabkost/qemu work/qom-ptr-prop-not-const
> Based-on: 20201009160122.1662082-1-ehabkost@redhat.com
> 
> Eduardo Habkost (3):
>   acpi: Don't pass const pointers to object_property_add_uint*_ptr()
>   qom: Make object_property_add_uint*_ptr() get non-const pointers
>   qom: Simplify and merge pointer property getters/setters
> 
>  include/qom/object.h |   8 +--
>  hw/acpi/ich9.c       |   2 +-
>  hw/acpi/piix4.c      |  10 ++--
>  hw/isa/lpc_ich9.c    |   4 +-
>  qom/object.c         | 122 +++++++++----------------------------------
>  5 files changed, 38 insertions(+), 108 deletions(-)
>