[PATCH v3 43/53] qdev: Move static_prop_release_dynamic_prop() closer to its usage

2020-11-12 Thread Eduardo Habkost
Move the function closer to where it's used, to make refactor and review simpler. While doing it, reformat the comment at the top to follow coding style. Signed-off-by: Eduardo Habkost --- This is a new patch added in v3 of the series. --- Cc: Paolo Bonzini Cc: "Daniel P. Ber

[PATCH v3 49/53] qom: FIELD_PROP macro

2020-11-12 Thread Eduardo Habkost
gets the property name as the first argument. Signed-off-by: Eduardo Habkost --- This is a new patch added in v3 of this series. --- Cc: Paolo Bonzini Cc: "Daniel P. Berrangé" Cc: Eduardo Habkost Cc: qemu-devel@nongnu.org --- include/qom/field-property.h | 17 + i

[PATCH v3 40/53] qdev: Rename array_element_release() to static_prop_release_dynamic_prop()

2020-11-12 Thread Eduardo Habkost
The function is now generic and can be used by any property that had the Property struct allocated dynamically. Signed-off-by: Eduardo Habkost --- This is a new patch added in v3 of the series. --- Cc: Paolo Bonzini Cc: "Daniel P. Berrangé" Cc: Eduardo Habkost Cc: qemu-devel@

[PATCH v3 47/53] qom: Include static property API reference in documentation

2020-11-12 Thread Eduardo Habkost
Include the static-properties.h API reference in docs/devel/qom.rst. Signed-off-by: Eduardo Habkost --- Changes v2 -> v3: * Redone patch after changes in previous patches in the series * Split into separate patches. This one only adds the file to qom.rst and Property/PropertyInfo doc comme

[PATCH v3 39/53] qdev: Get rid of ArrayElementProperty struct

2020-11-12 Thread Eduardo Habkost
Now that we don't store any additional data about the property in AraryElementStruct, we don't need it anymore. We can just allocate a Property struct directly. Signed-off-by: Eduardo Habkost --- Change v1 -> v2: * Get rid of the struct, but not of the release function (we stil

[PATCH v3 41/53] qdev: Make object_property_add_field() copy the Property struct

2020-11-12 Thread Eduardo Habkost
This will make the function more convenient to use, and allow us to reuse it for array element properties. I'm not adding a version of this function that doesn't copy the struct, because this function isn't supposed to be used widely. Signed-off-by: Eduardo Habkost --- This is a

[PATCH v3 25/53] qdev: Make qdev_class_add_property() more flexible

2020-11-12 Thread Eduardo Habkost
Support Property.set_default and PropertyInfo.description even if PropertyInfo.create is set. Signed-off-by: Eduardo Habkost --- Changes v1 -> v2: * Patch redone after changes in the previous patches in the series --- Cc: Paolo Bonzini Cc: "Daniel P. Berrangé" Cc: Eduardo Habk

[PATCH v3 24/53] qdev: Make PropertyInfo.create return ObjectProperty*

2020-11-12 Thread Eduardo Habkost
Returning ObjectProperty* will be useful for new property registration code that will add additional callbacks to ObjectProperty after registering it. Signed-off-by: Eduardo Habkost --- Changes v1 -> v2: * Redone patch on top of additional changes in series v2 * Commit message reword ---

[PATCH v3 38/53] qdev: Remove ArrayElementProperty.release field

2020-11-12 Thread Eduardo Habkost
We don't need the extra field because we can find the release function for the property directly at ArrayElementProperty.info.release. Signed-off-by: Eduardo Habkost --- This is a new patch added in v3 of this series. --- Cc: Paolo Bonzini Cc: "Daniel P. Berrangé" Cc: Eduardo Ha

[PATCH v3 36/53] qdev: Don't set .name_template for array elements

2020-11-12 Thread Eduardo Habkost
All property code should be able to handle .name_template==NULL without problems, so we don't need to set it for array elements. This simple change will allow us to simplify the array property registration code a lot in the next commits. Signed-off-by: Eduardo Habkost --- This is a patch

[PATCH v3 37/53] qdev: Remove ArrayElementProperty.propname field

2020-11-12 Thread Eduardo Habkost
ned-off-by: Eduardo Habkost --- This is a new patch added in v2 of the series --- Cc: Paolo Bonzini Cc: "Daniel P. Berrangé" Cc: Eduardo Habkost Cc: qemu-devel@nongnu.org --- hw/core/qdev-properties.c | 5 + 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/hw/core/qdev-pr

[PATCH v3 33/53] qom: Add allow_set callback to ObjectProperty

2020-11-12 Thread Eduardo Habkost
s not being necessary in most cases). Signed-off-by: Eduardo Habkost --- Changes v1 -> v2: * Redone patch on top of changes in previous patches in the series * Provide prop_allow_set_always() and prop_allow_set_never() helpers --- Cc: Paolo Bonzini Cc: "Daniel P. Berrangé" Cc: E

[PATCH v3 34/53] qdev: Make qdev_prop_allow_set() a ObjectProperty.allow_set callback

2020-11-12 Thread Eduardo Habkost
core QOM feature. The array property also needs to set PropertyInfo.allow_set manually, but this will be cleaned up later (that code will be changed to use object_class_property_add_field() too). Signed-off-by: Eduardo Habkost --- Changes v2 -> v3: * Moved earlier in the series, before array

[PATCH v3 19/53] qdev: Avoid using prop->name unnecessarily

