[Qemu-devel] [PATCH 00/17] qobject/qapi: add uint type

Marc-André Lureau posted 17 patches 6 years, 10 months ago
Patches applied successfully (tree, apply log)
git fetch https://github.com/patchew-project/qemu tags/patchew/20170509173559.31598-1-marcandre.lureau@redhat.com
Test checkpatch failed
Test docker passed
Test s390x passed
There is a newer version of this series
include/qapi/visitor.h                   |   4 +-
include/qapi/visitor-impl.h              |   2 +-
scripts/qapi.py                          |  30 ++---
scripts/qapi-visit.py                    |  12 +-
include/hw/isa/isa.h                     |   2 +-
include/hw/qdev-core.h                   |   6 +-
include/hw/qdev-properties.h             |  72 ++++++------
include/qapi/qmp/qdict.h                 |  10 +-
include/qapi/qmp/qfloat.h                |  29 -----
include/qapi/qmp/qint.h                  |  28 -----
include/qapi/qmp/qlist.h                 |   4 +-
include/qapi/qmp/qnum.h                  |  47 ++++++++
include/qapi/qmp/qobject.h               |   7 ++
include/qapi/qmp/types.h                 |   3 +-
include/qapi/qobject-input-visitor.h     |   2 +-
include/qapi/qobject-output-visitor.h    |   8 +-
include/qom/object.h                     |  23 ++++
qapi/qapi-visit-core.c                   |   6 +-
backends/cryptodev.c                     |   2 +-
block/blkdebug.c                         |   1 -
block/nbd.c                              |   1 -
block/nfs.c                              |   1 -
block/qapi.c                             |  93 +--------------
block/quorum.c                           |   1 -
block/sheepdog.c                         |   1 -
block/ssh.c                              |   1 -
block/vvfat.c                            |   1 -
blockdev.c                               |   5 +-
hw/acpi/ich9.c                           |  24 ++--
hw/acpi/memory_hotplug.c                 |  10 +-
hw/acpi/nvdimm.c                         |  10 +-
hw/acpi/pcihp.c                          |   7 +-
hw/acpi/piix4.c                          |   8 +-
hw/arm/aspeed.c                          |   4 +-
hw/arm/bcm2835_peripherals.c             |   9 +-
hw/arm/raspi.c                           |   4 +-
hw/block/fdc.c                           |  54 ++++-----
hw/core/platform-bus.c                   |   2 +-
hw/core/qdev-properties.c                |   8 +-
hw/core/qdev.c                           |  44 ++++++--
hw/i386/acpi-build.c                     |  71 ++++++------
hw/i386/pc.c                             |   6 +-
hw/i386/xen/xen-hvm.c                    |   6 +-
hw/intc/arm_gicv3_common.c               |   2 +-
hw/mem/pc-dimm.c                         |   5 +-
hw/misc/auxbus.c                         |   2 +-
hw/misc/pvpanic.c                        |   2 +-
hw/net/e1000e.c                          |  14 +--
hw/pci-host/gpex.c                       |   2 +-
hw/pci-host/piix.c                       |   8 +-
hw/pci-host/q35.c                        |  12 +-
hw/pci-host/xilinx-pcie.c                |   2 +-
hw/ppc/pnv.c                             |   2 +-
hw/ppc/pnv_core.c                        |   2 +-
hw/ppc/spapr.c                           |   8 +-
hw/usb/xen-usb.c                         |   1 -
monitor.c                                |   2 +-
net/dump.c                               |   2 +-
net/filter-buffer.c                      |   2 +-
numa.c                                   |   6 +-
qapi/qapi-clone-visitor.c                |   2 +-
qapi/qapi-dealloc-visitor.c              |   2 +-
qapi/qobject-input-visitor.c             |  47 ++++----
qapi/qobject-output-visitor.c            |   7 +-
qga/commands.c                           |   2 +-
qga/main.c                               |   1 -
qobject/json-lexer.c                     |   4 +
qobject/json-parser.c                    |  42 ++++---
qobject/qdict.c                          | 106 ++++++++++++++----
qobject/qfloat.c                         |  62 ----------
qobject/qint.c                           |  61 ----------
qobject/qjson.c                          |  37 +-----
qobject/qlist.c                          |  23 ++++
qobject/qnum.c                           | 187 +++++++++++++++++++++++++++++++
qobject/qobject.c                        |  22 +++-
qom/object.c                             |  60 ++++++++--
target/i386/cpu.c                        |  12 +-
tests/check-qdict.c                      |  55 +++++++--
tests/check-qfloat.c                     |  53 ---------
tests/check-qint.c                       |  87 --------------
tests/check-qjson.c                      | 131 +++++++++++++++-------
tests/check-qlist.c                      |  15 +--
tests/check-qnum.c                       | 182 ++++++++++++++++++++++++++++++
tests/test-keyval.c                      |   4 -
tests/test-qmp-commands.c                |   6 +-
tests/test-qmp-event.c                   |   7 +-
tests/test-qobject-input-visitor.c       |  65 +++--------
tests/test-qobject-output-visitor.c      |  73 +++++++-----
tests/test-x86-cpuid-compat.c            |  13 +--
ui/console.c                             |   4 +-
ui/spice-core.c                          |   1 -
ui/vnc-enc-tight.c                       |   1 -
util/qemu-option.c                       |  20 +---
MAINTAINERS                              |   3 +-
qapi/trace-events                        |   2 +-
qobject/Makefile.objs                    |   2 +-
scripts/coccinelle/qobject.cocci         |   4 +-
tests/.gitignore                         |   3 +-
tests/Makefile.include                   |  13 +--
tests/qapi-schema/comments.out           |   2 +-
tests/qapi-schema/doc-good.out           |   2 +-
tests/qapi-schema/empty.out              |   2 +-
tests/qapi-schema/event-case.out         |   2 +-
tests/qapi-schema/ident-with-escape.out  |   2 +-
tests/qapi-schema/include-relpath.out    |   2 +-
tests/qapi-schema/include-repetition.out |   2 +-
tests/qapi-schema/include-simple.out     |   2 +-
tests/qapi-schema/indented-expr.out      |   2 +-
tests/qapi-schema/qapi-schema-test.json  |   2 -
tests/qapi-schema/qapi-schema-test.out   |  10 +-
110 files changed, 1211 insertions(+), 983 deletions(-)
delete mode 100644 include/qapi/qmp/qfloat.h
delete mode 100644 include/qapi/qmp/qint.h
create mode 100644 include/qapi/qmp/qnum.h
delete mode 100644 qobject/qfloat.c
delete mode 100644 qobject/qint.c
create mode 100644 qobject/qnum.c
delete mode 100644 tests/check-qfloat.c
delete mode 100644 tests/check-qint.c
create mode 100644 tests/check-qnum.c
[Qemu-devel] [PATCH 00/17] qobject/qapi: add uint type
Posted by Marc-André Lureau 6 years, 10 months ago
Hi,

