qemu-commits
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Qemu-commits] [qemu/qemu] ca28f5: cutils: Add qemu_strtod() and qemu_st


From: GitHub
Subject: [Qemu-commits] [qemu/qemu] ca28f5: cutils: Add qemu_strtod() and qemu_strtod_finite()
Date: Sat, 15 Dec 2018 14:26:25 -0800

  Branch: refs/heads/master
  Home:   https://github.com/qemu/qemu
  Commit: ca28f5481607e5c59481e70e429f5dd23662cb69
      
https://github.com/qemu/qemu/commit/ca28f5481607e5c59481e70e429f5dd23662cb69
  Author: David Hildenbrand <address@hidden>
  Date:   2018-12-13 (Thu, 13 Dec 2018)

  Changed paths:
    M include/qemu/cutils.h
    M util/cutils.c

  Log Message:
  -----------
  cutils: Add qemu_strtod() and qemu_strtod_finite()

Let's provide a wrapper for strtod().

Reviewed-by: Markus Armbruster <address@hidden>
Signed-off-by: David Hildenbrand <address@hidden>
Message-Id: <address@hidden>
Signed-off-by: Markus Armbruster <address@hidden>


  Commit: af02f4c5179675ad4e26b17ba26694a8fcde17fa
      
https://github.com/qemu/qemu/commit/af02f4c5179675ad4e26b17ba26694a8fcde17fa
  Author: David Hildenbrand <address@hidden>
  Date:   2018-12-13 (Thu, 13 Dec 2018)

  Changed paths:
    M include/qemu/cutils.h
    M monitor.c
    M tests/test-cutils.c
    M util/cutils.c

  Log Message:
  -----------
  cutils: Fix qemu_strtosz() & friends to reject non-finite sizes

qemu_strtosz() & friends reject NaNs, but happily accept infinities.
They shouldn't. Fix that.

The fix makes use of qemu_strtod_finite(). To avoid ugly casts,
change the @end parameter of qemu_strtosz() & friends from char **
to const char **.

Also, add two test cases, testing that "inf" and "NaN" are properly
rejected. While at it, also fixup the function documentation.

Reviewed-by: Eric Blake <address@hidden>
Reviewed-by: Markus Armbruster <address@hidden>
Signed-off-by: David Hildenbrand <address@hidden>
Message-Id: <address@hidden>
Signed-off-by: Markus Armbruster <address@hidden>


  Commit: 4b69d4c3d7c133ebc9393ef3f86ce38831921cb6
      
https://github.com/qemu/qemu/commit/4b69d4c3d7c133ebc9393ef3f86ce38831921cb6
  Author: David Hildenbrand <address@hidden>
  Date:   2018-12-13 (Thu, 13 Dec 2018)

  Changed paths:
    M qapi/string-input-visitor.c
    M tests/test-string-input-visitor.c

  Log Message:
  -----------
  qapi: Fix string-input-visitor to reject NaN and infinities

The string-input-visitor happily accepts NaN and infinities when parsing
numbers (doubles). They shouldn't. Fix that.

Also, add two test cases, testing if "NaN" and "inf" is properly
rejected.

Reviewed-by: Eric Blake <address@hidden>
Reviewed-by: Markus Armbruster <address@hidden>
Signed-off-by: David Hildenbrand <address@hidden>
Message-Id: <address@hidden>
Signed-off-by: Markus Armbruster <address@hidden>


  Commit: e08a5241d303d668b9f653344537eccb8b620663
      
https://github.com/qemu/qemu/commit/e08a5241d303d668b9f653344537eccb8b620663
  Author: David Hildenbrand <address@hidden>
  Date:   2018-12-13 (Thu, 13 Dec 2018)

  Changed paths:
    M qapi/qobject-input-visitor.c

  Log Message:
  -----------
  qapi: Use qemu_strtod_finite() in qobject-input-visitor

Let's use the new function. Just as current behavior, we have to
consume the whole string (now it's just way clearer what's going on).

Reviewed-by: Eric Blake <address@hidden>
Reviewed-by: Markus Armbruster <address@hidden>
Signed-off-by: David Hildenbrand <address@hidden>
Message-Id: <address@hidden>
Signed-off-by: Markus Armbruster <address@hidden>


  Commit: eac475410e9513b43a3ee0af9dfa22ab49230a71
      
https://github.com/qemu/qemu/commit/eac475410e9513b43a3ee0af9dfa22ab49230a71
  Author: David Hildenbrand <address@hidden>
  Date:   2018-12-13 (Thu, 13 Dec 2018)

  Changed paths:
    M tests/test-string-input-visitor.c

  Log Message:
  -----------
  test-string-input-visitor: Add more tests

Test that very big/small values are not accepted and that ranges with
only one element work. Also test that ranges are ascending and cannot
have more than 65536 elements.

Rename expect4 to expect5, as we will be moving that to a separate ulist
test after the rework.

Reviewed-by: Eric Blake <address@hidden>
Reviewed-by: Markus Armbruster <address@hidden>
Signed-off-by: David Hildenbrand <address@hidden>
Message-Id: <address@hidden>
Signed-off-by: Markus Armbruster <address@hidden>


  Commit: c9fba9de89db51a07689e2cba4865a1e564b8f0f
      
https://github.com/qemu/qemu/commit/c9fba9de89db51a07689e2cba4865a1e564b8f0f
  Author: David Hildenbrand <address@hidden>
  Date:   2018-12-13 (Thu, 13 Dec 2018)

  Changed paths:
    M include/qapi/string-input-visitor.h
    M qapi/string-input-visitor.c
    M tests/test-string-input-visitor.c

  Log Message:
  -----------
  qapi: Rewrite string-input-visitor's integer and list parsing

