qemu-commits
[Top][All Lists]
Advanced

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

[Qemu-commits] [qemu/qemu] 65207c: monitor: Drop broken, unused asynchro


From: GitHub
Subject: [Qemu-commits] [qemu/qemu] 65207c: monitor: Drop broken, unused asynchronous command ...
Date: Thu, 04 Jun 2015 02:30:06 -0700

  Branch: refs/heads/master
  Home:   https://github.com/qemu/qemu
  Commit: 65207c59d99f2260c5f1d3b9c491146616a522aa
      
https://github.com/qemu/qemu/commit/65207c59d99f2260c5f1d3b9c491146616a522aa
  Author: Markus Armbruster <address@hidden>
  Date:   2015-06-02 (Tue, 02 Jun 2015)

  Changed paths:
    M include/monitor/monitor.h
    M monitor.c

  Log Message:
  -----------
  monitor: Drop broken, unused asynchronous command interface

The asynchronous monitor command interface goes back to commit 940cc30
(Jan 2010).  Added a third case to command execution.  The hope back
then according to the commit message was that all commands get
converted to the asynchronous interface, killing off the other two
cases.  Didn't happen.

The initial asynchronous commands balloon and info balloon were
converted back to synchronous long ago (commit 96637bc and d72f32),
with commit messages calling the asynchronous interface "not fully
working" and "deprecated".  The only other user went away in commit
3b5704b.

New code generally uses synchronous commands and asynchronous events.

What exactly is still "not fully working" with asynchronous commands?
Well, here's a bug that defeats actual asynchronous use pretty
reliably: the reply's ID is wrong (and has always been wrong) unless
you use the command synchronously!  To reproduce, we need an
asynchronous command, so we have to go back before commit 3b5704b.
Run QEMU with spice:

    $ qemu-system-x86_64 -nodefaults -S -spice port=5900,disable-ticketing -qmp 
stdio
    {"QMP": {"version": {"qemu": {"micro": 94, "minor": 2, "major": 2}, 
"package": ""}, "capabilities": []}}

Connect a spice client in another terminal:

    $ remote-viewer spice://localhost:5900

Set up a migration destination dummy in a third terminal:

    $ socat TCP-LISTEN:12345 STDIO

Now paste the following into the QMP monitor:

    { "execute": "qmp_capabilities", "id": "i0" }
    { "execute": "client_migrate_info", "id": "i1", "arguments": { "protocol": 
"spice", "hostname": "localhost", "port": 12345 } }
    { "execute": "query-kvm", "id": "i2" }

Produces two replies immediately, one to qmp_capabilities, and one to
query-kvm:

    {"return": {}, "id": "i0"}
    {"return": {"enabled": false, "present": true}, "id": "i2"}

Both are correct.  Two lines of debug output from libspice-server not
shown.

Now EOF socat's standard input to make it close the connection.  This
makes the asynchronous client_migrate_info complete.  It replies:

    {"return": {}}

Bug: "id": "i1" is missing.  Two lines of debug output from
libspice-server not shown.  Cherry on top: storage for the missing ID
is leaked.

Get rid of this stuff before somebody hurts himself with it.

Signed-off-by: Markus Armbruster <address@hidden>
Reviewed-by: Eric Blake <address@hidden>
Reviewed-by: Luiz Capitulino <address@hidden>


  Commit: 84add864ebd2e6f3c645948ab595d8454165ebc5
      
https://github.com/qemu/qemu/commit/84add864ebd2e6f3c645948ab595d8454165ebc5
  Author: Markus Armbruster <address@hidden>
  Date:   2015-06-02 (Tue, 02 Jun 2015)

  Changed paths:
    M monitor.c

  Log Message:
  -----------
  monitor: Clean up after previous commit

Inline qmp_call_cmd() along with its helper handler_audit() into its
only caller handle_qmp_command(), and simplify the result.

Signed-off-by: Markus Armbruster <address@hidden>
Reviewed-by: Eric Blake <address@hidden>
Reviewed-by: Luiz Capitulino <address@hidden>


  Commit: 13cadefbda71e119db79fe0b7a4efd26a6d005bd
      
https://github.com/qemu/qemu/commit/13cadefbda71e119db79fe0b7a4efd26a6d005bd
  Author: Markus Armbruster <address@hidden>
  Date:   2015-06-02 (Tue, 02 Jun 2015)

  Changed paths:
    M hmp-commands.hx
    M monitor.c
    M qmp-commands.hx

  Log Message:
  -----------
  monitor: Improve and document client_migrate_info protocol error

