qemu-commits
[Top][All Lists]
Advanced

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

[Qemu-commits] [qemu/qemu] 74d8c9: qga: Fix crash on non-dictionary QMP


From: GitHub
Subject: [Qemu-commits] [qemu/qemu] 74d8c9: qga: Fix crash on non-dictionary QMP argument
Date: Mon, 06 Mar 2017 05:15:12 -0800

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

  Changed paths:
    M qapi/qmp-dispatch.c

  Log Message:
  -----------
  qga: Fix crash on non-dictionary QMP argument

The value of key 'arguments' must be a JSON object.  qemu-ga neglects
to check, and crashes.  To reproduce, send

    { 'execute': 'guest-sync', 'arguments': [] }

to qemu-ga.

do_qmp_dispatch() uses qdict_get_qdict() to get the arguments.  When
not a JSON object, this gets a null pointer, which flows through the
generated marshalling function to qobject_input_visitor_new(), where
it fails the assertion.  qmp_dispatch_check_obj() needs to catch this
error.

QEMU isn't affected, because it runs qmp_check_input_obj() first,
which basically duplicates qmp_dispatch_check_obj()'s checks, plus the
missing one.

Fix by copying the missing one from qmp_check_input_obj() to
qmp_dispatch_check_obj().

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


  Commit: 13420ef837a217afd9f1bd4728667e1ea50d5916
      
https://github.com/qemu/qemu/commit/13420ef837a217afd9f1bd4728667e1ea50d5916
  Author: Markus Armbruster <address@hidden>
  Date:   2017-03-05 (Sun, 05 Mar 2017)

  Changed paths:
    M tests/libqtest.c

  Log Message:
  -----------
  libqtest: Work around a "QMP wants a newline" bug

The next commit is going to add a test that calls qmp("null").
Curiously, this hangs.  Here's why.

qmp_fd_sendv() doesn't send newlines.  Not even when @fmt contains
some.  At first glance, the QMP parser seems to be fine with that.
However, it turns out that it fails to react to input until it sees
either a newline, an object or an array.  To reproduce, feed to a QMP
monitor like this:

    $ echo -n 'null' | socat UNIX:/work/armbru/images/test-qmp STDIO
    {"QMP": {"version": {"qemu": {"micro": 50, "minor": 8, "major": 2}, 
"package": " (v2.8.0-1195-gf84141e-dirty)"}, "capabilities": []}}

No output after the greeting.

