qemu-commits
[Top][All Lists]
Advanced

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

[Qemu-commits] [qemu/qemu] e64c75: qmp: fix object-add assert() without


From: GitHub
Subject: [Qemu-commits] [qemu/qemu] e64c75: qmp: fix object-add assert() without props
Date: Mon, 10 Oct 2016 05:00:03 -0700

  Branch: refs/heads/master
  Home:   https://github.com/qemu/qemu
  Commit: e64c75a9752c5d0fd64eb2e684c656a5ea7d03c6
      
https://github.com/qemu/qemu/commit/e64c75a9752c5d0fd64eb2e684c656a5ea7d03c6
  Author: Marc-André Lureau <address@hidden>
  Date:   2016-10-06 (Thu, 06 Oct 2016)

  Changed paths:
    M qmp.c

  Log Message:
  -----------
  qmp: fix object-add assert() without props

Since commit ad739706bbadee49, user_creatable_add_type() expects to be
given a qdict. However, if object-add is called without props, you reach
the assert: "qemu/qom/object_interfaces.c:115: user_creatable_add_type:
Assertion `qdict' failed.", because the qdict isn't created in this
case (it's optional).

Furthermore, qmp_input_visitor_new() is not meant to be called without a
dict, and a further commit will assert in this situation.

If none given, create an empty qdict in qmp to avoid the
user_creatable_add_type() assert(qdict).

Signed-off-by: Marc-André Lureau <address@hidden>
Reviewed-by: Eric Blake <address@hidden>
Message-Id: <address@hidden>
Tested-by: Xiao Long Jiang <address@hidden>
Reviewed-by: Markus Armbruster <address@hidden>
Signed-off-by: Markus Armbruster <address@hidden>


  Commit: c489780203f9b22aca5539ec7589b7140bdc951f
      
https://github.com/qemu/qemu/commit/c489780203f9b22aca5539ec7589b7140bdc951f
  Author: Marc-André Lureau <address@hidden>
  Date:   2016-10-06 (Thu, 06 Oct 2016)

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

  Log Message:
  -----------
  qapi: Fix crash when 'any' or 'null' parameter is missing

Unlike the other visit methods, visit_type_any() and visit_type_null()
neglect to check whether qmp_input_get_object() succeeded.  They crash
when it fails.  Reproducer:

{ "execute": "qom-set",
  "arguments": { "path": "/machine", "property": "rtc-time" } }

Will crash with:

qapi/qapi-visit-core.c:277: visit_type_any: Assertion `!err != !*obj'
failed

Broken in commit 5c678ee.  Fix by adding the missing error checks.

Signed-off-by: Marc-André Lureau <address@hidden>
Reviewed-by: Eric Blake <address@hidden>
Message-Id: <address@hidden>
Reviewed-by: Markus Armbruster <address@hidden>
[Commit message rephrased]
Signed-off-by: Markus Armbruster <address@hidden>


  Commit: bce3035a44c40bd3ec29d3162025fd350f2d8dbf
      
https://github.com/qemu/qemu/commit/bce3035a44c40bd3ec29d3162025fd350f2d8dbf
  Author: Markus Armbruster <address@hidden>
  Date:   2016-10-06 (Thu, 06 Oct 2016)

  Changed paths:
    M tests/test-qmp-input-strict.c

  Log Message:
  -----------
  tests/test-qmp-input-strict: Cover missing struct members

These tests would have caught the bug fixed by the previous commit.

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


  Commit: 5d0cbbcfeb59e1e3f5ee7d26b8a215382f6d9abd
      
https://github.com/qemu/qemu/commit/5d0cbbcfeb59e1e3f5ee7d26b8a215382f6d9abd
  Author: Marc-André Lureau <address@hidden>
  Date:   2016-10-07 (Fri, 07 Oct 2016)

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

  Log Message:
  -----------
  qapi: add assert about root value

qiv->root should not be null, make that clearer with some assert.

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


  Commit: eac8e79ff749fc15e1dca4caccf1f38664ab4915
      
https://github.com/qemu/qemu/commit/eac8e79ff749fc15e1dca4caccf1f38664ab4915
  Author: Marc-André Lureau <address@hidden>
  Date:   2016-10-07 (Fri, 07 Oct 2016)

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

  Log Message:
  -----------
  qapi: assert list entry has a value

This helps to figure out the expectations.

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


  Commit: 1382d4abdf9619985e4078e37e49e487cea9935e
      
https://github.com/qemu/qemu/commit/1382d4abdf9619985e4078e37e49e487cea9935e
  Author: Marc-André Lureau <address@hidden>
  Date:   2016-10-07 (Fri, 07 Oct 2016)

  Changed paths:
    M qapi/qmp-input-visitor.c
    M tests/qemu-iotests/087.out

  Log Message:
  -----------
  qapi: return a 'missing parameter' error

The 'old' dispatch code returned a QERR_MISSING_PARAMETER for missing
parameters, but the qapi qmp_dispatch() code uses
QERR_INVALID_PARAMETER_TYPE.

Improve qapi code to return QERR_MISSING_PARAMETER where
appropriate.

Fix expected error message in iotests.

