qemu-commits
[Top][All Lists]
Advanced

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

[Qemu-commits] [qemu/qemu] b2cd5b: test-keyval: Tweaks to improve list c


From: GitHub
Subject: [Qemu-commits] [qemu/qemu] b2cd5b: test-keyval: Tweaks to improve list coverage
Date: Thu, 23 Mar 2017 06:45:11 -0700

  Branch: refs/heads/master
  Home:   https://github.com/qemu/qemu
  Commit: b2cd5b925c529d91fae5fe8373490714e1a8fe6c
      
https://github.com/qemu/qemu/commit/b2cd5b925c529d91fae5fe8373490714e1a8fe6c
  Author: Markus Armbruster <address@hidden>
  Date:   2017-03-21 (Tue, 21 Mar 2017)

  Changed paths:
    M tests/test-keyval.c

  Log Message:
  -----------
  test-keyval: Tweaks to improve list coverage

We have a negative test case for a list index with leading zero.  Add
positive ones.

Tweak the test case for list index greater or equal the number of
elements: test "equal" instead of "greater" to guard against
off-by-one mistakes.

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


  Commit: fae425d74f20d45a3c0bea4b7403b16f7b659e25
      
https://github.com/qemu/qemu/commit/fae425d74f20d45a3c0bea4b7403b16f7b659e25
  Author: Markus Armbruster <address@hidden>
  Date:   2017-03-21 (Tue, 21 Mar 2017)

  Changed paths:
    M util/keyval.c

  Log Message:
  -----------
  keyval: Improve some comments

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


  Commit: 599c156bac7fd7f80be9d0e958e1aa19ad3dab57
      
https://github.com/qemu/qemu/commit/599c156bac7fd7f80be9d0e958e1aa19ad3dab57
  Author: Markus Armbruster <address@hidden>
  Date:   2017-03-21 (Tue, 21 Mar 2017)

  Changed paths:
    M tests/Makefile.include
    M tests/test-keyval.c

  Log Message:
  -----------
  test-keyval: Cover alternate and 'any' type

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


  Commit: 0ee9ae7c8cda8b371b6b414c0d895feaec04f79e
      
https://github.com/qemu/qemu/commit/0ee9ae7c8cda8b371b6b414c0d895feaec04f79e
  Author: Markus Armbruster <address@hidden>
  Date:   2017-03-21 (Tue, 21 Mar 2017)

  Changed paths:
    M util/keyval.c

  Log Message:
  -----------
  keyval: Document issues with 'any' and alternate types

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


  Commit: e94630d3adcb2ff8b70b95f5dd3873ecadfbd19b
      
https://github.com/qemu/qemu/commit/e94630d3adcb2ff8b70b95f5dd3873ecadfbd19b
  Author: Markus Armbruster <address@hidden>
  Date:   2017-03-21 (Tue, 21 Mar 2017)

  Changed paths:
    M MAINTAINERS

  Log Message:
  -----------
  MAINTAINERS: Add myself for files I touched recently

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


  Commit: 4afeeb57a16ab28727ffe1d644b691f9c83b8207
      
https://github.com/qemu/qemu/commit/4afeeb57a16ab28727ffe1d644b691f9c83b8207
  Author: Markus Armbruster <address@hidden>
  Date:   2017-03-21 (Tue, 21 Mar 2017)

  Changed paths:
    M Makefile

  Log Message:
  -----------
  qapi: Drop excessive Make dependencies on qapi2texi.py

When qapi2texi.py changes, we regenerate everything QAPI.  Screwed up
in commit 56e8bdd.

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


  Commit: e8ba07ea9af6e71d6b1d946df7bcc5f5d6b0d22f
      
https://github.com/qemu/qemu/commit/e8ba07ea9af6e71d6b1d946df7bcc5f5d6b0d22f
  Author: Markus Armbruster <address@hidden>
  Date:   2017-03-21 (Tue, 21 Mar 2017)

  Changed paths:
    M scripts/qapi2texi.py

  Log Message:
  -----------
  qapi2texi: Fix to actually fail when 'doc-required' is false

Messed up in commit bc52d03.

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


  Commit: 32b8a2ad618b20ff9eb3ac9ce0418a9239916571
      