Protocol must be spice, vnc isn't implemented.  Fix up documentation.

Attempts to use vnc or any other unknown protocol yield the misleading
error message "Invalid parameter 'protocol'".  Improve it to
"Parameter 'protocol' expects spice".

Cc: Gerd Hoffmann <address@hidden>
Signed-off-by: Markus Armbruster <address@hidden>
Reviewed-by: Eric Blake <address@hidden>
Reviewed-by. Gerd Hoffmann <address@hidden>
Reviewed-by: Luiz Capitulino <address@hidden>


  Commit: b8a185bc9a8ecbdc74fd64672e4abdd09a558e1c
      
https://github.com/qemu/qemu/commit/b8a185bc9a8ecbdc74fd64672e4abdd09a558e1c
  Author: Markus Armbruster <address@hidden>
  Date:   2015-06-02 (Tue, 02 Jun 2015)

  Changed paths:
    M hmp-commands.hx
    M hmp.c
    M hmp.h
    M monitor.c
    M qapi-schema.json
    M qmp-commands.hx

  Log Message:
  -----------
  monitor: Convert client_migrate_info to QAPI

Signed-off-by: Markus Armbruster <address@hidden>
Reviewed-by: Eric Blake <address@hidden>
Reviewed-by: Luiz Capitulino <address@hidden>


  Commit: 072ebe6b0351060b33287454fdef625fe79c858f
      
https://github.com/qemu/qemu/commit/072ebe6b0351060b33287454fdef625fe79c858f
  Author: Markus Armbruster <address@hidden>
  Date:   2015-06-02 (Tue, 02 Jun 2015)

  Changed paths:
    M blockdev.c
    M hmp-commands.hx
    M include/sysemu/blockdev.h

  Log Message:
  -----------
  monitor: Use traditional command interface for HMP drive_del

All QMP commands use the "new" handler interface (mhandler.cmd_new).
Most HMP commands still use the traditional interface (mhandler.cmd),
but a few use the "new" one.  Complicates handle_user_command() for no
gain, so I'm converting these to the traditional interface.

For drive_del, that's easy: hmp_drive_del() sheds its unused last
parameter, and its return value, which the caller ignored anyway.

Signed-off-by: Markus Armbruster <address@hidden>
Reviewed-by: Eric Blake <address@hidden>
Reviewed-by: Luiz Capitulino <address@hidden>


  Commit: 318660f84a0a26451750aee68ab7dcf88731637d
      
https://github.com/qemu/qemu/commit/318660f84a0a26451750aee68ab7dcf88731637d
  Author: Markus Armbruster <address@hidden>
  Date:   2015-06-02 (Tue, 02 Jun 2015)

  Changed paths:
    M hmp-commands.hx
    M hmp.c
    M hmp.h
    M monitor.c

  Log Message:
  -----------
  monitor: Use traditional command interface for HMP device_add

All QMP commands use the "new" handler interface (mhandler.cmd_new).
Most HMP commands still use the traditional interface (mhandler.cmd),
but a few use the "new" one.  Complicates handle_user_command() for no
gain, so I'm converting these to the traditional interface.

For device_add, that's easy: just wrap the obvious hmp_device_add()
around do_device_add().

monitor_user_noop() is now unused, drop it.

Signed-off-by: Markus Armbruster <address@hidden>
Reviewed-by: Eric Blake <address@hidden>
Reviewed-by: Luiz Capitulino <address@hidden>


  Commit: 04e00c92ef75629a241ebc50537f75de0867928d
      
https://github.com/qemu/qemu/commit/04e00c92ef75629a241ebc50537f75de0867928d
  Author: Markus Armbruster <address@hidden>
  Date:   2015-06-02 (Tue, 02 Jun 2015)

  Changed paths:
    M hmp-commands.hx
    M hw/pci/pci-stub.c
    M hw/pci/pcie_aer.c
    M include/sysemu/sysemu.h

  Log Message:
  -----------
  monitor: Use trad. command interface for HMP pcie_aer_inject_error

All QMP commands use the "new" handler interface (mhandler.cmd_new).
Most HMP commands still use the traditional interface (mhandler.cmd),
but a few use the "new" one.  Complicates handle_user_command() for no
gain, so I'm converting these to the traditional interface.