Signed-off-by: Marc-André Lureau <address@hidden>
Reviewed-by: Alberto Garcia <address@hidden>
Reviewed-by: Eric Blake <address@hidden>
Message-Id: <address@hidden>
[Drop incorrect error_setg() from qmp_input_type_any() and
qmp_input_type_null()]
Reviewed-by: Markus Armbruster <address@hidden>
Signed-off-by: Markus Armbruster <address@hidden>


  Commit: c833fb4aeb01c124093a7569c0c333f80967d337
      
https://github.com/qemu/qemu/commit/c833fb4aeb01c124093a7569c0c333f80967d337
  Author: Markus Armbruster <address@hidden>
  Date:   2016-10-07 (Fri, 07 Oct 2016)

  Changed paths:
    M MAINTAINERS

  Log Message:
  -----------
  MAINTAINERS: Pass the HMP staff from Luiz to David

David graciously volunteered to take this off Luiz's hands.

Signed-off-by: Markus Armbruster <address@hidden>
Message-Id: <address@hidden>
Reviewed-by: Dr. David Alan Gilbert <address@hidden>
Acked-by: Luiz Capitulino <address@hidden>


  Commit: daf5dc7806f7bbb825506054a7c00a90b841b7cc
      
https://github.com/qemu/qemu/commit/daf5dc7806f7bbb825506054a7c00a90b841b7cc
  Author: Markus Armbruster <address@hidden>
  Date:   2016-10-07 (Fri, 07 Oct 2016)

  Changed paths:
    M MAINTAINERS

  Log Message:
  -----------
  MAINTAINERS: Pass the QObject staff from Luiz to Markus

QObject is fairly tightly coupled to QAPI these days, and I've been
effectively maintaining it together with QAPI for a while.  Update
MAINTAINERS to reflect that.

Signed-off-by: Markus Armbruster <address@hidden>
Message-Id: <address@hidden>
Acked-by: Luiz Capitulino <address@hidden>


  Commit: 728b1429b16ebcc09ca7936d8689db9e006acbef
      
https://github.com/qemu/qemu/commit/728b1429b16ebcc09ca7936d8689db9e006acbef
  Author: Eduardo Habkost <address@hidden>
  Date:   2016-10-07 (Fri, 07 Oct 2016)

  Changed paths:
    M monitor.c

  Log Message:
  -----------
  qmp: Disable query-cpu-* commands when they're unavailable

Instead of requiring clients to actually call the query-cpu-*
commands to find out if they are implemented, remove them from
the output of "query-commands", so clients know they are not
available.

This is implemented by extending the existing hack at
qmp_unregister_commands_hack(). I wish I could avoid adding even
more #ifdefs to that code, but that's the solution we have today.

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


  Commit: fd11080b9ffa50c713137d0c2bc21d87af9074a9
      
https://github.com/qemu/qemu/commit/fd11080b9ffa50c713137d0c2bc21d87af9074a9
  Author: Markus Armbruster <address@hidden>
  Date:   2016-10-07 (Fri, 07 Oct 2016)

  Changed paths:
    M docs/xen-save-devices-state.txt

  Log Message:
  -----------
  docs: Belatedly update for move of qmp-commands.txt

Missed in commit d076a2a and commit bd6092e.

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


  Commit: 77a6da267c37781331c2dc8c4ac7f68d46a2a461
      
https://github.com/qemu/qemu/commit/77a6da267c37781331c2dc8c4ac7f68d46a2a461
  Author: Markus Armbruster <address@hidden>
  Date:   2016-10-07 (Fri, 07 Oct 2016)

  Changed paths:
    M docs/qmp-commands.txt
    M docs/writing-qmp-commands.txt

  Log Message:
  -----------
  docs: Belatedly update for move of QMP/* to docs/

Missed in commit 7537fe0 and commit 9b89b6a.

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


  Commit: 0cb0155711ccfdb7c0ebc0e58af071850e7e2f1f
      
https://github.com/qemu/qemu/commit/0cb0155711ccfdb7c0ebc0e58af071850e7e2f1f
  Author: Peter Maydell <address@hidden>
  Date:   2016-10-10 (Mon, 10 Oct 2016)

  Changed paths:
    M MAINTAINERS
    M docs/qmp-commands.txt
    M docs/writing-qmp-commands.txt
    M docs/xen-save-devices-state.txt
    M monitor.c
    M qapi/qmp-input-visitor.c
    M qmp.c
    M tests/qemu-iotests/087.out
    M tests/test-qmp-input-strict.c

  Log Message:
  -----------
  Merge remote-tracking branch 'remotes/armbru/tags/pull-qapi-2016-10-07' into 
staging

QAPI patches for 2016-10-07

# gpg: Signature made Fri 07 Oct 2016 18:55:40 BST
# 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-2016-10-07:
  docs: Belatedly update for move of QMP/* to docs/
  docs: Belatedly update for move of qmp-commands.txt
  qmp: Disable query-cpu-* commands when they're unavailable
  MAINTAINERS: Pass the QObject staff from Luiz to Markus
  MAINTAINERS: Pass the HMP staff from Luiz to David
  qapi: return a 'missing parameter' error
  qapi: assert list entry has a value
  qapi: add assert about root value
  tests/test-qmp-input-strict: Cover missing struct members
  qapi: Fix crash when 'any' or 'null' parameter is missing
  qmp: fix object-add assert() without props

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


Compare: https://github.com/qemu/qemu/compare/86e121ae75d1...0cb0155711cc

reply via email to

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