https://github.com/qemu/qemu/commit/32b8a2ad618b20ff9eb3ac9ce0418a9239916571
  Author: Markus Armbruster <address@hidden>
  Date:   2017-03-21 (Tue, 21 Mar 2017)

  Changed paths:
    M scripts/qapi.py

  Log Message:
  -----------
  qapi: Drop unused QAPIDoc member optional

Unused since commit aa964b7 "qapi2texi: Convert to QAPISchemaVisitor"

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


  Commit: 818c3318332a0b0ba5931d8d74d2260fb0328a71
      
https://github.com/qemu/qemu/commit/818c3318332a0b0ba5931d8d74d2260fb0328a71
  Author: Markus Armbruster <address@hidden>
  Date:   2017-03-21 (Tue, 21 Mar 2017)

  Changed paths:
    M tests/qapi-schema/test-qapi.py

  Log Message:
  -----------
  tests/qapi-schema: Make test-qapi.py print docs again

test-qapi.py used to print the internal representation of doc comments
(commit 3313b61).  This went away when we dropped the doc comments in
positive tests (commit 87c16dc).  Bring it back, because I'm going to
add real positive doc comment tests.

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


  Commit: 80d1f2e4a5df739842806610fb462753dde27b9a
      
https://github.com/qemu/qemu/commit/80d1f2e4a5df739842806610fb462753dde27b9a
  Author: Markus Armbruster <address@hidden>
  Date:   2017-03-21 (Tue, 21 Mar 2017)

  Changed paths:
    M tests/Makefile.include
    A tests/qapi-schema/doc-good.err
    A tests/qapi-schema/doc-good.exit
    A tests/qapi-schema/doc-good.json
    A tests/qapi-schema/doc-good.out
    A tests/qapi-schema/doc-good.texi

  Log Message:
  -----------
  tests/qapi-schema: Systematic positive doc comment tests

We have a number of negative tests, but we don't have systematic
positive coverage.  Fix that.

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


  Commit: c32617a1941aadfe580af6c4418ef02c9644cd44
      
https://github.com/qemu/qemu/commit/c32617a1941aadfe580af6c4418ef02c9644cd44
  Author: Markus Armbruster <address@hidden>
  Date:   2017-03-21 (Tue, 21 Mar 2017)

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

  Log Message:
  -----------
  qapi2texi: Fix translation of *strong* and _emphasized_

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


  Commit: d2788227c6185c72d88ef3127e9fed41686f8e39
      
https://github.com/qemu/qemu/commit/d2788227c6185c72d88ef3127e9fed41686f8e39
  Author: Markus Armbruster <address@hidden>
  Date:   2017-03-21 (Tue, 21 Mar 2017)

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

  Log Message:
  -----------
  qapi: Fix string input visitor regression for empty lists

Visiting a list when input is the empty string should result in an
empty list, not an error.  Noticed when commit 3d089ce belatedly added
tests, but simply accepted as weird then.  It's actually a regression:
broken in commit 74f24cb, v2.7.0.  Fix it, and throw in another test
case for empty string.

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


  Commit: 658ae5a7b90139a6a296cd4cd83643d843964796
      
https://github.com/qemu/qemu/commit/658ae5a7b90139a6a296cd4cd83643d843964796
  Author: Markus Armbruster <address@hidden>
  Date:   2017-03-21 (Tue, 21 Mar 2017)

  Changed paths:
    M backends/hostmem.c

  Log Message:
  -----------
  Revert "hostmem: fix QEMU crash by 'info memdev'"

This reverts commit 1454d33f0507cb54d62ed80f494884157c9e7130.

The string input visitor regression fixed in the previous commit made
visit_type_uint16List() fail on empty input.  query_memdev() calls it
via object_property_get_uint16List().  Because it doesn't expect it to
fail, it passes &error_abort, and duly crashes.

Commit 1454d33 "fixes" this crash by making
host_memory_backend_get_host_nodes() return a list containing just
MAX_NODES instead of the empty list.  Papers over the regression, and
leads to bogus "info memdev" output, as shown below; revert.

I suspect that if we had bisected the crash back then, we would have
found and fixed the actual bug instead of papering over it.

To reproduce, run HMP command "info memdev" with

    $ qemu-system-x86_64 --nodefaults -S -display none -monitor stdio -object 