2020-11-12 Thread Eduardo Habkost
We already get the property name as argument to the property getter and setters, we don't need to use prop->name. This will make it easier to remove the Property.name field in the future. Reviewed-by: Stefan Berger Signed-off-by: Eduardo Habkost --- This is a new patch added in s

[PATCH v3 32/53] tests: Add unit test for qdev array properties

2020-11-12 Thread Eduardo Habkost
Add a test case to ensure array properties are behaving as expected. Signed-off-by: Eduardo Habkost --- This is a new patch added in v3 of this series. --- Cc: Paolo Bonzini Cc: "Daniel P. Berrangé" Cc: Eduardo Habkost Cc: qemu-devel@nongnu.org --- tests/test-qdev-global-pr

[PATCH v3 29/53] qdev: Rename qdev_prop_* to prop_info_*

2020-11-12 Thread Eduardo Habkost
The basic property types in qdev-properties.c are not going to be qdev-specific anymore. Rename the variables to prop_info_*. Signed-off-by: Eduardo Habkost --- Changes v1 -> v2: * Redone patch after moving UUID property to qdev-properties-system.c --- Cc: Paolo Bonzini Cc: "Daniel P.

[PATCH v3 48/53] qom: object_class_property_add_field() function

2020-11-12 Thread Eduardo Habkost
It is similar to object_class_property_add_field_static(), but gets a copy of a Property struct so we don't need static variables. Signed-off-by: Eduardo Habkost --- This is a new patch added in v3 of this series, but v2 had a object_class_property_add_field() function too. This versi

[PATCH v3 31/53] qdev: Avoid unnecessary DeviceState* variable at set_prop_arraylen()

2020-11-12 Thread Eduardo Habkost
We're just doing pointer math with the device pointer, we can simply use obj instead. Reviewed-by: Marc-André Lureau Signed-off-by: Eduardo Habkost --- Cc: Paolo Bonzini Cc: "Daniel P. Berrangé" Cc: Eduardo Habkost Cc: qemu-devel@nongnu.org --- hw/core/qdev-properties.c |

[PATCH v3 15/53] qdev: Move softmmu properties to qdev-properties-system.h

2020-11-12 Thread Eduardo Habkost
Move the property types and property macros implemented in qdev-properties-system.c to a new qdev-properties-system.h header. Signed-off-by: Eduardo Habkost --- Changes v1 -> v2: * Move UUID property type too, as it was moved to qdev-properties-system.c in the previous patch --- audio/audi

[PATCH v3 45/53] qdev: Move core field property code to QOM

2020-11-12 Thread Eduardo Habkost
Move the core of the static property code to qom/field-property.c. The actual property type implementations are still in qdev-properties.c, they will be moved later. Signed-off-by: Eduardo Habkost --- Changes v2 -> v3: * Redone patch after changes in previous patches of this series * Reorde

[PATCH v3 13/53] qdev: Make qdev_propinfo_get_uint16() static

2020-11-12 Thread Eduardo Habkost
There are no users of the function outside qdev-properties.c. Make function static and rename it to get_uint16(). Reviewed-by: Marc-André Lureau Signed-off-by: Eduardo Habkost --- Cc: Paolo Bonzini Cc: "Daniel P. Berrangé" Cc: Eduardo Habkost Cc: qemu-devel@nongnu.org --- hw/core

[PATCH v3 26/53] qdev: Separate generic and device-specific property registration

2020-11-12 Thread Eduardo Habkost
cause the plan is to eventually get rid of the Property.name field. The declarations for the new functions are being added to qdev-properties-internal.h, but they will be moved to a QOM header later. Signed-off-by: Eduardo Habkost --- Changes v2 -> v3: * Re-added array-based array registration

[PATCH v3 23/53] qdev: Move dev->realized check to qdev_property_set()

2020-11-12 Thread Eduardo Habkost
ed-off-by: Eduardo Habkost --- Changes v1 -> v2: * Removed unused variable at xen_block_set_vdev() * Redone patch after changes in the previous patches in the series --- Cc: Stefan Berger Cc: Stefano Stabellini Cc: Anthony Perard Cc: Paul Durrant Cc: Kevin Wolf Cc: Max Reitz Cc: Paolo Bo

[PATCH v3 27/53] qdev: Rename qdev_propinfo_* to field_prop_*

2020-11-12 Thread Eduardo Habkost
These functions will be moved to be part of QOM, so rename them. Signed-off-by: Eduardo Habkost --- Changes v2: * Rename to field_prop_* instead of object_propinfo_* --- Cc: Paolo Bonzini Cc: "Daniel P. Berrangé" Cc: Eduardo Habkost Cc: qemu-devel@nongnu.org --- hw/core/qdev-prop-

[PATCH v3 12/53] qdev: Make error_set_from_qdev_prop_error() get Object* argument

2020-11-12 Thread Eduardo Habkost
Make the code more generic and not specific to TYPE_DEVICE. Reviewed-by: Marc-André Lureau Signed-off-by: Eduardo Habkost --- Cc: Paolo Bonzini Cc: "Daniel P. Berrangé" Cc: Eduardo Habkost Cc: Cornelia Huck Cc: Thomas Huth Cc: Richard Henderson Cc: David Hildenbrand Cc: Halil

[PATCH v3 35/53] qdev: Rename Property.name to Property.name_template

2020-11-12 Thread Eduardo Habkost
The Property.name field won't always be set, but it is very easy to miss this detail when we see code using prop->name. Rename the field to "name_template", to indicate it is just a template used when creating new properties in some cases, but is not always set. Signed-off-b