In previously sent series "[PATCH 00/21] WIP: dump: add kaslr support
(for after 2.9)", I proposed changes to accept uint64 values from
json, by adding a QUint type. During review, it was suggested to
introduce a QNum type to hold various number representations.

This series introduces the QNum type, adds uint representation to it,
and make uint64 values over json possible (while keeping json negative
int for values >INT64_MAX to unsigned cast compatibility). It also
improves some int vs uint usage for object properties and other
QObject related clean-ups.

The series is on top of http://repo.or.cz/qemu/armbru.git qapi-next

Marc-André Lureau (17):
  qdev: remove PropertyInfo.qtype field
  object: fix potential leak in getters
  tests: remove alt num-int cases
  qapi: merge QInt and QFloat in QNum
  qapi: remove promote_int
  qnum: add uint type
  json: learn to parse uint64 numbers
  qapi: update the qobject visitor to use QUInt
  qnum: fix get_int() with values > INT64_MAX
  object: add uint property setter/getter
  object: use more specific property type names
  qdev: use int and uint properties as appropriate
  qdev: use appropriate getter/setters type
  acpi: fix s3/s4 disabled type
  Use uint property getter/setter where appropriate
  RFC: qdict: add uint
  qobject: move dump_qobject() from block/ to qobject/

 include/qapi/visitor.h                   |   4 +-
 include/qapi/visitor-impl.h              |   2 +-
 scripts/qapi.py                          |  30 ++---
 scripts/qapi-visit.py                    |  12 +-
 include/hw/isa/isa.h                     |   2 +-
 include/hw/qdev-core.h                   |   6 +-
 include/hw/qdev-properties.h             |  72 ++++++------
 include/qapi/qmp/qdict.h                 |  10 +-
 include/qapi/qmp/qfloat.h                |  29 -----
 include/qapi/qmp/qint.h                  |  28 -----
 include/qapi/qmp/qlist.h                 |   4 +-
 include/qapi/qmp/qnum.h                  |  47 ++++++++
 include/qapi/qmp/qobject.h               |   7 ++
 include/qapi/qmp/types.h                 |   3 +-
 include/qapi/qobject-input-visitor.h     |   2 +-
 include/qapi/qobject-output-visitor.h    |   8 +-
 include/qom/object.h                     |  23 ++++
 qapi/qapi-visit-core.c                   |   6 +-
 backends/cryptodev.c                     |   2 +-
 block/blkdebug.c                         |   1 -
 block/nbd.c                              |   1 -
 block/nfs.c                              |   1 -
 block/qapi.c                             |  93 +--------------
 block/quorum.c                           |   1 -
 block/sheepdog.c                         |   1 -
 block/ssh.c                              |   1 -
 block/vvfat.c                            |   1 -
 blockdev.c                               |   5 +-
 hw/acpi/ich9.c                           |  24 ++--
 hw/acpi/memory_hotplug.c                 |  10 +-
 hw/acpi/nvdimm.c                         |  10 +-
 hw/acpi/pcihp.c                          |   7 +-
 hw/acpi/piix4.c                          |   8 +-
 hw/arm/aspeed.c                          |   4 +-
 hw/arm/bcm2835_peripherals.c             |   9 +-
 hw/arm/raspi.c                           |   4 +-
 hw/block/fdc.c                           |  54 ++++-----
 hw/core/platform-bus.c                   |   2 +-
 hw/core/qdev-properties.c                |   8 +-
 hw/core/qdev.c                           |  44 ++++++--
 hw/i386/acpi-build.c                     |  71 ++++++------
 hw/i386/pc.c                             |   6 +-
 hw/i386/xen/xen-hvm.c                    |   6 +-
 hw/intc/arm_gicv3_common.c               |   2 +-
 hw/mem/pc-dimm.c                         |   5 +-
 hw/misc/auxbus.c                         |   2 +-
 hw/misc/pvpanic.c                        |   2 +-
 hw/net/e1000e.c                          |  14 +--
 hw/pci-host/gpex.c                       |   2 +-
 hw/pci-host/piix.c                       |   8 +-
 hw/pci-host/q35.c                        |  12 +-
 hw/pci-host/xilinx-pcie.c                |   2 +-
 hw/ppc/pnv.c                             |   2 +-
 hw/ppc/pnv_core.c                        |   2 +-
 hw/ppc/spapr.c                           |   8 +-
 hw/usb/xen-usb.c                         |   1 -
 monitor.c                                |   2 +-
 net/dump.c                               |   2 +-
 net/filter-buffer.c                      |   2 +-
 numa.c                                   |   6 +-
 qapi/qapi-clone-visitor.c                |   2 +-
 qapi/qapi-dealloc-visitor.c              |   2 +-
 qapi/qobject-input-visitor.c             |  47 ++++----
 qapi/qobject-output-visitor.c            |   7 +-
 qga/commands.c                           |   2 +-
 qga/main.c                               |   1 -
 qobject/json-lexer.c                     |   4 +
 qobject/json-parser.c                    |  42 ++++---
 qobject/qdict.c                          | 106 ++++++++++++++----
 qobject/qfloat.c                         |  62 ----------
 qobject/qint.c                           |  61 ----------
 qobject/qjson.c                          |  37 +-----
 qobject/qlist.c                          |  23 ++++
 qobject/qnum.c                           | 187 +++++++++++++++++++++++++++++++
 qobject/qobject.c                        |  22 +++-
 qom/object.c                             |  60 ++++++++--
 target/i386/cpu.c                        |  12 +-
 tests/check-qdict.c                      |  55 +++++++--
 tests/check-qfloat.c                     |  53 ---------
 tests/check-qint.c                       |  87 --------------
 tests/check-qjson.c                      | 131 +++++++++++++++-------
 tests/check-qlist.c                      |  15 +--
 tests/check-qnum.c                       | 182 ++++++++++++++++++++++++++++++
 tests/test-keyval.c                      |   4 -
 tests/test-qmp-commands.c                |   6 +-
 tests/test-qmp-event.c                   |   7 +-
 tests/test-qobject-input-visitor.c       |  65 +++--------
 tests/test-qobject-output-visitor.c      |  73 +++++++-----
 tests/test-x86-cpuid-compat.c            |  13 +--
 ui/console.c                             |   4 +-
 ui/spice-core.c                          |   1 -
 ui/vnc-enc-tight.c                       |   1 -
 util/qemu-option.c                       |  20 +---
 MAINTAINERS                              |   3 +-
 qapi/trace-events                        |   2 +-
 qobject/Makefile.objs                    |   2 +-
 scripts/coccinelle/qobject.cocci         |   4 +-
 tests/.gitignore                         |   3 +-
 tests/Makefile.include                   |  13 +--
 tests/qapi-schema/comments.out           |   2 +-
 tests/qapi-schema/doc-good.out           |   2 +-
 tests/qapi-schema/empty.out              |   2 +-
 tests/qapi-schema/event-case.out         |   2 +-
 tests/qapi-schema/ident-with-escape.out  |   2 +-
 tests/qapi-schema/include-relpath.out    |   2 +-
 tests/qapi-schema/include-repetition.out |   2 +-
 tests/qapi-schema/include-simple.out     |   2 +-
 tests/qapi-schema/indented-expr.out      |   2 +-
 tests/qapi-schema/qapi-schema-test.json  |   2 -
 tests/qapi-schema/qapi-schema-test.out   |  10 +-
 110 files changed, 1211 insertions(+), 983 deletions(-)
 delete mode 100644 include/qapi/qmp/qfloat.h
 delete mode 100644 include/qapi/qmp/qint.h
 create mode 100644 include/qapi/qmp/qnum.h
 delete mode 100644 qobject/qfloat.c
 delete mode 100644 qobject/qint.c
 create mode 100644 qobject/qnum.c
 delete mode 100644 tests/check-qfloat.c
 delete mode 100644 tests/check-qint.c
 create mode 100644 tests/check-qnum.c