memory-backend-ram,id=mem1,size=4k

With this commit, "info memdev" prints

    memory backend: mem1
      size:  4096
      merge: true
      dump: true
      prealloc: false
      policy: default
      host nodes:

exactly like before commit 74f24cb.

Between commit 1454d33 and this commit, it prints

    memory backend: mem1
      size:  4096
      merge: true
      dump: true
      prealloc: false
      policy: default
      host nodes: 128

The last line is bogus.

Between commit 74f24cb and 1454d33, it crashes like this:

    Unexpected error in parse_str() at 
/work/armbru/tmp/qemu/qapi/string-input-visitor.c:126:
    Parameter 'null' expects an int64 value or range
    Aborted (core dumped)

Cc: Xiao Guangrong <address@hidden>
Cc: Paolo Bonzini <address@hidden>
Signed-off-by: Markus Armbruster <address@hidden>
Message-Id: <address@hidden>
Reviewed-by: Michael Roth <address@hidden>
Reviewed-by: Eric Blake <address@hidden>


  Commit: 4bc0c94da40055dc68645847fa8bcddef47fedd5
      
https://github.com/qemu/qemu/commit/4bc0c94da40055dc68645847fa8bcddef47fedd5
  Author: Markus Armbruster <address@hidden>
  Date:   2017-03-21 (Tue, 21 Mar 2017)

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

  Log Message:
  -----------
  test-qobject-input-visitor: Cover visit_type_uint64()

The new test demonstrates known bugs: integers between INT64_MAX+1 and
UINT64_MAX rejected, and integers between INT64_MIN and -1 are
accepted modulo 2^64.

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


  Commit: 76861f6befc50c30cb71e84b372dc91dd26656a4
      
https://github.com/qemu/qemu/commit/76861f6befc50c30cb71e84b372dc91dd26656a4
  Author: Eric Blake <address@hidden>
  Date:   2017-03-22 (Wed, 22 Mar 2017)

  Changed paths:
    M tests/test-opts-visitor.c

  Log Message:
  -----------
  tests: Expose regression in QemuOpts visitor

Commit 15c2f669e broke the ability of the QemuOpts visitor to
flag extra input parameters, but the regression went unnoticed
because of missing testsuite coverage.  Add a test to cover this;
take the approach already used in 9cb8ef3 of adding a test that
passes (to avoid breaking bisection) but marks with BUG the
behavior that we don't like, so that the actual impact of the
fix in a later patch is easier to see.

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


  Commit: 9a6d1acb3e752e1e0b693cc0491fa12875b76be0
      
https://github.com/qemu/qemu/commit/9a6d1acb3e752e1e0b693cc0491fa12875b76be0
  Author: Eric Blake <address@hidden>
  Date:   2017-03-22 (Wed, 22 Mar 2017)

  Changed paths:
    M qom/object_interfaces.c

  Log Message:
  -----------
  qom: Avoid unvisited 'id'/'qom-type' in user_creatable_add_opts

A regression in commit 15c2f669e caused us to silently ignore
excess input to the QemuOpts visitor.  Later, commit ea4641
accidentally abused that situation, by removing "qom-type" and
"id" from the corresponding QDict but leaving them defined in
the QemuOpts, when using the pair of containers to create a
user-defined object. Note that since we are already traversing
two separate items (a QDict and a QemuOpts), we are already
able to flag bogus arguments, as in:

$ ./x86_64-softmmu/qemu-system-x86_64 -nodefaults -nographic -qmp stdio -object 
memory-backend-ram,id=mem1,size=4k,bogus=huh
qemu-system-x86_64: -object memory-backend-ram,id=mem1,size=4k,bogus=huh: 
Property '.bogus' not found

So the only real concern is that when we re-enable strict checking
in the QemuOpts visitor, we do not want to start flagging the two
leftover keys as unvisited.  Rearrange the code to clean out the
QemuOpts listing in advance, rather than removing items from the
QDict.  Since "qom-type" is usually an automatic implicit default,
we don't have to restore it (this does mean that once instantiated,
QemuOpts is not necessarily an accurate representation of the
original command line - but this is not the first place to do that);
however "id" has to be put back (requiring us to cast away a const).