pcie_aer_inject_error's implementation is split into the
hmp_pcie_aer_inject_error() and pcie_aer_inject_error_print().  The
former is a peculiar crossbreed between HMP and QMP handler.  On
success, it works like a QMP handler: store QDict through ret_data
parameter, return 0.  Printing the QDict is left to
pcie_aer_inject_error_print().  On failure, it works more like an HMP
handler: print error to monitor, return negative number.

To convert to the traditional interface, turn
pcie_aer_inject_error_print() into a command handler wrapping around
hmp_pcie_aer_inject_error().  By convention, this command handler
should be called hmp_pcie_aer_inject_error(), so rename the existing
hmp_pcie_aer_inject_error() to do_pcie_aer_inject_error().

Signed-off-by: Markus Armbruster <address@hidden>
Reviewed-by: Eric Blake <address@hidden>
Reviewed-by: Luiz Capitulino <address@hidden>


  Commit: 8a4f501c09bcb8b5a220699e378aa8fb7ec178e4
      
https://github.com/qemu/qemu/commit/8a4f501c09bcb8b5a220699e378aa8fb7ec178e4
  Author: Markus Armbruster <address@hidden>
  Date:   2015-06-02 (Tue, 02 Jun 2015)

  Changed paths:
    M monitor.c

  Log Message:
  -----------
  monitor: Drop unused "new" HMP command interface

Signed-off-by: Markus Armbruster <address@hidden>
Reviewed-by: Eric Blake <address@hidden>
Reviewed-by: Luiz Capitulino <address@hidden>


  Commit: 326283aa5d4d51d576185af4cbbdc29f648cd766
      
https://github.com/qemu/qemu/commit/326283aa5d4d51d576185af4cbbdc29f648cd766
  Author: Markus Armbruster <address@hidden>
  Date:   2015-06-02 (Tue, 02 Jun 2015)

  Changed paths:
    M monitor.c

  Log Message:
  -----------
  monitor: Propagate errors through qmp_check_client_args()

Signed-off-by: Markus Armbruster <address@hidden>
Reviewed-by: Eric Blake <address@hidden>
Reviewed-by: Luiz Capitulino <address@hidden>


  Commit: ba0510aad43148e5284cb52fcc7a0103b5e0af4d
      
https://github.com/qemu/qemu/commit/ba0510aad43148e5284cb52fcc7a0103b5e0af4d
  Author: Markus Armbruster <address@hidden>
  Date:   2015-06-02 (Tue, 02 Jun 2015)

  Changed paths:
    M monitor.c

  Log Message:
  -----------
  monitor: Propagate errors through qmp_check_input_obj()

Signed-off-by: Markus Armbruster <address@hidden>
Reviewed-by: Eric Blake <address@hidden>
Reviewed-by: Luiz Capitulino <address@hidden>


  Commit: 4086182fcd9b106345b5cc535d78bcc6d13a7683
      
https://github.com/qemu/qemu/commit/4086182fcd9b106345b5cc535d78bcc6d13a7683
  Author: Markus Armbruster <address@hidden>
  Date:   2015-06-02 (Tue, 02 Jun 2015)

  Changed paths:
    M monitor.c

  Log Message:
  -----------
  monitor: Propagate errors through invalid_qmp_mode()

Signed-off-by: Markus Armbruster <address@hidden>
Reviewed-by: Luiz Capitulino <address@hidden>


  Commit: 70ea0c58991ae44b5a1e67d9c189d79029168cb1
      
https://github.com/qemu/qemu/commit/70ea0c58991ae44b5a1e67d9c189d79029168cb1
  Author: Markus Armbruster <address@hidden>
  Date:   2015-06-02 (Tue, 02 Jun 2015)

  Changed paths:
    M monitor.c

  Log Message:
  -----------
  monitor: Wean monitor_protocol_emitter() off mon->error

Move mon->error handling to its caller handle_qmp_command().

Signed-off-by: Markus Armbruster <address@hidden>
Reviewed-by: Eric Blake <address@hidden>
Reviewed-by: Luiz Capitulino <address@hidden>


  Commit: 452e0300a3521f13b6c4ba0b99a8cea3a29209f1
      