-- 
2.13.0.rc1.16.gd80b50c3f


Re: [Qemu-devel] [PATCH 00/17] qobject/qapi: add uint type
Posted by no-reply@patchew.org 6 years, 10 months ago
Hi,

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

Subject: [Qemu-devel] [PATCH 00/17] qobject/qapi: add uint type
Type: series
Message-id: 20170509173559.31598-1-marcandre.lureau@redhat.com

=== TEST SCRIPT BEGIN ===
#!/bin/bash

BASE=base
n=1
total=$(git log --oneline $BASE.. | wc -l)
failed=0

git config --local diff.renamelimit 0
git config --local diff.renames True

commits="$(git log --format=%H --reverse $BASE..)"
for c in $commits; do
    echo "Checking PATCH $n/$total: $(git log -n 1 --format=%s $c)..."
    if ! git show $c --format=email | ./scripts/checkpatch.pl --mailback -; then
        failed=1
        echo
    fi
    n=$((n+1))
done

exit $failed
=== TEST SCRIPT END ===

Updating 3c8cf5a9c21ff8782164d1def7f44bd888713384
From https://github.com/patchew-project/qemu
 - [tag update]      patchew/1494553288-30764-1-git-send-email-zhangchen.fnst@cn.fujitsu.com -> patchew/1494553288-30764-1-git-send-email-zhangchen.fnst@cn.fujitsu.com
 - [tag update]      patchew/20170513004616.25749-1-n54@gmx.com -> patchew/20170513004616.25749-1-n54@gmx.com