[PATCH v3 28/53] qdev: Move qdev_prop_tpm declaration to tpm_prop.h

2020-11-12 Thread Eduardo Habkost
Move the variable declaration close to the macro that uses it. Reviewed-by: Marc-André Lureau Reviewed-by: Stefan Berger Signed-off-by: Eduardo Habkost --- Cc: Stefan Berger Cc: Paolo Bonzini Cc: "Daniel P. Berrangé" Cc: Eduardo Habkost Cc: qemu-devel@nongnu.org --- hw/tpm/

[PATCH v3 30/53] qdev: Rename qdev_get_prop_ptr() to object_field_prop_ptr()

2020-11-12 Thread Eduardo Habkost
The function will be moved to common QOM code, as it is not specific to TYPE_DEVICE anymore. Reviewed-by: Stefan Berger Signed-off-by: Eduardo Habkost --- Changes v1 -> v2: * Rename to object_field_prop_ptr() instead of object_static_prop_ptr() --- Cc: Stefan Berger Cc: Stefano Stabellini

[PATCH v3 22/53] qdev: Wrap getters and setters in separate helpers

2020-11-12 Thread Eduardo Habkost
mon QOM code. Signed-off-by: Eduardo Habkost --- Changes v1 -> v2: * Redone after changes in previous patches in the series * Renamed functions from static_prop_* to field_prop_* --- Cc: Paolo Bonzini Cc: "Daniel P. Berrangé" Cc: Eduardo Habkost Cc: qemu-devel@nongnu.o

[PATCH v3 16/53] qdev: Reuse DEFINE_PROP in all DEFINE_PROP_* macros

2020-11-12 Thread Eduardo Habkost
Instead of duplicating the code that sets name, info, offset, and does type checking, make DEFINE_PROP accept a variable number of arguments and reuse it in all DEFINE_PROP_* macros. Signed-off-by: Eduardo Habkost --- Changes v1 -> v2: * Redone after UUID property was moved --- Cc: Paolo Bonz

[PATCH v3 09/53] qdev: Make qdev_get_prop_ptr() get Object* arg

2020-11-12 Thread Eduardo Habkost
Make the code more generic and not specific to TYPE_DEVICE. Reviewed-by: Marc-André Lureau Signed-off-by: Eduardo Habkost --- Changes v1 -> v2: - Fix build error with CONFIG_XEN I took the liberty of keeping the Reviewed-by line from Marc-André as the build fix is a trivial one line cha

[PATCH v3 21/53] qdev: Add name argument to PropertyInfo.create method

2020-11-12 Thread Eduardo Habkost
This will make it easier to remove the Property.name field in the future. Signed-off-by: Eduardo Habkost --- This is a new patch added in series v2 --- Cc: Paolo Bonzini Cc: "Daniel P. Berrangé" Cc: Eduardo Habkost Cc: qemu-devel@nongnu.org --- include/hw/qdev-properties.h | 2 +

[PATCH v3 18/53] qdev: Get just property name at error_set_from_qdev_prop_error()

2020-11-12 Thread Eduardo Habkost
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 --- This is a new patch added in series v2 --- Cc: Paolo Bonzini Cc: "Daniel P. Ber

[PATCH v3 17/53] sparc: Use DEFINE_PROP for nwindows property

2020-11-12 Thread Eduardo Habkost
Use the DEFINE_PROP macro (which will set extra fields in the struct) instead of initializing a Property struct manually. Signed-off-by: Eduardo Habkost --- This is a new patch added in v2 of the series --- Cc: Mark Cave-Ayland Cc: Artyom Tarasenko Cc: qemu-devel@nongnu.org --- target/sparc

[PATCH v3 06/53] qdev: Don't use dev->id on set_size32() error message

2020-11-12 Thread Eduardo Habkost
All other qdev property error messages use "." instead of ".". Change set_size32() for consistency, and to make the code not specific to TYPE_DEVICE. Reviewed-by: Marc-André Lureau Signed-off-by: Eduardo Habkost --- Cc: Paolo Bonzini Cc: "Daniel P. Berrangé"

[PATCH v3 20/53] qdev: Add name parameter to qdev_class_add_property()

2020-11-12 Thread Eduardo Habkost
This will make it easier to remove Property.name in the future. Signed-off-by: Eduardo Habkost --- This is a new patch added in series v2 --- Cc: Paolo Bonzini Cc: "Daniel P. Berrangé" Cc: Eduardo Habkost Cc: qemu-devel@nongnu.org --- hw/core/qdev-properties.c | 9 + 1 fi

[PATCH v3 08/53] qdev: Make bit_prop_set() get Object* argument

2020-11-12 Thread Eduardo Habkost
Make the code more generic and not specific to TYPE_DEVICE. Reviewed-by: Marc-André Lureau Signed-off-by: Eduardo Habkost --- Cc: Paolo Bonzini Cc: "Daniel P. Berrangé" Cc: Eduardo Habkost Cc: qemu-devel@nongnu.org --- hw/core/qdev-properties.c | 10 ++ 1 file changed, 6

[PATCH v3 03/53] qdev: Move property code to qdev-properties.[ch]

2020-11-12 Thread Eduardo Habkost
Move everything related to Property and PropertyInfo to qdev-properties.[ch] to make it easier to refactor that code. Reviewed-by: Marc-André Lureau Signed-off-by: Eduardo Habkost --- Cc: Paolo Bonzini Cc: "Daniel P. Berrangé" Cc: Eduardo Habkost Cc: qemu-devel@nongnu.org ---