The input visitor has some problems right now, especially
- unsigned type "Range" is used to process signed ranges, resulting in
  inconsistent behavior and ugly/magical code
- uint64_t are parsed like int64_t, so big uint64_t values are not
  supported and error messages are misleading
- lists/ranges of int64_t are accepted although no list is parsed and
  we should rather report an error
- lists/ranges are preparsed using int64_t, making it hard to
  implement uint64_t values or uint64_t lists
- types that don't support lists don't bail out
- visiting beyond the end of a list is not handled properly
- we don't actually parse lists, we parse *sets*: members are sorted,
  and duplicates eliminated

So let's rewrite it by getting rid of usage of the type "Range" and
properly supporting lists of int64_t and uint64_t (including ranges of
both types), fixing the above mentioned issues.

Lists of other types are not supported and will properly report an
error. Virtual walks are now supported.

Tests have to be fixed up:
- Two BUGs were hardcoded that are fixed now
- The string-input-visitor now actually returns a parsed list and not
  an ordered set.

Please note that no users/callers have to be fixed up. Candidates using
visit_type_uint16List() and friends are:
- backends/hostmem.c:host_memory_backend_set_host_nodes()
-- Code can deal with duplicates/unsorted lists
- numa.c::query_memdev()
-- via object_property_get_uint16List(), the list will still be sorted
   and without duplicates (via host_memory_backend_get_host_nodes())
- qapi-visit.c::visit_type_Memdev_members()
- qapi-visit.c::visit_type_NumaNodeOptions_members()
- qapi-visit.c::visit_type_RockerOfDpaGroup_members
- qapi-visit.c::visit_type_RxFilterInfo_members()
-- Not used with string-input-visitor.

Reviewed-by: Eric Blake <address@hidden>
Reviewed-by: Markus Armbruster <address@hidden>
Signed-off-by: David Hildenbrand <address@hidden>
Message-Id: <address@hidden>
Signed-off-by: Markus Armbruster <address@hidden>


  Commit: 130885938584bb2a4b1a28a44b03752304bba8a2
      
https://github.com/qemu/qemu/commit/130885938584bb2a4b1a28a44b03752304bba8a2
  Author: David Hildenbrand <address@hidden>
  Date:   2018-12-13 (Thu, 13 Dec 2018)

  Changed paths:
    M tests/test-string-input-visitor.c

  Log Message:
  -----------
  test-string-input-visitor: Use virtual walk

We now support virtual walks, so use that instead.

Reviewed-by: Markus Armbruster <address@hidden>
Reviewed-by: Eric Blake <address@hidden>
Signed-off-by: David Hildenbrand <address@hidden>
Message-Id: <address@hidden>
Signed-off-by: Markus Armbruster <address@hidden>


  Commit: cc871b1cdfc0f9d0520020e38f1bababdcce4141
      
https://github.com/qemu/qemu/commit/cc871b1cdfc0f9d0520020e38f1bababdcce4141
  Author: David Hildenbrand <address@hidden>
  Date:   2018-12-13 (Thu, 13 Dec 2018)

  Changed paths:
    M tests/test-string-input-visitor.c

  Log Message:
  -----------
  test-string-input-visitor: Split off uint64 list tests

Basically copy all int64 list tests but adapt them to work on uint64
instead. The values for very big/very small values have to be adapted.

Reviewed-by: Markus Armbruster <address@hidden>
Signed-off-by: David Hildenbrand <address@hidden>
Message-Id: <address@hidden>
Signed-off-by: Markus Armbruster <address@hidden>


  Commit: 345e4010c566d64bfba1592aef03d438f8bbf605
      
https://github.com/qemu/qemu/commit/345e4010c566d64bfba1592aef03d438f8bbf605
  Author: David Hildenbrand <address@hidden>
  Date:   2018-12-13 (Thu, 13 Dec 2018)

  Changed paths:
    M tests/test-string-input-visitor.c

  Log Message:
  -----------
  test-string-input-visitor: Add range overflow tests

Let's make sure that the range handling code can properly deal with
ranges that end at the biggest possible number.

Reviewed-by: Markus Armbruster <address@hidden>
Signed-off-by: David Hildenbrand <address@hidden>
Message-Id: <address@hidden>
Signed-off-by: Markus Armbruster <address@hidden>


  Commit: aee03bf3674d80c8f08e83d8100648332e29f7cb
      
https://github.com/qemu/qemu/commit/aee03bf3674d80c8f08e83d8100648332e29f7cb
  Author: Eric Blake <address@hidden>
  Date:   2018-12-13 (Thu, 13 Dec 2018)

  Changed paths:
    M docs/devel/qapi-code-gen.txt
    M docs/interop/qmp-spec.txt

  Log Message:
  -----------
  docs: Update references to JSON RFC

RFC8259 obsoletes RFC7159. Fix a couple of URLs to point to the
newer version.

Signed-off-by: Eric Blake <address@hidden>
Message-Id: <address@hidden>
Reviewed-by: Markus Armbruster <address@hidden>
Signed-off-by: Markus Armbruster <address@hidden>


  Commit: 00382fa85126edc63720480fd22458e1af4e58c7
      
https://github.com/qemu/qemu/commit/00382fa85126edc63720480fd22458e1af4e58c7
  Author: Markus Armbruster <address@hidden>
  Date:   2018-12-13 (Thu, 13 Dec 2018)

  Changed paths:
    M qobject/json-parser.c
    M tests/qemu-iotests/229

  Log Message:
  -----------
  json: Fix to reject duplicate object member names