https://github.com/qemu/qemu/commit/452e0300a3521f13b6c4ba0b99a8cea3a29209f1
  Author: Markus Armbruster <address@hidden>
  Date:   2015-06-02 (Tue, 02 Jun 2015)

  Changed paths:
    M monitor.c

  Log Message:
  -----------
  monitor: Inline monitor_has_error() into its only caller

Signed-off-by: Markus Armbruster <address@hidden>
Reviewed-by: Eric Blake <address@hidden>
Reviewed-by: Luiz Capitulino <address@hidden>


  Commit: 710aec915d208246891b68e2ba61b54951edc508
      
https://github.com/qemu/qemu/commit/710aec915d208246891b68e2ba61b54951edc508
  Author: Markus Armbruster <address@hidden>
  Date:   2015-06-02 (Tue, 02 Jun 2015)

  Changed paths:
    M monitor.c

  Log Message:
  -----------
  monitor: Limit QError use to command handlers

The previous commits narrowed use of QError to handle_qmp_command()
and its helpers monitor_protocol_emitter(), build_qmp_error_dict().
Narrow it further to just the command handler call: instead of
converting Error to QError throughout handle_qmp_command(), convert
the QError gotten from the command handler to Error, and switch the
helpers from QError to Error.

Signed-off-by: Markus Armbruster <address@hidden>
Reviewed-by: Eric Blake <address@hidden>
Reviewed-by: Luiz Capitulino <address@hidden>


  Commit: 7ef6cf6341c453021939c909adf2d62d9dc25fd5
      
https://github.com/qemu/qemu/commit/7ef6cf6341c453021939c909adf2d62d9dc25fd5
  Author: Markus Armbruster <address@hidden>
  Date:   2015-06-02 (Tue, 02 Jun 2015)

  Changed paths:
    M monitor.c

  Log Message:
  -----------
  monitor: Rename handle_user_command() to handle_hmp_command()

Signed-off-by: Markus Armbruster <address@hidden>
Reviewed-by: Eric Blake <address@hidden>
Reviewed-by: Luiz Capitulino <address@hidden>


  Commit: c83fe23b58199a6d4a938305cb0fc45fe7729b61
      
https://github.com/qemu/qemu/commit/c83fe23b58199a6d4a938305cb0fc45fe7729b61
  Author: Markus Armbruster <address@hidden>
  Date:   2015-06-02 (Tue, 02 Jun 2015)

  Changed paths:
    M monitor.c

  Log Message:
  -----------
  monitor: Rename monitor_control_read(), monitor_control_event()

... to monitor_qmp_read(), monitor_qmp_event().

Signed-off-by: Markus Armbruster <address@hidden>
Reviewed-by: Eric Blake <address@hidden>
Reviewed-by: Luiz Capitulino <address@hidden>


  Commit: 74358f2a1647b239d87340ea0024f9d2efa266ca
      
https://github.com/qemu/qemu/commit/74358f2a1647b239d87340ea0024f9d2efa266ca
  Author: Markus Armbruster <address@hidden>
  Date:   2015-06-02 (Tue, 02 Jun 2015)

  Changed paths:
    M monitor.c

  Log Message:
  -----------
  monitor: Unbox Monitor member mc and rename to qmp

While there, rename its type as well, from MonitorControl to
MonitorQMP.

Signed-off-by: Markus Armbruster <address@hidden>
Reviewed-by: Eric Blake <address@hidden>
Reviewed-by: Luiz Capitulino <address@hidden>


  Commit: 6a50636f35ba677c747f2f6127b0dba994b039ca
      
https://github.com/qemu/qemu/commit/6a50636f35ba677c747f2f6127b0dba994b039ca
  Author: Markus Armbruster <address@hidden>
  Date:   2015-06-02 (Tue, 02 Jun 2015)

  Changed paths:
    M monitor.c

  Log Message:
  -----------
  monitor: Drop do_qmp_capabilities()'s superfluous QMP check

Superfluous since commit 30f5041 removed it from HMP.

Signed-off-by: Markus Armbruster <address@hidden>
Reviewed-by: Eric Blake <address@hidden>
Reviewed-by: Luiz Capitulino <address@hidden>


  Commit: f994b2587f081693b017ebd03b362d162d3108b3
      
https://github.com/qemu/qemu/commit/f994b2587f081693b017ebd03b362d162d3108b3
  Author: Markus Armbruster <address@hidden>
  Date:   2015-06-02 (Tue, 02 Jun 2015)

  Changed paths:
    M monitor.c

  Log Message:
  -----------
  monitor: Turn int command_mode into bool in_command_mode

