Skip to content

add fixed-width visitors and serialization tests

Michael Roth qemu-devel 4 versions – New

Get series with b4
b4 am [email protected]

Versions newest first · linked by author and title

  1. v4 Latest7 patches 0 repliesNew
  2. v37 patches 0 repliesSuperseded
  3. v26 patches 4 repliesSuperseded
Earlier versions · 1
VersionPostedPatchesRepliesStatus
v13 patches0 repliesSuperseded

Changes in v4 from the cover letter

- Rebased on master and re-tested

Patches in v4 No applies recorded yet

#Subject and filesSizeRepliesApplied
1/7qapi: add Visitor interfaces for uint*_t and int*_thw/mc146818rtc.c qapi/qapi-visit-core.c qapi/qapi-visit-core.h+155 -70 replies
2/7qapi: unit tests for visitor-based serializationtest-visitor-serialization.c tests/Makefile+749 -10 replies
3/7qapi: QMP input visitor, handle floats parsed as intsqapi/qmp-input-visitor.c+7 -20 replies
4/7qapi: add String visitor coverage to serialization unit teststest-visitor-serialization.c+40 -00 replies
5/7qapi: String visitor, use %f represenation for floatsqapi/string-output-visitor.c test-string-output-visitor.c+2 -20 replies
6/7qdev: use int32_t container for devfn propertyhw/pci.c hw/pci.h hw/qdev-properties.c +1 more+7 -100 replies
7/7qdev: switch property accessors to fixed-width visitor interfaceshw/qdev-addr.c hw/qdev-properties.c+87 -570 replies

Reviews trailers per patch

No Reviewed-by, Acked-by or Tested-by trailers for v4 yet.

Read the v4 thread

Cover letter [Qemu-devel] [PATCH v4 0/7] add fixed-width visitors and serialization tests

These patches apply on top of qemu.git master, and can also be obtained from:
git://github.com/mdroth/qemu.git visitor-fixed-width-v4

CHANGES SINCE V3:
- Rebased on master and re-tested

CHANGES SINCE V2:
- Fix qemu-test errors due to now-strict bounds-checking we doing assignment between signed/unsigned types.
- uint* property getters/setters no longer use int* getters/setters.
- valid devfn range is now explicitly enforced.

CHANGES SINCE V1:
- unit tests: covert QmpOutputVisitor qobject to json before passing it to QmpInputVisitor*. I.e., actually do the serialization :)
- QmpInputVisitor, add handling for when a serialized QFloat gets read back as a QInt
- unit tests: add coverage for String visitor
- StringOutputVisitor: use %f for float representation

These patches add fixed-width visitor interfaces and switches all qdev users over to using them.

We also add a test suite which covers these interfaces, and also does some sanity checking on Visitors (Qmp/String currently, with a pluggable interface for future implementations) to ensure Visitor input/output handling remain self-consistent, which is not covered by the current visitor tests which mostly test input/output seperately. Maintaining this invariant is necessary to ensure that visitors can be used for serialization/deserialization in the future.

 hw/mc146818rtc.c             |    7 -
 hw/pci.c                     |    2 +-
 hw/pci.h                     |    2 +-
 hw/qdev-addr.c               |    4 +-
 hw/qdev-properties.c         |  151 +++++----
 hw/qdev.h                    |    2 +-
 qapi/qapi-visit-core.c       |  139 ++++++++
 qapi/qapi-visit-core.h       |   16 +
 qapi/qmp-input-visitor.c     |    9 +-
 qapi/string-output-visitor.c |    2 +-
 test-string-output-visitor.c |    2 +-
 test-visitor-serialization.c |  784 ++++++++++++++++++++++++++++++++++++++++++
 tests/Makefile               |    6 +-
 13 files changed, 1047 insertions(+), 79 deletions(-)