The JSON parser happily accepts duplicate object member names.  The
last value wins.  Reproducer #1:

    $ qemu-system-x86_64 -qmp stdio
    {"QMP": {"version": {"qemu": {"micro": 93, "minor": 0, "major": 3},
    "package": "v3.1.0-rc3-7-g87a45d86ed"}, "capabilities": []}}
    {'execute':'qmp_capabilities'}
    {"return": {}}
    {'execute':'blockdev-add','arguments':{'driver':'null-co',
     'node-name':'foo','node-name':'bar'}}
    {"return": {}}
    {'execute':'query-named-block-nodes'}
    {"return": [{ [...] "node-name": "bar" [...] }]}

Reproducer #2 is iotest 229.

Fix the parser to reject duplicates, and fix iotest 229 not to use
them.

Reported-by: Max Reitz <address@hidden>
Signed-off-by: Markus Armbruster <address@hidden>
Message-Id: <address@hidden>
Reviewed-by: Daniel P. Berrangé <address@hidden>
Reviewed-by: Philippe Mathieu-Daudé <address@hidden>
[Trailing whitespace tidied up]
Signed-off-by: Markus Armbruster <address@hidden>


  Commit: f8c4fdd6ae9a8036333ea9a3773fb8d119cc50af
      
https://github.com/qemu/qemu/commit/f8c4fdd6ae9a8036333ea9a3773fb8d119cc50af
  Author: Marc-André Lureau <address@hidden>
  Date:   2018-12-13 (Thu, 13 Dec 2018)

  Changed paths:
    M tests/qapi-schema/qapi-schema-test.json
    M tests/qapi-schema/qapi-schema-test.out

  Log Message:
  -----------
  tests/qapi: Cover commands with 'if' and union / alternate 'data'

Forgotten in commit 967c885108f.

Signed-off-by: Marc-André Lureau <address@hidden>
Message-Id: <address@hidden>
Message-Id: <address@hidden>
Reviewed-by: Markus Armbruster <address@hidden>
[Squashed, commit message adjusted]
Signed-off-by: Markus Armbruster <address@hidden>


  Commit: 57516863644817ca59fab023e0c68d139929f3e0
      
https://github.com/qemu/qemu/commit/57516863644817ca59fab023e0c68d139929f3e0
  Author: Marc-André Lureau <address@hidden>
  Date:   2018-12-13 (Thu, 13 Dec 2018)

  Changed paths:
    M scripts/qapi/common.py

  Log Message:
  -----------
  qapi: rename QAPISchemaEnumType.values to .members

Rename QAPISchemaEnumType.values and related variables to members.
Makes sense ever since commit 93bda4dd4 changed .values from list of
string to list of QAPISchemaMember. Obvious no-op.

Signed-off-by: Marc-André Lureau <address@hidden>
Reviewed-by: Markus Armbruster <address@hidden>
Message-Id: <address@hidden>
Signed-off-by: Markus Armbruster <address@hidden>


  Commit: b0ddeba22a33c667e86e149232c6296bf95b07e7
      
https://github.com/qemu/qemu/commit/b0ddeba22a33c667e86e149232c6296bf95b07e7
  Author: Marc-André Lureau <address@hidden>
  Date:   2018-12-13 (Thu, 13 Dec 2018)

  Changed paths:
    M qapi/block-core.json
    M qapi/char.json
    M qapi/migration.json
    M qapi/misc.json
    M qapi/net.json
    M qapi/tpm.json
    M qapi/ui.json

  Log Message:
  -----------
  qapi: break long lines at 'data' member

Let's break the line before 'data'. While at it, improve a bit
indentation/spacing. (I removed some alignment which are not helping
much readability and become quickly inconsistent)

Suggested-by: Markus Armbruster <address@hidden>
Signed-off-by: Marc-André Lureau <address@hidden>
Message-Id: <address@hidden>
Reviewed-by: Markus Armbruster <address@hidden>
Signed-off-by: Markus Armbruster <address@hidden>


  Commit: 9c2f56e9f9d5a1f9ddac77dda35f997738e85d11
      
https://github.com/qemu/qemu/commit/9c2f56e9f9d5a1f9ddac77dda35f997738e85d11
  Author: Marc-André Lureau <address@hidden>
  Date:   2018-12-13 (Thu, 13 Dec 2018)

  Changed paths:
    M scripts/qapi/common.py

  Log Message:
  -----------
  qapi: Do not define enumeration value explicitly

The generated C enumeration types explicitly set the enumeration
constants to 0, 1, 2, ...  That's exactly what you get when you don't
supply values.

Drop the explicit values.  No change now, but it will avoid gaps in
the values when we later add support for 'if' conditions.  Avoiding
such gaps will save us the trouble of changing the ENUM_lookup[]
tables to work without a sentinel.

We'll have to take care to ensure the headers required by the 'if'
conditions get always included before the generated QAPI code.
Fortunately, our convention to include "qemu/osdep.h" first in any .c
ensures that's the case for our CONFIG_FOO macros.

Signed-off-by: Marc-André Lureau <address@hidden>
Reviewed-by: Markus Armbruster <address@hidden>
Message-Id: <address@hidden>
Signed-off-by: Markus Armbruster <address@hidden>


  Commit: 1962bd39d567e8b44646e558b07b2742a5a61339
      