While there, inline the pointless qmp_cmd_mode() wrapper.

Signed-off-by: Markus Armbruster <address@hidden>
Reviewed-by: Eric Blake <address@hidden>
Reviewed-by: Luiz Capitulino <address@hidden>


  Commit: 9f3982f2dcd96753d57d0ac64bd1ae3b37a90eb3
      
https://github.com/qemu/qemu/commit/9f3982f2dcd96753d57d0ac64bd1ae3b37a90eb3
  Author: Markus Armbruster <address@hidden>
  Date:   2015-06-02 (Tue, 02 Jun 2015)

  Changed paths:
    M monitor.c

  Log Message:
  -----------
  monitor: Rename monitor_ctrl_mode() to monitor_is_qmp()

... and change return type to bool.

Signed-off-by: Markus Armbruster <address@hidden>
Reviewed-by: Eric Blake <address@hidden>
Reviewed-by: Luiz Capitulino <address@hidden>


  Commit: 489653b5db17679fd61b740dd289c798bb25d7b9
      
https://github.com/qemu/qemu/commit/489653b5db17679fd61b740dd289c798bb25d7b9
  Author: Markus Armbruster <address@hidden>
  Date:   2015-06-02 (Tue, 02 Jun 2015)

  Changed paths:
    M include/monitor/monitor.h
    M monitor.c
    M stubs/mon-is-qmp.c

  Log Message:
  -----------
  monitor: Change return type of monitor_cur_is_qmp() to bool

Signed-off-by: Markus Armbruster <address@hidden>
Reviewed-by: Eric Blake <address@hidden>
Reviewed-by: Luiz Capitulino <address@hidden>


  Commit: a67bfbb9e41e089caec61384c625e8a61a5f270f
      
https://github.com/qemu/qemu/commit/a67bfbb9e41e089caec61384c625e8a61a5f270f
  Author: Peter Maydell <address@hidden>
  Date:   2015-06-02 (Tue, 02 Jun 2015)

  Changed paths:
    M blockdev.c
    M hmp-commands.hx
    M hmp.c
    M hmp.h
    M hw/pci/pci-stub.c
    M hw/pci/pcie_aer.c
    M include/monitor/monitor.h
    M include/sysemu/blockdev.h
    M include/sysemu/sysemu.h
    M monitor.c
    M qapi-schema.json
    M qmp-commands.hx
    M stubs/mon-is-qmp.c

  Log Message:
  -----------
  Merge remote-tracking branch 'remotes/armbru/tags/pull-monitor-2015-06-02' 
into staging

Monitor patches

# gpg: Signature made Tue Jun  2 09:16:07 2015 BST using RSA key ID EB918653
# gpg: Good signature from "Markus Armbruster <address@hidden>"
# gpg:                 aka "Markus Armbruster <address@hidden>"

* remotes/armbru/tags/pull-monitor-2015-06-02: (21 commits)
  monitor: Change return type of monitor_cur_is_qmp() to bool
  monitor: Rename monitor_ctrl_mode() to monitor_is_qmp()
  monitor: Turn int command_mode into bool in_command_mode
  monitor: Drop do_qmp_capabilities()'s superfluous QMP check
  monitor: Unbox Monitor member mc and rename to qmp
  monitor: Rename monitor_control_read(), monitor_control_event()
  monitor: Rename handle_user_command() to handle_hmp_command()
  monitor: Limit QError use to command handlers
  monitor: Inline monitor_has_error() into its only caller
  monitor: Wean monitor_protocol_emitter() off mon->error
  monitor: Propagate errors through invalid_qmp_mode()
  monitor: Propagate errors through qmp_check_input_obj()
  monitor: Propagate errors through qmp_check_client_args()
  monitor: Drop unused "new" HMP command interface
  monitor: Use trad. command interface for HMP pcie_aer_inject_error
  monitor: Use traditional command interface for HMP device_add
  monitor: Use traditional command interface for HMP drive_del
  monitor: Convert client_migrate_info to QAPI
  monitor: Improve and document client_migrate_info protocol error
  monitor: Clean up after previous commit
  ...

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


Compare: https://github.com/qemu/qemu/compare/42d58e7c6760...a67bfbb9e41e

reply via email to

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