[As a side note, hmp_object_add() turns a QDict into a QemuOpts,
then calls user_creatable_add_opts() which converts QemuOpts into
a new QDict. There are probably a lot of wasteful conversions like
this, but cleaning them up is a much bigger task than the immediate
regression fix.]

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


  Commit: 21f88d021d0d2b4ecee8f6cd6ca63a943a3ce71d
      
https://github.com/qemu/qemu/commit/21f88d021d0d2b4ecee8f6cd6ca63a943a3ce71d
  Author: Eric Blake <address@hidden>
  Date:   2017-03-22 (Wed, 22 Mar 2017)

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

  Log Message:
  -----------
  qapi: Fix QemuOpts visitor regression on unvisited input

An off-by-one in commit 15c2f669e meant that we were failing to
check for unparsed input in all QemuOpts visitors.  Recent testsuite
additions show that fixing the obvious bug with bogus fields will
also fix the case of an incomplete list visit; update the tests to
match the new behavior.

Simple testcase:

./x86_64-softmmu/qemu-system-x86_64 -nodefaults -nographic -qmp stdio -numa 
node,size=1g

failed to diagnose that 'size' is not a valid argument to -numa, and
now once again reports:

qemu-system-x86_64: -numa node,size=1g: Invalid parameter 'size'

See also https://bugzilla.redhat.com/show_bug.cgi?id=1434666

CC: address@hidden
Signed-off-by: Eric Blake <address@hidden>
Reviewed-by: Michael Roth <address@hidden>
Tested-by: Laurent Vivier <address@hidden>
Message-Id: <address@hidden>
Reviewed-by: Markus Armbruster <address@hidden>
Signed-off-by: Markus Armbruster <address@hidden>


  Commit: d81d857f4421d205395d55200425daa6591c28a5
      
https://github.com/qemu/qemu/commit/d81d857f4421d205395d55200425daa6591c28a5
  Author: Peter Maydell <address@hidden>
  Date:   2017-03-23 (Thu, 23 Mar 2017)

  Changed paths:
    M MAINTAINERS
    M Makefile
    M backends/hostmem.c
    M qapi/opts-visitor.c
    M qapi/string-input-visitor.c
    M qom/object_interfaces.c
    M scripts/qapi.py
    M scripts/qapi2texi.py
    M tests/Makefile.include
    A tests/qapi-schema/doc-good.err
    A tests/qapi-schema/doc-good.exit
    A tests/qapi-schema/doc-good.json
    A tests/qapi-schema/doc-good.out
    A tests/qapi-schema/doc-good.texi
    M tests/qapi-schema/test-qapi.py
    M tests/test-keyval.c
    M tests/test-opts-visitor.c
    M tests/test-qobject-input-visitor.c
    M tests/test-string-input-visitor.c
    M util/keyval.c

  Log Message:
  -----------
  Merge remote-tracking branch 'remotes/armbru/tags/pull-qapi-2017-03-22-v3' 
into staging

QAPI patches for 2017-03-22

# gpg: Signature made Wed 22 Mar 2017 18:25:15 GMT
# gpg:                using RSA key 0x3870B400EB918653
# 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-2017-03-22-v3:
  qapi: Fix QemuOpts visitor regression on unvisited input
  qom: Avoid unvisited 'id'/'qom-type' in user_creatable_add_opts
  tests: Expose regression in QemuOpts visitor
  test-qobject-input-visitor: Cover visit_type_uint64()
  Revert "hostmem: fix QEMU crash by 'info memdev'"
  qapi: Fix string input visitor regression for empty lists
  qapi2texi: Fix translation of *strong* and _emphasized_
  tests/qapi-schema: Systematic positive doc comment tests
  tests/qapi-schema: Make test-qapi.py print docs again
  qapi: Drop unused QAPIDoc member optional
  qapi2texi: Fix to actually fail when 'doc-required' is false
  qapi: Drop excessive Make dependencies on qapi2texi.py
  MAINTAINERS: Add myself for files I touched recently
  keyval: Document issues with 'any' and alternate types
  test-keyval: Cover alternate and 'any' type
  keyval: Improve some comments
  test-keyval: Tweaks to improve list coverage

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


Compare: https://github.com/qemu/qemu/compare/e6ebebc204bf...d81d857f4421

reply via email to

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