https://github.com/qemu/qemu/commit/1962bd39d567e8b44646e558b07b2742a5a61339
  Author: Marc-André Lureau <address@hidden>
  Date:   2018-12-13 (Thu, 13 Dec 2018)

  Changed paths:
    M scripts/qapi/common.py
    M scripts/qapi/doc.py
    M scripts/qapi/events.py
    M scripts/qapi/introspect.py
    M scripts/qapi/types.py
    M scripts/qapi/visit.py
    M tests/qapi-schema/test-qapi.py

  Log Message:
  -----------
  qapi: change enum visitor and gen_enum* to take QAPISchemaMember

This will allow to add and access more properties associated with enum
values/members, like the associated 'if' condition. We may want to
have a specialized type QAPISchemaEnumMember, for now this will do.

Modify gen_enum() and gen_enum_lookup() for the same reason.

Suggested-by: Markus Armbruster <address@hidden>
Signed-off-by: Marc-André Lureau <address@hidden>
Reviewed-by: Markus Armbruster <address@hidden>
Message-Id: <address@hidden>
Signed-off-by: Markus Armbruster <address@hidden>


  Commit: 1e381b655910b515d7c52fc60b67b4167dd9c4c6
      
https://github.com/qemu/qemu/commit/1e381b655910b515d7c52fc60b67b4167dd9c4c6
  Author: Marc-André Lureau <address@hidden>
  Date:   2018-12-13 (Thu, 13 Dec 2018)

  Changed paths:
    M tests/qapi-schema/comments.out
    M tests/qapi-schema/doc-bad-section.out
    M tests/qapi-schema/doc-good.out
    M tests/qapi-schema/empty.out
    M tests/qapi-schema/event-case.out
    M tests/qapi-schema/ident-with-escape.out
    M tests/qapi-schema/include-relpath.out
    M tests/qapi-schema/include-repetition.out
    M tests/qapi-schema/include-simple.out
    M tests/qapi-schema/indented-expr.out
    M tests/qapi-schema/qapi-schema-test.out
    M tests/qapi-schema/test-qapi.py

  Log Message:
  -----------
  tests: print enum type members more like object type members

Commit 93bda4dd461 changed the internal representation of enum type
members from str to QAPISchemaMember, but we still print only a
string.  Has been good enough, as the name is the member's only
attribute of interest, but that's about to change.  To prepare, print
them more like object type members.

Signed-off-by: Marc-André Lureau <address@hidden>
Reviewed-by: Markus Armbruster <address@hidden>
Message-Id: <address@hidden>
Signed-off-by: Markus Armbruster <address@hidden>


  Commit: 563bd35d87f7bcab644381319d6247e8aee8a4f4
      
https://github.com/qemu/qemu/commit/563bd35d87f7bcab644381319d6247e8aee8a4f4
  Author: Marc-André Lureau <address@hidden>
  Date:   2018-12-13 (Thu, 13 Dec 2018)

  Changed paths:
    M scripts/qapi/common.py

  Log Message:
  -----------
  qapi: factor out checking for keys

Introduce a new helper function to check if the given keys are known,
and if mandatory keys are present. The function will be reused in
other places in the following code changes.

Signed-off-by: Marc-André Lureau <address@hidden>
Reviewed-by: Markus Armbruster <address@hidden>
Message-Id: <address@hidden>
Signed-off-by: Markus Armbruster <address@hidden>


  Commit: 7e80d48001c8ebc11358596f10ba48daddee05f5
      
https://github.com/qemu/qemu/commit/7e80d48001c8ebc11358596f10ba48daddee05f5
  Author: Marc-André Lureau <address@hidden>
  Date:   2018-12-13 (Thu, 13 Dec 2018)

  Changed paths:
    M scripts/qapi/common.py
    M tests/qapi-schema/alternate-base.err
    M tests/qapi-schema/double-type.err
    M tests/qapi-schema/unknown-expr-key.err
    M tests/qapi-schema/unknown-expr-key.json

  Log Message:
  -----------
  qapi: improve reporting of unknown or missing keys

Report the set of missing or unknown keys. And give a hint about the
accepted keys.

The error message for multiple meta type members (visible in
tests/qapi-schema/double-type.err) is not improved.

Signed-off-by: Marc-André Lureau <address@hidden>
Reviewed-by: Markus Armbruster <address@hidden>
Message-Id: <address@hidden>
Signed-off-by: Markus Armbruster <address@hidden>


  Commit: ea738b21685814dc54352858afabc2ff33ade53e
      
https://github.com/qemu/qemu/commit/ea738b21685814dc54352858afabc2ff33ade53e
  Author: Marc-André Lureau <address@hidden>
  Date:   2018-12-13 (Thu, 13 Dec 2018)

  Changed paths:
    M scripts/qapi/common.py
    M tests/Makefile.include
    A tests/qapi-schema/enum-bad-member.err
    A tests/qapi-schema/enum-bad-member.exit
    A tests/qapi-schema/enum-bad-member.json
    A tests/qapi-schema/enum-bad-member.out
    A tests/qapi-schema/enum-dict-member-unknown.err
    A tests/qapi-schema/enum-dict-member-unknown.exit
    A tests/qapi-schema/enum-dict-member-unknown.json
    A tests/qapi-schema/enum-dict-member-unknown.out
    R tests/qapi-schema/enum-dict-member.err
    R tests/qapi-schema/enum-dict-member.exit
    R tests/qapi-schema/enum-dict-member.json
    R tests/qapi-schema/enum-dict-member.out

  Log Message:
  -----------
  qapi: add a dictionary form with 'name' key for enum members

Desugar the enum NAME form to { 'name': NAME }. This will allow to add
new enum members, such as 'if' in the following patch.

