Skip to content

qom: Use qlit to represent property defaults

Eduardo Habkost qemu-devel 3 versions – In review

Get series with b4
b4 am [email protected]

Versions newest first · linked by author and title

  1. v3 Latest19 patches 9 repliesIn review
  2. v28 patches 45 repliesSuperseded
  3. v18 patches 2 repliesSuperseded

Changes in v3 from the cover letter

* qnum/qlit patches:
* Variable naming in qnum code
* Coding style changes in qnum code
* Split "qlit: Support all types of QNums"
in smaller patches
* Replace QLIT_QNUM with QLIT_QNUM_INT
* Extend test cases, move most of the new test case code to check-qlit.c
* Remove qnum_get_value() and qlit_get_type() function
* Removed kernel-doc conversion patch, to reduce noise in series review
* qom patches:
* Split "qom: Use qlit to represent property defaults" in smaller patches, hopefully making review easier
* Small changes in UUID property code (See
"qom: Don't ignore defval on UUID property" and
"qom: Fix documentation of UUID property type")

Patches in v3 No applies recorded yet

#Subject and filesSizeRepliesApplied
1/19qnum: Make qnum_get_double() get const pointerinclude/qapi/qmp/qnum.h qobject/qnum.c+2 -20 replies
2/19qnum: Make num_x/num_y variables at qnum_is_equal() constqobject/qnum.c+2 -20 replies
3/19qnum: QNumValue type for QNum value literalsinclude/qapi/qmp/qnum.h qobject/qnum.c tests/check-qnum.c+76 -520 replies
4/19qnum: qnum_value_is_equal() functioninclude/qapi/qmp/qnum.h qobject/qnum.c+17 -80 replies
5/19qlit: Use qnum_value_is_equal() when comparing QNumsqobject/qlit.c tests/check-qlit.c+21 -10 replies
6/19qlit: Rename QLIT_QNUM to QLIT_QNUM_INTinclude/qapi/qmp/qlit.h tests/check-qjson.c tests/check-qlit.c+21 -210 replies
7/19qlit: Use QNumValue to represent QNumsinclude/qapi/qmp/qlit.h qobject/qlit.c+5 -40 replies
8/19qlit: Move qlit_equal_qobject() reference values to arraytests/check-qlit.c+19 -73 replies
9/19qlit: Add more test literals to qlit_equal_qobject() test casetests/check-qlit.c+16 -00 replies
10/19qlit: Support all types of QNumsinclude/qapi/qmp/qlit.h tests/check-qlit.c+9 -04 replies
11/19qom: field_prop_set_default_value() helperqom/field-property.c+16 -82 replies
12/19qom: Replace defval value in Property with QLitObjecthw/core/qdev-properties-system.c include/hw/qdev-properties-system.h include/qom/field-property-internal.h +4 more+54 -440 replies
13/19qom: Fix documentation of UUID property typehw/core/qdev-properties-system.c+1 -10 replies
14/19qom: Don't ignore defval on UUID propertyhw/core/qdev-properties-system.c include/hw/qdev-properties-system.h+8 -110 replies
15/19qom: Make object_property_set_default() publicinclude/qom/object.h qom/object.c+12 -10 replies
16/19qom: Make PropertyInfo.set_default_value optionalinclude/qom/field-property.h qom/field-property.c+13 -20 replies
17/19qom: Delete field_prop_set_default_value_*int()hw/core/qdev-properties-system.c include/qom/field-property-internal.h qom/property-types.c+0 -330 replies
18/19qom: Delete set_default_uuid()hw/core/qdev-properties-system.c+0 -80 replies
19/19qom: Delete set_default_value_bool()qom/property-types.c+0 -100 replies

Reviews trailers per patch

2 of 19 patches have a Reviewed-by or Acked-by.

PatchMarc-André Lureau
1/19R-b
2/19
3/19
4/19
5/19
6/19
7/19
8/19
9/19
10/19
11/19
12/19
13/19
14/19
15/19R-b
16/19
17/19
18/19
19/19

Trailers given in replies are filled; those carried in the patches from earlier versions are outlined with dashes.

Read the v3 thread

Cover letter [PATCH v3 00/19] qom: Use qlit to represent property defaults

Based-on: [email protected]
Git branch: https://gitlab.com/ehabkost/qemu/-/commits/work/qdev-qlit-defaults

This extend qlit.h to support all QNum types (signed int, unsigned int, and double), and use QLitObject to represent field property defaults.

It allows us to get rid of most type-specific .set_default_value functions for QOM property types.

The only remaining .set_default_value function in the code is field_prop_set_default_value_enum(). This will take a bit more work because the default is currently stored as int, but parsed as string, so it will be addressed in a separate series.

Changes v2 -> v3:

* qnum/qlit patches:
* Variable naming in qnum code
* Coding style changes in qnum code
* Split "qlit: Support all types of QNums"
in smaller patches
* Replace QLIT_QNUM with QLIT_QNUM_INT
* Extend test cases, move most of the new test case code to check-qlit.c
* Remove qnum_get_value() and qlit_get_type() function
* Removed kernel-doc conversion patch, to reduce noise in series review
* qom patches:
* Split "qom: Use qlit to represent property defaults" in smaller patches, hopefully making review easier
* Small changes in UUID property code (See
"qom: Don't ignore defval on UUID property" and
"qom: Fix documentation of UUID property type")

Changes v1 -> v2:
* Rebase to latest version of field properties series
* Fix unit test failure
* Coding style changes

Eduardo Habkost (19):
qnum: Make qnum_get_double() get const pointer
qnum: Make num_x/num_y variables at qnum_is_equal() const
qnum: QNumValue type for QNum value literals
qnum: qnum_value_is_equal() function
qlit: Use qnum_value_is_equal() when comparing QNums
qlit: Rename QLIT_QNUM to QLIT_QNUM_INT
qlit: Use QNumValue to represent QNums
qlit: Move qlit_equal_qobject() reference values to array
qlit: Add more test literals to qlit_equal_qobject() test case
qlit: Support all types of QNums
qom: field_prop_set_default_value() helper
qom: Replace defval value in Property with QLitObject
qom: Fix documentation of UUID property type
qom: Don't ignore defval on UUID property
qom: Make object_property_set_default() public
qom: Make PropertyInfo.set_default_value optional
qom: Delete field_prop_set_default_value_*int()
qom: Delete set_default_uuid()
qom: Delete set_default_value_bool()

 include/hw/qdev-properties-system.h   |   4 +-
 include/qapi/qmp/qlit.h               |  11 ++-
 include/qapi/qmp/qnum.h               |  26 +++++-
 include/qom/field-property-internal.h |   7 +-
 include/qom/field-property.h          |  30 +++----
 include/qom/object.h                  |  11 +++
 include/qom/property-types.h          |  18 ++--
 hw/core/qdev-properties-system.c      |  13 +--
 qobject/qlit.c                        |   5 +-
 qobject/qnum.c                        | 113 ++++++++++++++------------
 qom/field-property.c                  |  36 ++++++--
 qom/object.c                          |   2 +-
 qom/property-types.c                  |  37 ++-------
 tests/check-qjson.c                   |  30 +++----
 tests/check-qlit.c                    |  72 +++++++++++++---
 tests/check-qnum.c                    |  14 ++--
 16 files changed, 253 insertions(+), 176 deletions(-)
Signature · 1 line
2.28.0