[PATCH v3 14/53] qdev: Move UUID property to qdev-properties-system.c

2020-11-12 Thread Eduardo Habkost
error_set_from_qdev_prop_error(). Signed-off-by: Eduardo Habkost --- This is a new patch added in series v2 --- Cc: Paolo Bonzini Cc: "Daniel P. Berrangé" Cc: Eduardo Habkost Cc: qemu-devel@nongnu.org --- hw/core/qdev-properties-system.c | 57 hw

[PATCH v3 05/53] sparc: Check dev->realized at sparc_set_nwindows()

2020-11-12 Thread Eduardo Habkost
sparc_set_nwindows() is one of the very few property setters that don't check dev->realized, and there's no reason for it to be special. Check dev->realized like the other setters. Reviewed-by: Marc-André Lureau Signed-off-by: Eduardo Habkost --- Cc: Mark Cave-Ayland Cc: Arty

[PATCH v3 11/53] qdev: Make check_prop_still_unset() get Object* argument

2020-11-12 Thread Eduardo Habkost
Make the code more generic and not specific to TYPE_DEVICE. Reviewed-by: Marc-André Lureau Signed-off-by: Eduardo Habkost --- Cc: Paolo Bonzini Cc: "Daniel P. Berrangé" Cc: Eduardo Habkost Cc: qemu-devel@nongnu.org --- hw/core/qdev-properties-system.c | 10 +- 1 file

[PATCH v3 10/53] qdev: Make qdev_find_global_prop() get Object* argument

2020-11-12 Thread Eduardo Habkost
Make the code more generic and not specific to TYPE_DEVICE. Reviewed-by: Marc-André Lureau Signed-off-by: Eduardo Habkost --- Cc: Paolo Bonzini Cc: "Daniel P. Berrangé" Cc: Eduardo Habkost Cc: qemu-devel@nongnu.org --- include/hw/qdev-properties.h | 2 +- hw/core/qdev-

[PATCH v3 02/53] cpu: Move cpu_common_props to hw/core/cpu.c

2020-11-12 Thread Eduardo Habkost
There's no reason to keep the property list separate from the CPU class code. Move the variable to hw/core/cpu.c and make it static. Reviewed-by: Marc-André Lureau Signed-off-by: Eduardo Habkost --- Cc: Eduardo Habkost Cc: Marcel Apfelbaum Cc: qemu-devel@nongnu.org --- include/hw/core/

[PATCH v3 04/53] qdev: Check dev->realized at set_size()

2020-11-12 Thread Eduardo Habkost
Signed-off-by: Eduardo Habkost --- Cc: Paolo Bonzini Cc: "Daniel P. Berrangé" Cc: Eduardo Habkost Cc: qemu-devel@nongnu.org --- hw/core/qdev-properties.c | 5 + 1 file changed, 5 insertions(+) diff --git a/hw/core/qdev-properties.c b/hw/core/qdev-properties.c index 12a053e732

[PATCH v3 01/53] cs4231: Get rid of empty property array

2020-11-12 Thread Eduardo Habkost
An empty props array is unnecessary, we can just not call device_class_set_props(). Reviewed-by: Marc-André Lureau Signed-off-by: Eduardo Habkost --- Cc: Gerd Hoffmann Cc: qemu-devel@nongnu.org --- hw/audio/cs4231.c | 5 - 1 file changed, 5 deletions(-) diff --git a/hw/audio/cs4231.c b

[PATCH v3 07/53] qdev: Make PropertyInfo.print method get Object* argument

2020-11-12 Thread Eduardo Habkost
Make the code more generic and not specific to TYPE_DEVICE. Reviewed-by: Marc-André Lureau Signed-off-by: Eduardo Habkost --- Cc: Paolo Bonzini Cc: "Daniel P. Berrangé" Cc: Eduardo Habkost Cc: qemu-devel@nongnu.org --- include/hw/qdev-properties.h | 2 +- hw/core/qdev-

[PATCH v3 00/53] Make qdev static property API usable by any QOM type

2020-11-12 Thread Eduardo Habkost
tracking code. * Make allow_set callback mandatory, to avoid ambiguity * Big cleanup of array property code. We don't need a custom release function for array elements anymore, because we don't need to save the property name in the Property struct anymore. * Moved UUID property to

Re: [PATCH v2 00/44] Make qdev static property API usable by any QOM type

2020-11-12 Thread Eduardo Habkost
On Thu, Nov 12, 2020 at 09:11:48AM +0100, Paolo Bonzini wrote: > On 11/11/20 19:39, Eduardo Habkost wrote: > > I will submit v3 of this series with both > > object_class_property_add_field() and > > object_class_add_field_properties() as internal QOM APIs. > > object

Re: [PATCH v2 12/12] input: Use class properties

2020-11-11 Thread Eduardo Habkost
On Wed, Nov 11, 2020 at 01:38:23PM -0500, Eduardo Habkost wrote: > Instance properties make introspection hard and are not shown by > "-object ...,help". Convert them to class properties. > > Signed-off-by: Eduardo Habkost > --- > This was originally submitted as p

[PATCH v2 10/12] netfilter: Reorder functions

2020-11-11 Thread Eduardo Habkost
Trivial code reordering in some filter backends, to make the next changes easier to review. Signed-off-by: Eduardo Habkost --- This was originally submitted as part of the series: Subject: [PATCH 00/12] qom: Make all -object types use only class properties Message-Id: <20201009160122.166208