Signed-off-by: Marc-André Lureau <address@hidden>
Message-Id: <address@hidden>
Message-Id: <address@hidden>
Message-Id: <address@hidden>
Reviewed-by: Markus Armbruster <address@hidden>
[Harmless accidental move backed out, long line wrapped, patches
squashed]
Signed-off-by: Markus Armbruster <address@hidden>


  Commit: 6cc32b0e14b3f91e15a9511d90b222abc1df391d
      
https://github.com/qemu/qemu/commit/6cc32b0e14b3f91e15a9511d90b222abc1df391d
  Author: Marc-André Lureau <address@hidden>
  Date:   2018-12-13 (Thu, 13 Dec 2018)

  Changed paths:
    M docs/devel/qapi-code-gen.txt
    M scripts/qapi/common.py
    M tests/Makefile.include
    M tests/qapi-schema/enum-dict-member-unknown.err
    A tests/qapi-schema/enum-if-invalid.err
    A tests/qapi-schema/enum-if-invalid.exit
    A tests/qapi-schema/enum-if-invalid.json
    A tests/qapi-schema/enum-if-invalid.out
    M tests/qapi-schema/qapi-schema-test.json
    M tests/qapi-schema/qapi-schema-test.out
    M tests/qapi-schema/test-qapi.py

  Log Message:
  -----------
  qapi: add 'if' to enum members

QAPISchemaMember gains .ifcond for enum members: inherited classes,
such as QAPISchemaObjectTypeMember, will thus have an ifcond member
after this (those different types will also use the .ifcond to store
the condition and generate conditional code in the following patches).

The generated code remains unconditional for now. Later patches
generate the conditionals.

Signed-off-by: Marc-André Lureau <address@hidden>
Reviewed-by: Markus Armbruster <address@hidden>
Message-Id: <address@hidden>
Signed-off-by: Markus Armbruster <address@hidden>


  Commit: 7bd263490590ee6fcf34ecb6203437e22f6e5a9c
      
https://github.com/qemu/qemu/commit/7bd263490590ee6fcf34ecb6203437e22f6e5a9c
  Author: Marc-André Lureau <address@hidden>
  Date:   2018-12-13 (Thu, 13 Dec 2018)

  Changed paths:
    M scripts/qapi/events.py

  Log Message:
  -----------
  qapi-events: add 'if' condition to implicit event enum

Add condition to QAPIEvent enum members based on the event 'if'.

The generated code remains unconditional for now. Later patches
generate the conditionals (also there is no additional coverage of
this change in qapi-schema-test.out since the event_names enum is an
implicit type created by qapi/events.py).

Signed-off-by: Marc-André Lureau <address@hidden>
Reviewed-by: Markus Armbruster <address@hidden>
Message-Id: <address@hidden>
Signed-off-by: Markus Armbruster <address@hidden>


  Commit: 87adbbffd4b03c68d039ce0be5dcfde38a6a7b1b
      
https://github.com/qemu/qemu/commit/87adbbffd4b03c68d039ce0be5dcfde38a6a7b1b
  Author: Marc-André Lureau <address@hidden>
  Date:   2018-12-13 (Thu, 13 Dec 2018)

  Changed paths:
    M scripts/qapi/common.py
    M tests/Makefile.include
    A tests/qapi-schema/alternate-invalid-dict.err
    A tests/qapi-schema/alternate-invalid-dict.exit
    A tests/qapi-schema/alternate-invalid-dict.json
    A tests/qapi-schema/alternate-invalid-dict.out
    A tests/qapi-schema/event-member-invalid-dict.err
    A tests/qapi-schema/event-member-invalid-dict.exit
    A tests/qapi-schema/event-member-invalid-dict.json
    A tests/qapi-schema/event-member-invalid-dict.out
    M tests/qapi-schema/event-nest-struct.json
    A tests/qapi-schema/flat-union-inline-invalid-dict.err
    A tests/qapi-schema/flat-union-inline-invalid-dict.exit
    A tests/qapi-schema/flat-union-inline-invalid-dict.json
    A tests/qapi-schema/flat-union-inline-invalid-dict.out
    M tests/qapi-schema/flat-union-inline.json
    A tests/qapi-schema/nested-struct-data-invalid-dict.err
    A tests/qapi-schema/nested-struct-data-invalid-dict.exit
    A tests/qapi-schema/nested-struct-data-invalid-dict.json
    A tests/qapi-schema/nested-struct-data-invalid-dict.out
    M tests/qapi-schema/nested-struct-data.json
    M tests/qapi-schema/qapi-schema-test.json
    A tests/qapi-schema/struct-member-invalid-dict.err
    A tests/qapi-schema/struct-member-invalid-dict.exit
    A tests/qapi-schema/struct-member-invalid-dict.json
    A tests/qapi-schema/struct-member-invalid-dict.out
    A tests/qapi-schema/union-branch-invalid-dict.err
    A tests/qapi-schema/union-branch-invalid-dict.exit
    A tests/qapi-schema/union-branch-invalid-dict.json
    A tests/qapi-schema/union-branch-invalid-dict.out

  Log Message:
  -----------
  qapi: add a dictionary form for TYPE

Wherever a struct/union/alternate/command/event member with NAME: TYPE
form is accepted, desugar it to a NAME: { 'type': TYPE } form.

This will allow to add new member details, such as 'if' in the
following patch to introduce conditionals, or 'default' for default
values etc.

Signed-off-by: Marc-André Lureau <address@hidden>
Message-Id: <address@hidden>
Reviewed-by: Markus Armbruster <address@hidden>
Signed-off-by: Markus Armbruster <address@hidden>


  Commit: ccadd6bcba3bef6c1954f533b10224fb3db7148e
      