Switched to a new branch 'test'
b371cbd qobject: move dump_qobject() from block/ to qobject/
bfd6fc7 RFC: qdict: add uint
dcd5370 Use uint property getter/setter where appropriate
143e214 acpi: fix s3/s4 disabled type
d99e973 qdev: use appropriate getter/setters type
db1dfea qdev: use int and uint properties as appropriate
16017fd object: use more specific property type names
741b10f object: add uint property setter/getter
b3804bd qnum: fix get_int() with values > INT64_MAX
2aba7fc qapi: update the qobject visitor to use QUInt
5e637e4 json: learn to parse uint64 numbers
03c3c0a qnum: add uint type
f9011a3 qapi: remove promote_int
755c246 qapi: merge QInt and QFloat in QNum
4d37032 tests: remove alt num-int cases
e9722ac object: fix potential leak in getters
988cb53 qdev: remove PropertyInfo.qtype field

=== OUTPUT BEGIN ===
Checking PATCH 1/17: qdev: remove PropertyInfo.qtype field...
Checking PATCH 2/17: object: fix potential leak in getters...
Checking PATCH 3/17: tests: remove alt num-int cases...
Checking PATCH 4/17: qapi: merge QInt and QFloat in QNum...
ERROR: do not use C99 // comments
#1885: FILE: tests/check-qnum.c:35:
+    // destroy doesn't exit yet

