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

Eduardo Habkost posted 8 patches 3 years, 5 months ago
Test checkpatch failed
Patches applied successfully (tree, apply log)
git fetch https://github.com/patchew-project/qemu tags/patchew/20201109212556.3934583-1-ehabkost@redhat.com
Maintainers: Markus Armbruster <armbru@redhat.com>, Paolo Bonzini <pbonzini@redhat.com>, "Daniel P. Berrangé" <berrange@redhat.com>, Eduardo Habkost <ehabkost@redhat.com>
There is a newer version of this series
docs/devel/index.rst                  |   1 +
docs/devel/qobject.rst                |  11 +++
include/hw/qdev-properties-system.h   |   2 +-
include/qapi/qmp/qlit.h               |  16 +++-
include/qapi/qmp/qnum.h               |  47 ++++++++++-
include/qapi/qmp/qobject.h            |  48 +++++++----
include/qom/field-property-internal.h |   4 -
include/qom/field-property.h          |  26 +++---
include/qom/object.h                  |  11 +++
include/qom/property-types.h          |  21 ++---
hw/core/qdev-properties-system.c      |   8 --
qobject/qlit.c                        |   4 +-
qobject/qnum.c                        | 116 +++++++++++++++-----------
qom/field-property.c                  |  27 ++++--
qom/object.c                          |   2 +-
qom/property-types.c                  |  36 ++------
tests/check-qjson.c                   |  72 ++++++++++++++--
17 files changed, 295 insertions(+), 157 deletions(-)
create mode 100644 docs/devel/qobject.rst
[PATCH 0/8] qom: Use qlit to represent property defaults
Posted by Eduardo Habkost 3 years, 5 months ago
Based-on: 20201104160021.2342108-1-ehabkost@redhat.com
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.

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: Support all types of QNums
  qlit: qlit_type() function
  qom: Make object_property_set_default() public
  qom: Use qlit to represent property defaults

 docs/devel/index.rst                  |   1 +
 docs/devel/qobject.rst                |  11 +++
 include/hw/qdev-properties-system.h   |   2 +-
 include/qapi/qmp/qlit.h               |  16 +++-
 include/qapi/qmp/qnum.h               |  47 ++++++++++-
 include/qapi/qmp/qobject.h            |  48 +++++++----
 include/qom/field-property-internal.h |   4 -
 include/qom/field-property.h          |  26 +++---
 include/qom/object.h                  |  11 +++
 include/qom/property-types.h          |  21 ++---
 hw/core/qdev-properties-system.c      |   8 --
 qobject/qlit.c                        |   4 +-
 qobject/qnum.c                        | 116 +++++++++++++++-----------
 qom/field-property.c                  |  27 ++++--
 qom/object.c                          |   2 +-
 qom/property-types.c                  |  36 ++------
 tests/check-qjson.c                   |  72 ++++++++++++++--
 17 files changed, 295 insertions(+), 157 deletions(-)
 create mode 100644 docs/devel/qobject.rst

-- 
2.28.0



Re: [PATCH 0/8] qom: Use qlit to represent property defaults
Posted by no-reply@patchew.org 3 years, 5 months ago
Patchew URL: https://patchew.org/QEMU/20201109212556.3934583-1-ehabkost@redhat.com/



Hi,

This series seems to have some coding style problems. See output below for
more information:

Message-id: 20201109212556.3934583-1-ehabkost@redhat.com
Subject: [PATCH 0/8] qom: Use qlit to represent property defaults
Type: series

=== TEST SCRIPT BEGIN ===
#!/bin/bash
git rev-parse base > /dev/null || exit 0
git config --local diff.renamelimit 0
git config --local diff.renames True
git config --local diff.algorithm histogram
./scripts/checkpatch.pl --mailback base..
=== TEST SCRIPT END ===

Updating 3c8cf5a9c21ff8782164d1def7f44bd888713384
From https://github.com/patchew-project/qemu
 * [new tag]         patchew/20201109212556.3934583-1-ehabkost@redhat.com -> patchew/20201109212556.3934583-1-ehabkost@redhat.com
Switched to a new branch 'test'
514115e qom: Use qlit to represent property defaults
2ca3561 qom: Make object_property_set_default() public
4c261ae qlit: qlit_type() function
8b601c4 qlit: Support all types of QNums
2d5f1af qnum: qnum_value_is_equal() function
be74c49 qnum: QNumValue type for QNum value literals
87b0edc qnum: Make qnum_get_double() get const pointer
ab4b510 qobject: Include API docs in docs/devel/qobject.html

=== OUTPUT BEGIN ===
1/8 Checking commit ab4b510c0e22 (qobject: Include API docs in docs/devel/qobject.html)
WARNING: added, moved or deleted file(s), does MAINTAINERS need updating?
#23: 
new file mode 100644

total: 0 errors, 1 warnings, 201 lines checked