https://github.com/qemu/qemu/commit/ccadd6bcba3bef6c1954f533b10224fb3db7148e
  Author: Marc-André Lureau <address@hidden>
  Date:   2018-12-13 (Thu, 13 Dec 2018)

  Changed paths:
    M docs/devel/qapi-code-gen.txt
    M scripts/qapi/common.py
    M tests/Makefile.include
    A tests/qapi-schema/flat-union-invalid-if-discriminator.err
    A tests/qapi-schema/flat-union-invalid-if-discriminator.exit
    A tests/qapi-schema/flat-union-invalid-if-discriminator.json
    A tests/qapi-schema/flat-union-invalid-if-discriminator.out
    M tests/qapi-schema/qapi-schema-test.json
    M tests/qapi-schema/qapi-schema-test.out
    M tests/qapi-schema/test-qapi.py

  Log Message:
  -----------
  qapi: Add 'if' to implicit struct members

The generated code is for now *unconditional*.  Later patches generate
the conditionals.

Note that union discriminators may not have 'if' conditionals.

Signed-off-by: Marc-André Lureau <address@hidden>
Reviewed-by: Markus Armbruster <address@hidden>
Message-Id: <address@hidden>
Message-Id: <address@hidden>
[Patches squashed, commit message tweaked]
Signed-off-by: Markus Armbruster <address@hidden>


  Commit: a2724280fbed914e517403890b4b1568261f0cf9
      
https://github.com/qemu/qemu/commit/a2724280fbed914e517403890b4b1568261f0cf9
  Author: Marc-André Lureau <address@hidden>
  Date:   2018-12-13 (Thu, 13 Dec 2018)

  Changed paths:
    M docs/devel/qapi-code-gen.txt
    M scripts/qapi/common.py
    M tests/qapi-schema/qapi-schema-test.json
    M tests/qapi-schema/qapi-schema-test.out
    M tests/qapi-schema/test-qapi.py

  Log Message:
  -----------
  qapi: add 'if' to union members

Add 'if' key to union members:

{ 'union': 'TestIfUnion', 'data':
    'mem': { 'type': 'str', 'if': 'COND'} }

The generated code remains unconditional for now. Later patches
generate the conditionals.

Signed-off-by: Marc-André Lureau <address@hidden>
Reviewed-by: Markus Armbruster <address@hidden>
Message-Id: <address@hidden>
Signed-off-by: Markus Armbruster <address@hidden>


  Commit: 3e270dcacc08cca45e694ca48159915f81303cfa
      
https://github.com/qemu/qemu/commit/3e270dcacc08cca45e694ca48159915f81303cfa
  Author: Marc-André Lureau <address@hidden>
  Date:   2018-12-13 (Thu, 13 Dec 2018)

  Changed paths:
    M docs/devel/qapi-code-gen.txt
    M scripts/qapi/common.py
    M tests/qapi-schema/qapi-schema-test.json
    M tests/qapi-schema/qapi-schema-test.out

  Log Message:
  -----------
  qapi: add 'if' to alternate members

Add 'if' key to alternate members:

{ 'alternate': 'TestIfAlternate', 'data':
  { 'alt': { 'type': 'TestStruct', 'if': 'COND' } } }

Generated code is not changed by this patch but with "qapi: add #if
conditions to generated code".

Signed-off-by: Marc-André Lureau <address@hidden>
Reviewed-by: Markus Armbruster <address@hidden>
Message-Id: <address@hidden>
Signed-off-by: Markus Armbruster <address@hidden>


  Commit: 8ee06f61e13701a54a9f76ceadafc856d279cdb6
      
https://github.com/qemu/qemu/commit/8ee06f61e13701a54a9f76ceadafc856d279cdb6
  Author: Marc-André Lureau <address@hidden>
  Date:   2018-12-14 (Fri, 14 Dec 2018)

  Changed paths:
    M scripts/qapi/common.py
    M scripts/qapi/introspect.py
    M scripts/qapi/types.py
    M scripts/qapi/visit.py

  Log Message:
  -----------
  qapi: Add #if conditions to generated code members

Wrap generated enum and struct members and their supporting code with
#if/#endif, using the .ifcond members added in the previous patches.

We do enum and struct in a single patch because union tag enum and the
associated variants tie them together, and dealing with that to split
the patch doesn't seem worthwhile.

Signed-off-by: Marc-André Lureau <address@hidden>
Reviewed-by: Markus Armbruster <address@hidden>
Message-Id: <address@hidden>
Signed-off-by: Markus Armbruster <address@hidden>


  Commit: a35c9bf82aff4e80a90f0adfc7383d03749db0b6
      
https://github.com/qemu/qemu/commit/a35c9bf82aff4e80a90f0adfc7383d03749db0b6
  Author: Marc-André Lureau <address@hidden>
  Date:   2018-12-14 (Fri, 14 Dec 2018)

  Changed paths:
    M scripts/qapi/doc.py
    M tests/qapi-schema/doc-good.json
    M tests/qapi-schema/doc-good.out
    M tests/qapi-schema/doc-good.texi

  Log Message:
  -----------
  qapi: add 'If:' condition to enum values documentation

Use a common function to generate the "If:..." line.

While at it, get rid of the existing \n\n (no idea why it was
there). Use a line-break in member description, this seems to look
slightly better in the plaintext version.

Signed-off-by: Marc-André Lureau <address@hidden>
Message-Id: <address@hidden>
Reviewed-by: Markus Armbruster <address@hidden>
Signed-off-by: Markus Armbruster <address@hidden>


  Commit: 8867bf08087a3d508a0ecce661f7e430c1747022
      