ERROR: do not use C99 // comments
#1900: FILE: tests/check-qnum.c:50:
+    // destroy doesn't exit yet

total: 2 errors, 0 warnings, 1766 lines checked

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

Checking PATCH 5/17: qapi: remove promote_int...
Checking PATCH 6/17: qnum: add uint type...
ERROR: do not use C99 // comments
#152: FILE: tests/check-qnum.c:50:
+    // destroy doesn't exit yet

total: 1 errors, 0 warnings, 182 lines checked

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

Checking PATCH 7/17: json: learn to parse uint64 numbers...
Checking PATCH 8/17: qapi: update the qobject visitor to use QUInt...
Checking PATCH 9/17: qnum: fix get_int() with values > INT64_MAX...
Checking PATCH 10/17: object: add uint property setter/getter...
Checking PATCH 11/17: object: use more specific property type names...
Checking PATCH 12/17: qdev: use int and uint properties as appropriate...
Checking PATCH 13/17: qdev: use appropriate getter/setters type...
Checking PATCH 14/17: acpi: fix s3/s4 disabled type...
Checking PATCH 15/17: Use uint property getter/setter where appropriate...
Checking PATCH 16/17: RFC: qdict: add uint...
Checking PATCH 17/17: qobject: move dump_qobject() from block/ to qobject/...
=== OUTPUT END ===

Test command exited with code: 1


---
Email generated automatically by Patchew [http://patchew.org/].
Please send your feedback to patchew-devel@freelists.org