Add a newline:

    $ echo 'null' | socat UNIX:/work/armbru/images/test-qmp STDIO
    {"QMP": {"version": {"qemu": {"micro": 50, "minor": 8, "major": 2}, 
"package": " (v2.8.0-1195-gf84141e-dirty)"}, "capabilities": []}}
    {"error": {"class": "GenericError", "desc": "Expected 'object' in QMP 
input"}}

Correct output for input 'null'.

Add an object instead:

    $ echo -n 'null { "execute": "qmp_capabilities" }' | socat UNIX:qmp-socket 
STDIO
    {"QMP": {"version": {"qemu": {"micro": 50, "minor": 8, "major": 2}, 
"package": " (v2.8.0-1195-gf84141e-dirty)"}, "capabilities": []}}
    {"error": {"class": "GenericError", "desc": "Expected 'object' in QMP 
input"}}
    {"return": {}}

Also correct output.

Work around this QMP bug by having qmp_fd_sendv() append a newline.

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


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

  Changed paths:
    M MAINTAINERS
    M tests/Makefile.include
    M tests/libqtest.c
    M tests/libqtest.h
    A tests/qmp-test.c

  Log Message:
  -----------
  qmp-test: New, covering basic QMP protocol

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


  Commit: 05875687806b71ae980ca59a46777b742b20ac06
      
https://github.com/qemu/qemu/commit/05875687806b71ae980ca59a46777b742b20ac06
  Author: Markus Armbruster <address@hidden>
  Date:   2017-03-05 (Sun, 05 Mar 2017)

  Changed paths:
    M include/monitor/monitor.h
    M include/qemu/module.h
    M monitor.c
    M qga/main.c
    M scripts/qapi-commands.py
    M tests/test-qmp-commands.c
    M vl.c

  Log Message:
  -----------
  qmp: Dumb down how we run QMP command registration

The way we get QMP commands registered is high tech:

* qapi-commands.py generates qmp_init_marshal() that does the actual work

* it also generates the magic to register it as a MODULE_INIT_QAPI
  function, so it runs when someone calls
  module_call_init(MODULE_INIT_QAPI)

* main() calls module_call_init()

QEMU needs to register a few non-qapified commands.  Same high tech
works: monitor.c has its own qmp_init_marshal() along with the magic
to make it run in module_call_init(MODULE_INIT_QAPI).

QEMU also needs to unregister commands that are not wanted in this
build's configuration (commit 5032a16).  Simple enough:
qmp_unregister_commands_hack().  The difficulty is to make it run
after the generated qmp_init_marshal().  We can't simply run it in
monitor.c's qmp_init_marshal(), because the order in which the
registered functions run is indeterminate.  So qmp_init_marshal()
registers qmp_unregister_commands_hack() separately.  Since
registering *appends* to the list of registered functions, this will
make it run after all the functions that have been registered already.

I suspect it takes a long and expensive computer science education to
not find this silly.

Dumb it down as follows:

* Drop MODULE_INIT_QAPI entirely

* Give the generated qmp_init_marshal() external linkage.

* Call it instead of module_call_init(MODULE_INIT_QAPI)

* Except in QEMU proper, call new monitor_init_qmp_commands() that in
  turn calls the generated qmp_init_marshal(), registers the
  additional commands and unregisters the unwanted ones.

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


  Commit: 1527badb954f2d8c17b86e2a258812def5ea3dcc
      
https://github.com/qemu/qemu/commit/1527badb954f2d8c17b86e2a258812def5ea3dcc
  Author: Markus Armbruster <address@hidden>
  Date:   2017-03-05 (Sun, 05 Mar 2017)

  Changed paths:
    M include/qapi/qmp/dispatch.h
    M monitor.c
    M qapi/qmp-dispatch.c
    M qapi/qmp-registry.c
    M qga/commands.c
    M qga/guest-agent-core.h
    M qga/main.c
    M scripts/qapi-commands.py
    M tests/test-qmp-commands.c

  Log Message:
  -----------
  qapi: Support multiple command registries per program

The command registry encapsulates a single command list.  Give the
functions using it a parameter instead.  Define suitable command lists
in monitor, guest agent and test-qmp-commands.

Signed-off-by: Markus Armbruster <address@hidden>
Message-Id: <address@hidden>
[Debugging turds buried]
Reviewed-by: Eric Blake <address@hidden>


  Commit: 9b0c9a63492f9f8f4dc94b0ac5a28fc6a946389b
      
https://github.com/qemu/qemu/commit/9b0c9a63492f9f8f4dc94b0ac5a28fc6a946389b
  Author: Markus Armbruster <address@hidden>
  Date:   2017-03-05 (Sun, 05 Mar 2017)

  Changed paths:
    M scripts/qapi-introspect.py

  Log Message:
  -----------
  qapi-introspect: Mangle --prefix argument properly for C

qapi-introspect.py --prefix hasn't been used so far, but fix it anyway.

Signed-off-by: Markus Armbruster <address@hidden>
Message-Id: <address@hidden>
[Commit message improved]
Reviewed-by: Eric Blake <address@hidden>


  Commit: 635db18f68ded6abec11cd4cf64ebc15c1c6b190
      
https://github.com/qemu/qemu/commit/635db18f68ded6abec11cd4cf64ebc15c1c6b190
  Author: Markus Armbruster <address@hidden>
  Date:   2017-03-05 (Sun, 05 Mar 2017)

  Changed paths:
    M monitor.c

  Log Message:
  -----------
  qmp: Clean up how we enforce capability negotiation

To enforce capability negotiation before normal operation,
handle_qmp_command() inspects every command before it's handed off to
qmp_dispatch().  This is a bit of a layering violation, and results in
duplicated code.

Before capability negotiation (!cur_mon->in_command_mode), we fail
commands other than "qmp_capabilities".  This is what enforces
capability negotiation.

Afterwards, we fail command "qmp_capabilities".

Clean this up as follows.

The obvious place to fail a command is the command itself, so move the
"afterwards" check to qmp_qmp_capabilities().

We do the "before" check in every other command, but that would be
bothersome.  Instead, start with an alternate list of commands that
contains only "qmp_capabilities".  Switch to the full list in
qmp_qmp_capabilities().

Additionally, replace the generic human-readable error message for
CommandNotFound by one that reminds the user to run qmp_capabilities.
Without that, we'd regress commit 2d5a834.

Signed-off-by: Markus Armbruster <address@hidden>
Message-Id: <address@hidden>
[Mirco-optimization squashed in, commit message typo fixed]
Reviewed-by: Eric Blake <address@hidden>


  Commit: 104fc3027960dd2aa9d310936a6cb201c60e1088
      
https://github.com/qemu/qemu/commit/104fc3027960dd2aa9d310936a6cb201c60e1088
  Author: Markus Armbruster <address@hidden>
  Date:   2017-03-05 (Sun, 05 Mar 2017)

  Changed paths:
    M monitor.c
    M qapi/qmp-dispatch.c
    M trace-events

  Log Message:
  -----------
  qmp: Drop duplicated QMP command object checks

qmp_check_input_obj() duplicates qmp_dispatch_check_obj(), except the
latter screws up an error message.  handle_qmp_command() runs first
the former, then the latter via qmp_dispatch(), masking the screwup.

qemu-ga also masks the screwup, because it also duplicates checks,
just differently.

qmp_check_input_obj() exists because handle_qmp_command() needs to
examine the command before dispatching it.  The previous commit got
rid of this need, except for a tracepoint, and a bit of "id" code that
relies on qdict not being null.

Fix up the error message in qmp_dispatch_check_obj(), drop
qmp_check_input_obj() and the tracepoint.  Protect the "id" code with
a conditional.

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


  Commit: 99fb0c53c038105bae68b02a3d9f1cbf7951ba10
      
https://github.com/qemu/qemu/commit/99fb0c53c038105bae68b02a3d9f1cbf7951ba10
  Author: Markus Armbruster <address@hidden>
  Date:   2017-03-05 (Sun, 05 Mar 2017)

  Changed paths:
    M include/qapi/qmp/qerror.h
    M qapi/qmp-dispatch.c
    M qapi/qobject-input-visitor.c

  Log Message:
  -----------
  qmp: Eliminate silly QERR_QMP_* macros

The QERR_ macros are leftovers from the days of "rich" error objects.

QERR_QMP_BAD_INPUT_OBJECT, QERR_QMP_BAD_INPUT_OBJECT_MEMBER,
QERR_QMP_EXTRA_MEMBER are used in just one place now, except for one
use that has crept into qobject-input-visitor.c.

Drop these macros, to make the (bad) error messages more visible.

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


  Commit: 910f738b851a263396fc85b2052e47f884ffead3
      
https://github.com/qemu/qemu/commit/910f738b851a263396fc85b2052e47f884ffead3
  Author: Markus Armbruster <address@hidden>
  Date:   2017-03-05 (Sun, 05 Mar 2017)

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

  Log Message:
  -----------
  qapi: Improve a QObject input visitor error message

The QObject input visitor has three error message formats:

* Parameter '%s' is missing
* "Invalid parameter type for '%s', expected: %s"
* "QMP input object member '%s' is unexpected"

The '%s' are member names (or "null", but I'll fix that later).

The last error message calls the thing "QMP input object member"
instead of "parameter".  Misleading when the visitor is used on
QObjects that don't come from QMP.  Change it to "Parameter '%s' is
unexpected".

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


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

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

  Log Message:
  -----------
  qapi: Clean up after commit 3d344c2

Drop unused QIV_STACK_SIZE and unused qobject_input_start_struct()
parameter errp.

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


  Commit: 58561c27669ddf1c6d39ff8ce25837c6f2d9d92c
      
https://github.com/qemu/qemu/commit/58561c27669ddf1c6d39ff8ce25837c6f2d9d92c
  Author: Markus Armbruster <address@hidden>
  Date:   2017-03-05 (Sun, 05 Mar 2017)

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

  Log Message:
  -----------
  qapi: Make QObject input visitor set *list reliably

qobject_input_start_struct() sets *list, except when it fails because
qobject_input_get_object() fails, i.e. the input object doesn't exist.

All the other input visitor start_struct(), start_list(),
start_alternate() always set *obj / *list.

Change qobject_input_start_struct() to match.

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


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

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

  Log Message:
  -----------
  qapi: Improve qobject input visitor error reporting

Error messages refer to nodes of the QObject being visited by name.
Trouble is the names are sometimes less than helpful:

* The name of the root QObject is whatever @name argument got passed
  to the visitor, except NULL gets mapped to "null".  We commonly pass
  NULL.  Not good.

  Avoiding errors "at the root" mitigates.  For instance,
  visit_start_struct() can only fail when the visited object is not a
  dictionary, and we commonly ensure it is beforehand.

* The name of a QDict's member is the member key.  Good enough only
  when this happens to be unique.

* The name of a QList's member is "null".  Not good.

Improve error messages by referring to nodes by path instead, as
follows:

* The path of the root QObject is whatever @name argument got passed
  to the visitor, except NULL gets mapped to "<anonymous>".

* The path of a root QDict's member is the member key.

* The path of a root QList's member is "[%u]", where %u is the list
  index, starting at zero.

* The path of a non-root QDict's member is the path of the QDict
  concatenated with "." and the member key.

* The path of a non-root QList's member is the path of the QList
  concatenated with "[%u]", where %u is the list index.

For example, the incorrect QMP command

    { "execute": "blockdev-add", "arguments": { "node-name": "foo", "driver": 
"raw", "file": {"driver": "file" } } }

now fails with

    {"error": {"class": "GenericError", "desc": "Parameter 'file.filename' is 
missing"}}

instead of

    {"error": {"class": "GenericError", "desc": "Parameter 'filename' is 
missing"}}

and

    { "execute": "input-send-event", "arguments": { "device": "bar", "events": 
[ [] ] } }

now fails with

    {"error": {"class": "GenericError", "desc": "Invalid parameter type for 
'events[0]', expected: object"}}

instead of

    {"error": {"class": "GenericError", "desc": "Invalid parameter type for 
'null', expected: QDict"}}

Aside: calling the thing "parameter" is suboptimal for QMP, because
the root object is "arguments" there.

The qobject output visitor doesn't have this problem because it should
not fail.  Same for dealloc and clone visitors.

The string visitors don't have this problem because they visit just
one value, whose name needs to be passed to the visitor as @name.  The
string output visitor shouldn't fail anyway.

The options visitor uses QemuOpts names.  Their name space is flat, so
the use of QDict member keys as names is fine.  NULL names used with
roots and lists could conceivably result in bad error messages.  Left
for another day.

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


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

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

  Log Message:
  -----------
  qapi: Drop string input visitor method optional()

visit_optional() is to be called only between visit_start_struct() and
visit_end_struct().  Visitors that don't support struct visits,
i.e. don't implement start_struct(), end_struct(), have no use for it.
Clarify documentation.

The string input visitor doesn't support struct visits.  Its
parse_optional() is therefore useless.  Drop it.

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


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

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

  Log Message:
  -----------
  qapi: Make string input and opts visitor require non-null input

The string input visitor tries to cope with null input.  Null input
isn't used anywhere, and isn't covered by tests.  Unsurprisingly, it
doesn't fully work: start_list() crashes because it passes the input
via parse_str() to strtoll() unchecked.

Make string_input_visitor_new() assert its argument isn't null, and
drop the code trying to deal with null input.

The opts visitor crashes when you try to actually visit something with
null input.  Make opts_visitor_new() assert its argument isn't null,
mostly for clarity.

qobject_input_visitor_new() already asserts its argument isn't null.

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


  Commit: 05601ed2de60df0e344d6b783a6bc0c1ff2b5d1f
      
https://github.com/qemu/qemu/commit/05601ed2de60df0e344d6b783a6bc0c1ff2b5d1f
  Author: Markus Armbruster <address@hidden>
  Date:   2017-03-05 (Sun, 05 Mar 2017)

  Changed paths:
    M qom/qom-qobject.c

  Log Message:
  -----------
  qom: Make object_property_set_qobject()'s input visitor strict

Commit 240f64b made all qobject input visitors created outside tests
strict, except for the one in object_property_set_qobject().  That one
was left behind only because Eric couldn't spare the time to figure
out whether making it strict would break anything, with a TODO
comment.  Time to resolve it.

Strict makes a difference only for otherwise successful visits of QAPI
structs or unions.  Let's examine what the callers of
object_property_set_qobject() visit:

* object_property_set_str(), object_property_set_bool(),
  object_property_set_int() visit a QString, QBool, QInt,
  respectively.  Strictness can't matter.

* qmp_qom_set visits its @value argument.  Comes straight from QMP and
  can be anything ('any' in the QAPI schema).  Strictness matters when
  the property's set() method visits a struct or union QAPI type.

  No such methods exist, thus switching to strict can't break
  anything.

  If we acquire such methods in the future, we'll *want* the visitor
  to be strict, so that unexpected members get rejected as they should
  be.

Switch to strict.

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


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

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

  Log Message:
  -----------
  test-qobject-input-visitor: Use strict visitor

The qobject input visitor comes in a strict and a non-strict variant.
This test is the non-strict variant's last user.  Turns out it relies
on non-strict only in test_visitor_in_null(), and just out of
laziness.  We don't actually test the non-strict behavior.

Clean up test_visitor_in_null(), and switch to the strict variant.
The next commit will drop the non-strict variant.

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


  Commit: 048abb7b20c9f822ad9d4b730bade73b3311a47a
      
https://github.com/qemu/qemu/commit/048abb7b20c9f822ad9d4b730bade73b3311a47a
  Author: Markus Armbruster <address@hidden>
  Date:   2017-03-05 (Sun, 05 Mar 2017)

  Changed paths:
    M block/nbd.c
    M block/nfs.c
    M block/ssh.c
    M docs/qapi-code-gen.txt
    M include/qapi/qobject-input-visitor.h
    M qapi/qobject-input-visitor.c
    M qmp.c
    M qom/qom-qobject.c
    M scripts/qapi-commands.py
    M target/s390x/cpu_models.c
    M tests/check-qnull.c
    M tests/qmp-test.c
    M tests/test-qmp-commands.c
    M tests/test-qobject-input-strict.c
    M tests/test-qobject-input-visitor.c
    M tests/test-visitor-serialization.c

  Log Message:
  -----------
  qapi: Drop unused non-strict qobject input visitor

The split between tests/test-qobject-input-visitor.c and
tests/test-qobject-input-strict.c now makes less sense than ever.  The
next commit will take care of that.

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


  Commit: 77c47de23ff58ff987fed92713546d99720bd099
      
https://github.com/qemu/qemu/commit/77c47de23ff58ff987fed92713546d99720bd099
  Author: Markus Armbruster <address@hidden>
  Date:   2017-03-05 (Sun, 05 Mar 2017)

  Changed paths:
    M tests/Makefile.include
    R tests/test-qobject-input-strict.c
    M tests/test-qobject-input-visitor.c

  Log Message:
  -----------
  tests-qobject-input-strict: Merge into test-qobject-input-visitor

Much of test-qobject-input-strict.c duplicates
test-qobject-input-strict.c, but with less assertions on expected
output:

* test_validate_struct() duplicates test_visitor_in_struct()

* test_validate_struct_nested() duplicates
  test_visitor_in_struct_nested()

* test_validate_list() duplicates the first half of
  test_visitor_in_list()

* test_validate_union_native_list() duplicates
  test_visitor_in_native_list_int()

* test_validate_union_flat() duplicates test_visitor_in_union_flat()

* test_validate_alternate() duplicates the first part of
  test_visitor_in_alternate()

Merge the remaining test cases into test-qobject-input-visitor.c, and
drop the now redundant test-qobject-input-strict.c.

Test case "/visitor/input-strict/fail/list" isn't really about lists,
it's about a bad struct nested in a list.  Rename accordingly.

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


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

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

  Log Message:
  -----------
  test-string-input-visitor: Tear down existing test automatically

Call visitor_input_teardown() from visitor_input_test_init(), so you
don't have to call it from the actual tests.

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


  Commit: 3d089cea0d32e2cb63604a98f4aa2028860502f0
      
https://github.com/qemu/qemu/commit/3d089cea0d32e2cb63604a98f4aa2028860502f0
  Author: Markus Armbruster <address@hidden>
  Date:   2017-03-05 (Sun, 05 Mar 2017)

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

  Log Message:
  -----------
  test-string-input-visitor: Improve list coverage

Lists with elements above INT64_MAX don't work (known bug).  Empty
lists don't work (weird).

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


  Commit: 9cb8ef36681b9645af1f7bd8fb64656e65de8a03
      
https://github.com/qemu/qemu/commit/9cb8ef36681b9645af1f7bd8fb64656e65de8a03
  Author: Markus Armbruster <address@hidden>
  Date:   2017-03-05 (Sun, 05 Mar 2017)

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

  Log Message:
  -----------
  tests: Cover partial input visit of list

Demonstrates a design flaw: there is no way to for input visitors to
report that a list visit didn't visit the complete input list.  The
generated list visits always do, but manual visits needn't.

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


  Commit: 86ca0dbe04d8eeebf460b56111c9af125e14528f
      
https://github.com/qemu/qemu/commit/86ca0dbe04d8eeebf460b56111c9af125e14528f
  Author: Markus Armbruster <address@hidden>
  Date:   2017-03-05 (Sun, 05 Mar 2017)

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

  Log Message:
  -----------
  test-qobject-input-visitor: Cover missing nested struct member

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


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

  Changed paths:
    M hw/ppc/spapr_drc.c
    M include/qapi/visitor-impl.h
    M include/qapi/visitor.h
    M qapi/opts-visitor.c
    M qapi/qapi-visit-core.c
    M qapi/qobject-input-visitor.c
    M qapi/string-input-visitor.c
    M qapi/trace-events
    M scripts/qapi-visit.py
    M tests/test-opts-visitor.c
    M tests/test-qobject-input-visitor.c
    M tests/test-string-input-visitor.c

  Log Message:
  -----------
  qapi: Make input visitors detect unvisited list tails

Fix the design flaw demonstrated in the previous commit: new method
check_list() lets input visitors report that unvisited input remains
for a list, exactly like check_struct() lets them report that
unvisited input remains for a struct or union.

Implement the method for the qobject input visitor (straightforward),
and the string input visitor (less so, due to the magic list syntax
there).  The opts visitor's list magic is even more impenetrable, and
all I can do there today is a stub with a FIXME comment.  No worse
than before.

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


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

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

  Log Message:
  -----------
  tests: Cover input visit beyond end of list

When you try to visit beyond the end of a list, the qobject input
visitor crashes, and the string visitor screws returns garbage.  The
generated list visits never go beyond the list end, but manual visits
could.

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


  Commit: 1f41a645b65530859bf5984aa08e103bb452b473
      
https://github.com/qemu/qemu/commit/1f41a645b65530859bf5984aa08e103bb452b473
  Author: Markus Armbruster <address@hidden>
  Date:   2017-03-05 (Sun, 05 Mar 2017)

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

  Log Message:
  -----------
  qapi: Fix object input visit beyond end of list

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


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

  Changed paths:
    M include/qapi/qobject-input-visitor.h
    M include/qapi/qobject-output-visitor.h

  Log Message:
  -----------
  qapi: Improve qobject visitor documentation

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


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

  Changed paths:
    M MAINTAINERS
    M block/nbd.c
    M block/nfs.c
    M block/ssh.c
    M docs/qapi-code-gen.txt
    M hw/ppc/spapr_drc.c
    M include/monitor/monitor.h
    M include/qapi/qmp/dispatch.h
    M include/qapi/qmp/qerror.h
    M include/qapi/qobject-input-visitor.h
    M include/qapi/qobject-output-visitor.h
    M include/qapi/visitor-impl.h
    M include/qapi/visitor.h
    M include/qemu/module.h
    M monitor.c
    M qapi/opts-visitor.c
    M qapi/qapi-visit-core.c
    M qapi/qmp-dispatch.c
    M qapi/qmp-registry.c
    M qapi/qobject-input-visitor.c
    M qapi/string-input-visitor.c
    M qapi/trace-events
    M qga/commands.c
    M qga/guest-agent-core.h
    M qga/main.c
    M qmp.c
    M qom/qom-qobject.c
    M scripts/qapi-commands.py
    M scripts/qapi-introspect.py
    M scripts/qapi-visit.py
    M target/s390x/cpu_models.c
    M tests/Makefile.include
    M tests/check-qnull.c
    M tests/libqtest.c
    M tests/libqtest.h
    A tests/qmp-test.c
    M tests/test-opts-visitor.c
    M tests/test-qga.c
    M tests/test-qmp-commands.c
    R tests/test-qobject-input-strict.c
    M tests/test-qobject-input-visitor.c
    M tests/test-string-input-visitor.c
    M tests/test-visitor-serialization.c
    M trace-events
    M vl.c

  Log Message:
  -----------
  Merge remote-tracking branch 'remotes/armbru/tags/pull-qapi-2017-02-28' into 
staging

QAPI patches for 2017-02-28

# gpg: Signature made Sun 05 Mar 2017 08:21:51 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-02-28: (27 commits)
  qapi: Improve qobject visitor documentation
  qapi: Fix object input visit beyond end of list
  tests: Cover input visit beyond end of list
  qapi: Make input visitors detect unvisited list tails
  test-qobject-input-visitor: Cover missing nested struct member
  tests: Cover partial input visit of list
  test-string-input-visitor: Improve list coverage
  test-string-input-visitor: Tear down existing test automatically
  tests-qobject-input-strict: Merge into test-qobject-input-visitor
  qapi: Drop unused non-strict qobject input visitor
  test-qobject-input-visitor: Use strict visitor
  qom: Make object_property_set_qobject()'s input visitor strict
  qapi: Make string input and opts visitor require non-null input
  qapi: Drop string input visitor method optional()
  qapi: Improve qobject input visitor error reporting
  qapi: Make QObject input visitor set *list reliably
  qapi: Clean up after commit 3d344c2
  qapi: Improve a QObject input visitor error message
  qmp: Eliminate silly QERR_QMP_* macros
  qmp: Drop duplicated QMP command object checks
  ...

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


Compare: https://github.com/qemu/qemu/compare/17783ac828ad...fbddc2e5608e

reply via email to

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