https://github.com/qemu/qemu/commit/8867bf08087a3d508a0ecce661f7e430c1747022
  Author: Marc-André Lureau <address@hidden>
  Date:   2018-12-14 (Fri, 14 Dec 2018)

  Changed paths:
    M scripts/qapi/doc.py
    M tests/qapi-schema/doc-good.json
    M tests/qapi-schema/doc-good.out
    M tests/qapi-schema/doc-good.texi

  Log Message:
  -----------
  qapi: add 'If:' condition to struct members documentation

Signed-off-by: Marc-André Lureau <address@hidden>
Message-Id: <address@hidden>
Reviewed-by: Markus Armbruster <address@hidden>
Signed-off-by: Markus Armbruster <address@hidden>


  Commit: 01ae9cc2544f03299bb8b9923dec5da3d94f7c57
      
https://github.com/qemu/qemu/commit/01ae9cc2544f03299bb8b9923dec5da3d94f7c57
  Author: Marc-André Lureau <address@hidden>
  Date:   2018-12-14 (Fri, 14 Dec 2018)

  Changed paths:
    M scripts/qapi/doc.py
    M tests/qapi-schema/doc-good.json
    M tests/qapi-schema/doc-good.out
    M tests/qapi-schema/doc-good.texi

  Log Message:
  -----------
  qapi: add condition to variants documentation

Signed-off-by: Marc-André Lureau <address@hidden>
Message-Id: <address@hidden>
Reviewed-by: Markus Armbruster <address@hidden>
Signed-off-by: Markus Armbruster <address@hidden>


  Commit: fd9dda3b7091ec1dcd461f2ad054ab96768324f3
      
https://github.com/qemu/qemu/commit/fd9dda3b7091ec1dcd461f2ad054ab96768324f3
  Author: Marc-André Lureau <address@hidden>
  Date:   2018-12-14 (Fri, 14 Dec 2018)

  Changed paths:
    M qapi/char.json

  Log Message:
  -----------
  qapi: add more conditions to SPICE

Now that member can be made conditional, let's make SPICE chardev
conditional:

* spiceport, spicevmc

  Before and after the patch for !CONFIG_SPICE, the error is the
  same ('spiceport' is not a valid char driver name).

Signed-off-by: Marc-André Lureau <address@hidden>
Reviewed-by: Markus Armbruster <address@hidden>
Message-Id: <address@hidden>
Signed-off-by: Markus Armbruster <address@hidden>


  Commit: 335d10cd8e2c3bb6067804b095aaf6371fc1983e
      
https://github.com/qemu/qemu/commit/335d10cd8e2c3bb6067804b095aaf6371fc1983e
  Author: Marc-André Lureau <address@hidden>
  Date:   2018-12-14 (Fri, 14 Dec 2018)

  Changed paths:
    M migration/colo.c
    M monitor.c
    M qapi/block-core.json
    M qapi/migration.json

  Log Message:
  -----------
  qapi: add conditions to REPLICATION type/commands on the schema

Add #if defined(CONFIG_REPLICATION) in generated code, and adjust the
code accordingly.

Made conditional:

* xen-set-replication, query-xen-replication-status,
  xen-colo-do-checkpoint

  Before the patch, we first register the commands unconditionally in
  generated code (requires a stub), then conditionally unregister in
  qmp_unregister_commands_hack().

  Afterwards, we register only when CONFIG_REPLICATION.  The command
  fails exactly the same, with CommandNotFound.

  Improvement, because now query-qmp-schema is accurate, and we're one
  step closer to killing qmp_unregister_commands_hack().

* enum BlockdevDriver value "replication" in command blockdev-add

* BlockdevOptions variant @replication

and related structures.

Signed-off-by: Marc-André Lureau <address@hidden>
Reviewed-by: Markus Armbruster <address@hidden>
Message-Id: <address@hidden>
Signed-off-by: Markus Armbruster <address@hidden>


  Commit: 81781be3c99235a59c8efee6aecb3d81b500e838
      