[PATCH v2 01/12] vexpress: Register "secure" as class property

2020-11-11 Thread Eduardo Habkost
Class properties make QOM introspection simpler and easier, as they don't require an object to be instantiated. Signed-off-by: Eduardo Habkost --- Cc: Peter Maydell Cc: qemu-...@nongnu.org Cc: qemu-devel@nongnu.org --- hw/arm/vexpress.c | 11 ++- 1 file changed, 6 insertions(

[PATCH v2 05/12] arm/virt: Register most properties as class properties

2020-11-11 Thread Eduardo Habkost
Class properties make QOM introspection simpler and easier, as they don't require an object to be instantiated. Signed-off-by: Eduardo Habkost --- Cc: Peter Maydell Cc: qemu-...@nongnu.org Cc: qemu-devel@nongnu.org --- hw/arm/virt.c | 76 +++--

[PATCH v2 09/12] colo: Use class properties

2020-11-11 Thread Eduardo Habkost
Instance properties make introspection hard and are not shown by "-object ...,help". Convert them to class properties. Signed-off-by: Eduardo Habkost --- This was originally submitted as part of the series: Subject: [PATCH 00/12] qom: Make all -object types use only class properties

[PATCH v2 11/12] netfilter: Use class properties

2020-11-11 Thread Eduardo Habkost
Instance properties make introspection hard and are not shown by "-object ...,help". Convert them to class properties. Signed-off-by: Eduardo Habkost --- This was originally submitted as part of the series: Subject: [PATCH 00/12] qom: Make all -object types use only class properties

Re: [PATCH v2 00/44] Make qdev static property API usable by any QOM type

2020-11-11 Thread Eduardo Habkost
On Tue, Nov 10, 2020 at 11:38:04AM +0100, Kevin Wolf wrote: > Am 09.11.2020 um 21:28 hat Eduardo Habkost geschrieben: [...] > > Anyway, If we are the only ones discussing this, I will just > > defer to your suggestions as QOM maintainer. I hope we hear from > > others. >

[PATCH v2 08/12] can_host: Use class properties

2020-11-11 Thread Eduardo Habkost
Instance properties make introspection hard and are not shown by "-object ...,help". Convert them to class properties. Signed-off-by: Eduardo Habkost --- This was originally submitted as part of the series: Subject: [PATCH 00/12] qom: Make all -object types use only class properties

[PATCH v2 02/12] vexpress-a15: Register "virtualization" as class property

2020-11-11 Thread Eduardo Habkost
Class properties make QOM introspection simpler and easier, as they don't require an object to be instantiated. Signed-off-by: Eduardo Habkost --- Cc: Peter Maydell Cc: qemu-...@nongnu.org Cc: qemu-devel@nongnu.org --- hw/arm/vexpress.c | 14 -- 1 file changed, 8 insertions(

[PATCH v2 12/12] input: Use class properties

2020-11-11 Thread Eduardo Habkost
Instance properties make introspection hard and are not shown by "-object ...,help". Convert them to class properties. Signed-off-by: Eduardo Habkost --- This was originally submitted as part of the series: Subject: [PATCH 00/12] qom: Make all -object types use only class properties

[PATCH v2 06/12] virt: Register "its" as class property

2020-11-11 Thread Eduardo Habkost
its=on on virt-2.7 and older. Signed-off-by: Eduardo Habkost --- Cc: Peter Maydell Cc: qemu-...@nongnu.org Cc: qemu-devel@nongnu.org --- hw/arm/virt.c | 12 +++- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/hw/arm/virt.c b/hw/arm/virt.c index 53fcaf5e4f..37a020c149 1006

[PATCH v2 03/12] tmp421: Register properties as class properties

2020-11-11 Thread Eduardo Habkost
Class properties make QOM introspection simpler and easier, as they don't require an object to be instantiated. Signed-off-by: Eduardo Habkost --- Cc: qemu-devel@nongnu.org --- hw/misc/tmp421.c | 30 +- 1 file changed, 13 insertions(+), 17 deletions(-) diff --

[PATCH v2 04/12] i386: Register feature bit properties as class properties

2020-11-11 Thread Eduardo Habkost
Class properties make QOM introspection simpler and easier, as they don't require an object to be instantiated. Signed-off-by: Eduardo Habkost --- Changes v1 -> v2: * Remove x86_cpu_release_bit_prop() function, as we will allocate BitProperty only once and never free the class prope

[PATCH v2 07/12] arm/cpu64: Register "aarch64" as class property

2020-11-11 Thread Eduardo Habkost
Class properties make QOM introspection simpler and easier, as they don't require an object to be instantiated. Signed-off-by: Eduardo Habkost --- Cc: Peter Maydell Cc: qemu-...@nongnu.org Cc: qemu-devel@nongnu.org --- target/arm/cpu64.c | 16 ++-- 1 file changed, 6 inser

[PATCH v2 00/12] qom: Convert some properties to class properties

2020-11-11 Thread Eduardo Habkost
ties as class properties" * Included patches that were originally submnitted as part of "qom: Make all -object types use only class properties" * All other patches are unchanged from v1 Eduardo Habkost (12): vexpress: Register "secure" as class property vexpress-a

Re: [RFC v1 09/10] i386: split cpu.c and defer x86 models registration