Patch 1/8 has style problems, please review.  If any of these errors
are false positives report them to the maintainer, see
CHECKPATCH in MAINTAINERS.
2/8 Checking commit 87b0edcb50a7 (qnum: Make qnum_get_double() get const pointer)
3/8 Checking commit be74c4978f05 (qnum: QNumValue type for QNum value literals)
4/8 Checking commit 2d5f1af84646 (qnum: qnum_value_is_equal() function)
5/8 Checking commit 8b601c44266e (qlit: Support all types of QNums)
ERROR: line over 90 characters
#64: FILE: qobject/qlit.c:74:
+        return qnum_value_is_equal(&lhs->value.qnum, qnum_get_value(qobject_to(QNum, rhs)));

total: 1 errors, 0 warnings, 154 lines checked

Patch 5/8 has style problems, please review.  If any of these errors
are false positives report them to the maintainer, see
CHECKPATCH in MAINTAINERS.

6/8 Checking commit 4c261ae4c3f2 (qlit: qlit_type() function)
7/8 Checking commit 2ca3561ee690 (qom: Make object_property_set_default() public)
8/8 Checking commit 514115e597f1 (qom: Use qlit to represent property defaults)
WARNING: Block comments use a leading /* on a separate line
#148: FILE: include/qom/property-types.h:33:
+        /* Note that __VA_ARGS__ can still override .defval */   \

total: 0 errors, 1 warnings, 325 lines checked

Patch 8/8 has style problems, please review.  If any of these errors
are false positives report them to the maintainer, see
CHECKPATCH in MAINTAINERS.
=== OUTPUT END ===

Test command exited with code: 1


The full log is available at
http://patchew.org/logs/20201109212556.3934583-1-ehabkost@redhat.com/testing.checkpatch/?type=message.
---
Email generated automatically by Patchew [https://patchew.org/].
Please send your feedback to patchew-devel@redhat.com
Re: [PATCH 0/8] qom: Use qlit to represent property defaults
Posted by Paolo Bonzini 3 years, 5 months ago
On 09/11/20 22:25, Eduardo Habkost wrote:
> Based-on: 20201104160021.2342108-1-ehabkost@redhat.com
> 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.
> 
> 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: Support all types of QNums
>    qlit: qlit_type() function
>    qom: Make object_property_set_default() public
>    qom: Use qlit to represent property defaults
> 
>   docs/devel/index.rst                  |   1 +
>   docs/devel/qobject.rst                |  11 +++
>   include/hw/qdev-properties-system.h   |   2 +-
>   include/qapi/qmp/qlit.h               |  16 +++-
>   include/qapi/qmp/qnum.h               |  47 ++++++++++-
>   include/qapi/qmp/qobject.h            |  48 +++++++----
>   include/qom/field-property-internal.h |   4 -
>   include/qom/field-property.h          |  26 +++---
>   include/qom/object.h                  |  11 +++
>   include/qom/property-types.h          |  21 ++---
>   hw/core/qdev-properties-system.c      |   8 --
>   qobject/qlit.c                        |   4 +-
>   qobject/qnum.c                        | 116 +++++++++++++++-----------
>   qom/field-property.c                  |  27 ++++--
>   qom/object.c                          |   2 +-
>   qom/property-types.c                  |  36 ++------
>   tests/check-qjson.c                   |  72 ++++++++++++++--
>   17 files changed, 295 insertions(+), 157 deletions(-)
>   create mode 100644 docs/devel/qobject.rst
> 

Acked-by: Paolo Bonzini <pbonzini@redhat.com>

Thanks,

Paolo


Re: [PATCH 0/8] qom: Use qlit to represent property defaults
Posted by Eduardo Habkost 3 years, 5 months ago
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-ehabkost@redhat.com
> > 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.
> > 
> > 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: Support all types of QNums
> >    qlit: qlit_type() function
> >    qom: Make object_property_set_default() public
> >    qom: Use qlit to represent property defaults
> > 
> >   docs/devel/index.rst                  |   1 +
> >   docs/devel/qobject.rst                |  11 +++
> >   include/hw/qdev-properties-system.h   |   2 +-
> >   include/qapi/qmp/qlit.h               |  16 +++-
> >   include/qapi/qmp/qnum.h               |  47 ++++++++++-
> >   include/qapi/qmp/qobject.h            |  48 +++++++----
> >   include/qom/field-property-internal.h |   4 -
> >   include/qom/field-property.h          |  26 +++---
> >   include/qom/object.h                  |  11 +++
> >   include/qom/property-types.h          |  21 ++---
> >   hw/core/qdev-properties-system.c      |   8 --
> >   qobject/qlit.c                        |   4 +-
> >   qobject/qnum.c                        | 116 +++++++++++++++-----------
> >   qom/field-property.c                  |  27 ++++--
> >   qom/object.c                          |   2 +-
> >   qom/property-types.c                  |  36 ++------
> >   tests/check-qjson.c                   |  72 ++++++++++++++--
> >   17 files changed, 295 insertions(+), 157 deletions(-)
> >   create mode 100644 docs/devel/qobject.rst
> > 
> 
> Acked-by: Paolo Bonzini <pbonzini@redhat.com>

Thanks!

It looks like I broke some unit tests in this series.  I will
submit v2 after submitting v3 of the field property series.

-- 
Eduardo