https://github.com/qemu/qemu/commit/81781be3c99235a59c8efee6aecb3d81b500e838
  Author: Peter Maydell <address@hidden>
  Date:   2018-12-15 (Sat, 15 Dec 2018)

  Changed paths:
    M docs/devel/qapi-code-gen.txt
    M docs/interop/qmp-spec.txt
    M include/qapi/string-input-visitor.h
    M include/qemu/cutils.h
    M migration/colo.c
    M monitor.c
    M qapi/block-core.json
    M qapi/char.json
    M qapi/migration.json
    M qapi/misc.json
    M qapi/net.json
    M qapi/qobject-input-visitor.c
    M qapi/string-input-visitor.c
    M qapi/tpm.json
    M qapi/ui.json
    M qobject/json-parser.c
    M scripts/qapi/common.py
    M scripts/qapi/doc.py
    M scripts/qapi/events.py
    M scripts/qapi/introspect.py
    M scripts/qapi/types.py
    M scripts/qapi/visit.py
    M tests/Makefile.include
    M tests/qapi-schema/alternate-base.err
    A tests/qapi-schema/alternate-invalid-dict.err
    A tests/qapi-schema/alternate-invalid-dict.exit
    A tests/qapi-schema/alternate-invalid-dict.json
    A tests/qapi-schema/alternate-invalid-dict.out
    M tests/qapi-schema/comments.out
    M tests/qapi-schema/doc-bad-section.out
    M tests/qapi-schema/doc-good.json
    M tests/qapi-schema/doc-good.out
    M tests/qapi-schema/doc-good.texi
    M tests/qapi-schema/double-type.err
    M tests/qapi-schema/empty.out
    A tests/qapi-schema/enum-bad-member.err
    A tests/qapi-schema/enum-bad-member.exit
    A tests/qapi-schema/enum-bad-member.json
    A tests/qapi-schema/enum-bad-member.out
    A tests/qapi-schema/enum-dict-member-unknown.err
    A tests/qapi-schema/enum-dict-member-unknown.exit
    A tests/qapi-schema/enum-dict-member-unknown.json
    A tests/qapi-schema/enum-dict-member-unknown.out
    R tests/qapi-schema/enum-dict-member.err
    R tests/qapi-schema/enum-dict-member.exit
    R tests/qapi-schema/enum-dict-member.json
    R tests/qapi-schema/enum-dict-member.out
    A tests/qapi-schema/enum-if-invalid.err
    A tests/qapi-schema/enum-if-invalid.exit
    A tests/qapi-schema/enum-if-invalid.json
    A tests/qapi-schema/enum-if-invalid.out
    M tests/qapi-schema/event-case.out
    A tests/qapi-schema/event-member-invalid-dict.err
    A tests/qapi-schema/event-member-invalid-dict.exit
    A tests/qapi-schema/event-member-invalid-dict.json
    A tests/qapi-schema/event-member-invalid-dict.out
    M tests/qapi-schema/event-nest-struct.json
    A tests/qapi-schema/flat-union-inline-invalid-dict.err
    A tests/qapi-schema/flat-union-inline-invalid-dict.exit
    A tests/qapi-schema/flat-union-inline-invalid-dict.json
    A tests/qapi-schema/flat-union-inline-invalid-dict.out
    M tests/qapi-schema/flat-union-inline.json
    A tests/qapi-schema/flat-union-invalid-if-discriminator.err
    A tests/qapi-schema/flat-union-invalid-if-discriminator.exit
    A tests/qapi-schema/flat-union-invalid-if-discriminator.json
    A tests/qapi-schema/flat-union-invalid-if-discriminator.out
    M tests/qapi-schema/ident-with-escape.out
    M tests/qapi-schema/include-relpath.out
    M tests/qapi-schema/include-repetition.out
    M tests/qapi-schema/include-simple.out
    M tests/qapi-schema/indented-expr.out
    A tests/qapi-schema/nested-struct-data-invalid-dict.err
    A tests/qapi-schema/nested-struct-data-invalid-dict.exit
    A tests/qapi-schema/nested-struct-data-invalid-dict.json
    A tests/qapi-schema/nested-struct-data-invalid-dict.out
    M tests/qapi-schema/nested-struct-data.json
    M tests/qapi-schema/qapi-schema-test.json
    M tests/qapi-schema/qapi-schema-test.out
    A tests/qapi-schema/struct-member-invalid-dict.err
    A tests/qapi-schema/struct-member-invalid-dict.exit
    A tests/qapi-schema/struct-member-invalid-dict.json
    A tests/qapi-schema/struct-member-invalid-dict.out
    M tests/qapi-schema/test-qapi.py
    A tests/qapi-schema/union-branch-invalid-dict.err
    A tests/qapi-schema/union-branch-invalid-dict.exit
    A tests/qapi-schema/union-branch-invalid-dict.json
    A tests/qapi-schema/union-branch-invalid-dict.out
    M tests/qapi-schema/unknown-expr-key.err
    M tests/qapi-schema/unknown-expr-key.json
    M tests/qemu-iotests/229
    M tests/test-cutils.c
    M tests/test-string-input-visitor.c
    M util/cutils.c

  Log Message:
  -----------
  Merge remote-tracking branch 'remotes/armbru/tags/pull-qapi-2018-12-13-v2' 
into staging

QAPI patches for 2018-12-13

# gpg: Signature made Fri 14 Dec 2018 05:53:51 GMT
# gpg:                using RSA key 3870B400EB918653
# gpg: Good signature from "Markus Armbruster <address@hidden>"
# gpg:                 aka "Markus Armbruster <address@hidden>"
# Primary key fingerprint: 354B C8B3 D7EB 2A6B 6867  4E5F 3870 B400 EB91 8653

* remotes/armbru/tags/pull-qapi-2018-12-13-v2: (32 commits)
  qapi: add conditions to REPLICATION type/commands on the schema
  qapi: add more conditions to SPICE
  qapi: add condition to variants documentation
  qapi: add 'If:' condition to struct members documentation
  qapi: add 'If:' condition to enum values documentation
  qapi: Add #if conditions to generated code members
  qapi: add 'if' to alternate members
  qapi: add 'if' to union members
  qapi: Add 'if' to implicit struct members
  qapi: add a dictionary form for TYPE
  qapi-events: add 'if' condition to implicit event enum
  qapi: add 'if' to enum members
  qapi: add a dictionary form with 'name' key for enum members
  qapi: improve reporting of unknown or missing keys
  qapi: factor out checking for keys
  tests: print enum type members more like object type members
  qapi: change enum visitor and gen_enum* to take QAPISchemaMember
  qapi: Do not define enumeration value explicitly
  qapi: break long lines at 'data' member
  qapi: rename QAPISchemaEnumType.values to .members
  ...

Signed-off-by: Peter Maydell <address@hidden>


Compare: https://github.com/qemu/qemu/compare/d058a37a6e8d...81781be3c992
      **NOTE:** This service has been marked for deprecation: 
https://developer.github.com/changes/2018-04-25-github-services-deprecation/

      Functionality will be removed from GitHub.com on January 31st, 2019.

reply via email to

[Prev in Thread] Current Thread [Next in Thread]