2020-11-10 Thread Eduardo Habkost
On Tue, Nov 10, 2020 at 09:39:37PM +0100, Paolo Bonzini wrote: > On 10/11/20 18:55, Eduardo Habkost wrote: > > > I think we should not try yo implement interfaces conditionally (i.e. have > > > TYPE_X86_ACCEL implemented only on qemu-system-{i386,x86_64} and not > >

Re: QOM address space handling

2020-11-10 Thread Eduardo Habkost
On Tue, Nov 10, 2020 at 12:46:48PM -0500, Eduardo Habkost wrote: > On Tue, Nov 10, 2020 at 04:08:16PM +0100, Paolo Bonzini wrote: > > On 10/11/20 16:03, Eduardo Habkost wrote: > > > > Does anyone have any arguments for which solution is preferred? > > > I'd say (

Re: [RFC v1 09/10] i386: split cpu.c and defer x86 models registration

2020-11-10 Thread Eduardo Habkost
On Tue, Nov 10, 2020 at 06:38:49PM +0100, Claudio Fontana wrote: > On 11/10/20 4:23 PM, Eduardo Habkost wrote: > > On Tue, Nov 10, 2020 at 11:41:46AM +0100, Paolo Bonzini wrote: > >> On 10/11/20 11:04, Daniel P. Berrangé wrote: > >>> > >>> ie, we sho

Re: [PATCH 0/8] qom: Use qlit to represent property defaults

2020-11-10 Thread Eduardo Habkost
On Tue, Nov 10, 2020 at 05:39:08PM +0100, Paolo Bonzini wrote: > On 09/11/20 22:25, Eduardo Habkost wrote: > > Based-on: 20201104160021.2342108-1-ehabk...@redhat.com > > Git branch: > > https://gitlab.com/ehabkost/qemu/-/commits/work/qdev-qlit-defaults > > > >

Re: [RFC v1 09/10] i386: split cpu.c and defer x86 models registration

2020-11-10 Thread Eduardo Habkost
On Tue, Nov 10, 2020 at 05:05:27PM +0100, Paolo Bonzini wrote: > On 10/11/20 16:23, Eduardo Habkost wrote: > > On Tue, Nov 10, 2020 at 11:41:46AM +0100, Paolo Bonzini wrote: > > > On 10/11/20 11:04, Daniel P. Berrangé wrote: > > > > > > > > ie, we sho

Re: QOM address space handling

2020-11-10 Thread Eduardo Habkost
On Tue, Nov 10, 2020 at 04:08:16PM +0100, Paolo Bonzini wrote: > On 10/11/20 16:03, Eduardo Habkost wrote: > > > Does anyone have any arguments for which solution is preferred? > > I'd say (2) is preferred, as we don't expect object_new(T) to > > have any side e

Re: [PATCH v2 00/44] Make qdev static property API usable by any QOM type

2020-11-10 Thread Eduardo Habkost
On Tue, Nov 10, 2020 at 11:58:29AM +0100, Paolo Bonzini wrote: > On 09/11/20 21:28, Eduardo Habkost wrote: > > I don't know yet what's the best solution for the x86 feature > > case. Maybe duplicating the list of feature names would be a > > small price to pay to

Re: [RFC v1 09/10] i386: split cpu.c and defer x86 models registration

2020-11-10 Thread Eduardo Habkost
On Tue, Nov 10, 2020 at 11:41:46AM +0100, Paolo Bonzini wrote: > On 10/11/20 11:04, Daniel P. Berrangé wrote: > > > > ie, we should have one class hierarchy for CPU model definitions, and > > one class hierarchy for accelerator CPU implementations. > > > > So at runtime we then get two object in

Re: QOM address space handling

2020-11-10 Thread Eduardo Habkost
CCing Paolo, the Memory API maintainer. On Tue, Nov 10, 2020 at 11:14:39AM +, Mark Cave-Ayland wrote: > Hi all, > > This email follows on from my investigation of intermittent Travis-CI > failures in make check's device-introspect test when trying to add the patch > at https://lists.gnu.org/a

[PATCH 8/8] qom: Use qlit to represent property defaults

2020-11-09 Thread Eduardo Habkost
Using QLitObject lets us get rid of most of the .set_default_value functions, and just use object_property_set_default() directly. Signed-off-by: Eduardo Habkost --- include/hw/qdev-properties-system.h | 2 +- include/qom/field-property-internal.h | 4 --- include/qom/field-property.h

[PATCH 7/8] qom: Make object_property_set_default() public

2020-11-09 Thread Eduardo Habkost
The function will be used outside qom/object.c, to simplify the field property code that sets the property default value. Signed-off-by: Eduardo Habkost --- include/qom/object.h | 11 +++ qom/object.c | 2 +- 2 files changed, 12 insertions(+), 1 deletion(-) diff --git a

[PATCH 5/8] qlit: Support all types of QNums

2020-11-09 Thread Eduardo Habkost
Use QNumValue to represent QNums, so we can also support uint64_t and double QNum values. Add new QLIT_QNUM_(INT|UINT|DOUBLE) macros for each case. The QLIT_QNUM() macro is being kept for compatibility with existing code, but becomes just a wrapper for QLIT_QNUM_INT(). Signed-off-by: Eduardo

[PATCH 6/8] qlit: qlit_type() function

2020-11-09 Thread Eduardo Habkost
Useful function where we need to check for the qlit type before converting it to an actual QObject. Signed-off-by: Eduardo Habkost --- include/qapi/qmp/qlit.h | 5 + 1 file changed, 5 insertions(+) diff --git a/include/qapi/qmp/qlit.h b/include/qapi/qmp/qlit.h index f9e356d31e..acddb80831

[PATCH 2/8] qnum: Make qnum_get_double() get const pointer

2020-11-09 Thread Eduardo Habkost
qnum_get_double() won't change the object, the argument can be const. Signed-off-by: Eduardo Habkost --- include/qapi/qmp/qnum.h | 2 +- qobject/qnum.c | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/include/qapi/qmp/qnum.h b/include/qapi/qmp/qnum.h

[PATCH 1/8] qobject: Include API docs in docs/devel/qobject.html

2020-11-09 Thread Eduardo Habkost
Render existing doc comments at docs/devel/qobject.html. Signed-off-by: Eduardo Habkost --- docs/devel/index.rst | 1 + docs/devel/qobject.rst | 11 + include/qapi/qmp/qnum.h| 4 +++- include/qapi/qmp/qobject.h | 48 +- qobject/qnum.c

[PATCH 4/8] qnum: qnum_value_is_equal() function

2020-11-09 Thread Eduardo Habkost
Extract the QNum value comparison logic to a function that takes QNumValue* as argument. Signed-off-by: Eduardo Habkost --- include/qapi/qmp/qnum.h | 1 + qobject/qnum.c | 29 +++-- 2 files changed, 20 insertions(+), 10 deletions(-) diff --git a/include/qapi

[PATCH 3/8] qnum: QNumValue type for QNum value literals

2020-11-09 Thread Eduardo Habkost
Provide a separate QNumValue type that can be used for QNum value literals without the referencing counting and memory allocation features provided by QObject. Signed-off-by: Eduardo Habkost --- include/qapi/qmp/qnum.h | 40 +++-- qobject/qnum.c | 78

[PATCH 0/8] qom: Use qlit to represent property defaults

2020-11-09 Thread Eduardo Habkost
rid of most type-specific .set_default_value functions for QOM property types. Eduardo Habkost (8): qobject: Include API docs in docs/devel/qobject.html qnum: Make qnum_get_double() get const pointer qnum: QNumValue type for QNum value literals qnum: qnum_value_is_equal() function qlit

Re: [PATCH v2 00/44] Make qdev static property API usable by any QOM type

2020-11-09 Thread Eduardo Habkost
On Mon, Nov 09, 2020 at 08:27:21PM +0100, Paolo Bonzini wrote: > On 09/11/20 19:55, Eduardo Habkost wrote: > > On Mon, Nov 09, 2020 at 06:33:04PM +0100, Paolo Bonzini wrote: > > > On 09/11/20 18:16, Eduardo Habkost wrote: > > > > I mean extending the API to let cus

Re: [RFC v1 09/10] i386: split cpu.c and defer x86 models registration

2020-11-09 Thread Eduardo Habkost
On Mon, Nov 09, 2020 at 06:27:54PM +0100, Claudio Fontana wrote: > split cpu.c into: > > cpu.ccpuid and common x86 cpu functionality > host-cpu.c host x86 cpu functions and "host" cpu type > kvm-cpu-type.c KVM x86 cpu type > hvf-cpu-type.c HVF x86 cpu type > tcg-cpu-type.c

Re: [PATCH v2 00/44] Make qdev static property API usable by any QOM type

2020-11-09 Thread Eduardo Habkost
On Mon, Nov 09, 2020 at 06:33:04PM +0100, Paolo Bonzini wrote: > On 09/11/20 18:16, Eduardo Habkost wrote: > > On Mon, Nov 09, 2020 at 05:34:01PM +0100, Paolo Bonzini wrote: > > > On 09/11/20 16:21, Eduardo Habkost wrote: > > > > Nothing prevents us from describi

Re: [PATCH v2 00/44] Make qdev static property API usable by any QOM type

2020-11-09 Thread Eduardo Habkost
On Mon, Nov 09, 2020 at 05:34:01PM +0100, Paolo Bonzini wrote: > On 09/11/20 16:21, Eduardo Habkost wrote: > > On Mon, Nov 09, 2020 at 03:15:26PM +0100, Paolo Bonzini wrote: > > > On 09/11/20 12:34, Kevin Wolf wrote: > > > > > If all properties were like this,

Re: [PATCH v2 00/44] Make qdev static property API usable by any QOM type

2020-11-09 Thread Eduardo Habkost
On Mon, Nov 09, 2020 at 03:15:26PM +0100, Paolo Bonzini wrote: > On 09/11/20 12:34, Kevin Wolf wrote: > > > If all properties were like this, it would be okay. But the API in v2 is > > > the one that is most consistent with QOM in general. Here is how this > > > change > > > would be a loss in te

Re: [PATCH v2 00/44] Make qdev static property API usable by any QOM type

2020-11-06 Thread Eduardo Habkost
On Fri, Nov 06, 2020 at 10:50:19AM -0500, Eduardo Habkost wrote: > On Fri, Nov 06, 2020 at 10:45:11AM +0100, Kevin Wolf wrote: > > Am 04.11.2020 um 16:59 hat Eduardo Habkost geschrieben: > > > This series refactor the qdev property code so the static > > > property sy

Re: [PATCH v2 00/44] Make qdev static property API usable by any QOM type

2020-11-06 Thread Eduardo Habkost
On Fri, Nov 06, 2020 at 10:45:11AM +0100, Kevin Wolf wrote: > Am 04.11.2020 um 16:59 hat Eduardo Habkost geschrieben: > > This series refactor the qdev property code so the static > > property system can be used by any QOM type. As an example, at > > the end of the seri

Re: [PATCH v2 41/44] qdev: Move base property types to qom/property-types.c

2020-11-04 Thread Eduardo Habkost
On Wed, Nov 04, 2020 at 05:36:20PM +0100, Paolo Bonzini wrote: > On 04/11/20 17:00, Eduardo Habkost wrote: > > Move all property types from qdev-properties.c to > > qom/property-types.c. > > > > Signed-off-by: Eduardo Habkost > > --- > > Changes v1 -> v

[PATCH 4/7] qom: Replace void* parameter with Property* on field getters/setters

2020-11-04 Thread Eduardo Habkost
All field property getters and setters must interpret the fourth argument as Property*. Change the function signature of field property getters and setters to indicate that. Signed-off-by: Eduardo Habkost --- Cc: Stefan Berger Cc: Stefano Stabellini Cc: Anthony Perard Cc: Paul Durrant Cc

[PATCH 6/7] qom: Add FIELD_PTR, a type-safe wrapper for object_field_prop_ptr()

2020-11-04 Thread Eduardo Habkost
Introduce a FIELD_PTR macro that will ensure the size of the area we are accessing has the correct size, and will return a pointer of the correct type. Signed-off-by: Eduardo Habkost --- Cc: Stefan Berger Cc: Stefano Stabellini Cc: Anthony Perard Cc: Paul Durrant Cc: Kevin Wolf Cc: Max

[PATCH 3/7] qdev: Don't register unreadable legacy properties

2020-11-04 Thread Eduardo Habkost
LL is qdev_prop_link. This means every link property in the code had a useless "legacy-" property being registered. Fix this by only registering legacy properties if a .print method exists. Signed-off-by: Eduardo Habkost --- Cc: Paolo Bonzini Cc: "Daniel P. Berrangé" Cc: Eduard

[PATCH 2/7] qom: Save size of struct field in Property struct

2020-11-04 Thread Eduardo Habkost
This will let the code that reads/writes the field ensure it will never go out of bounds. Signed-off-by: Eduardo Habkost --- Cc: Paolo Bonzini Cc: "Daniel P. Berrangé" Cc: Eduardo Habkost Cc: qemu-devel@nongnu.org --- include/qom/field-property.h | 3 +++ include/qom/property-t

[PATCH 7/7] sparc: Use FIELD_PTR at nwindows getter/setter

2020-11-04 Thread Eduardo Habkost
This makes the nwindows getter and setter more consistent with the other field getters and setters (which work with any struct field). Signed-off-by: Eduardo Habkost --- Cc: Mark Cave-Ayland Cc: Artyom Tarasenko Cc: qemu-devel@nongnu.org --- target/sparc/cpu.c | 8 1 file changed, 4

[PATCH 5/7] qom: Replace void* parameter with Property* on PropertyInfo.release

2020-11-04 Thread Eduardo Habkost
The release function must interpret the third argument as Property*. Change the signature of PropertyInfo.release to indicate that. Signed-off-by: Eduardo Habkost --- Cc: Stefan Berger Cc: Paolo Bonzini Cc: "Daniel P. Berrangé" Cc: Eduardo Habkost Cc: qemu-devel@nongnu.org --- i

[PATCH 1/7] sparc: Fix property/field size mismatch for iu-version

2020-11-04 Thread Eduardo Habkost
es: de05005bf785 ("sparc: convert cpu features to qdev properties") Signed-off-by: Eduardo Habkost --- Cc: Mark Cave-Ayland Cc: Artyom Tarasenko Cc: qemu-devel@nongnu.org --- target/sparc/cpu.h | 2 +- target/sparc/cpu.c | 5 ++--- 2 files changed, 3 insertions(+), 4 deletions(-) diff --

[PATCH 0/7] qom: Field properties type safety

2020-11-04 Thread Eduardo Habkost
the series fixes one bug found using the new safety mechanism. I hope it's the only one. Eduardo Habkost (7): sparc: Fix property/field size mismatch for iu-version qom: Save size of struct field in Property struct qdev: Don't register unreadable legacy properties qom: Re

[PATCH v2 35/44] qdev: Rename qdev_propinfo_* to field_prop_*

2020-11-04 Thread Eduardo Habkost
These functions will be moved to be part of QOM, so rename them. Signed-off-by: Eduardo Habkost --- Changes v2: * Rename to field_prop_* instead of object_propinfo_* --- Cc: Paolo Bonzini Cc: "Daniel P. Berrangé" Cc: Eduardo Habkost Cc: qemu-devel@nongnu.org --- hw/core/qdev-prop-

[PATCH v2 37/44] qdev: Move qdev_prop_tpm declaration to tpm_prop.h

2020-11-04 Thread Eduardo Habkost
Move the variable declaration close to the macro that uses it. Reviewed-by: Marc-André Lureau Signed-off-by: Eduardo Habkost --- Cc: Stefan Berger Cc: Paolo Bonzini Cc: "Daniel P. Berrangé" Cc: Eduardo Habkost Cc: qemu-devel@nongnu.org --- hw/tpm/tpm_prop.h| 2 ++

[PATCH v2 34/44] qdev: Make qdev_propinfo_get_uint16() static

2020-11-04 Thread Eduardo Habkost
There are no users of the function outside qdev-properties.c. Make function static and rename it to get_uint16(). Reviewed-by: Marc-André Lureau Signed-off-by: Eduardo Habkost --- Cc: Paolo Bonzini Cc: "Daniel P. Berrangé" Cc: Eduardo Habkost Cc: qemu-devel@nongnu.org --- hw/core

<    3   4   5   6   7   8   9   10   11   12   >