qemu-commits
[Top][All Lists]
Advanced

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

[Qemu-commits] [qemu/qemu] 854f63: monitor: Fix return type of monitor_f


From: Peter Maydell
Subject: [Qemu-commits] [qemu/qemu] 854f63: monitor: Fix return type of monitor_fdset_dup_fd_find
Date: Tue, 18 Jun 2019 03:53:14 -0700

  Branch: refs/heads/master
  Home:   https://github.com/qemu/qemu
  Commit: 854f63d44065567c2991b5050f7d4011ca985c4e
      
https://github.com/qemu/qemu/commit/854f63d44065567c2991b5050f7d4011ca985c4e
  Author: Yury Kotov <address@hidden>
  Date:   2019-06-17 (Mon, 17 Jun 2019)

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

  Log Message:
  -----------
  monitor: Fix return type of monitor_fdset_dup_fd_find

monitor_fdset_dup_fd_find_remove() and monitor_fdset_dup_fd_find()
return mon_fdset->id which is int64_t. Downcasting from int64_t to int
leads to a bug with removing fd from fdset with id >= 2^32.
So, fix return types for these function.

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


  Commit: be7633c33ee67090489ed6132a37b1972cf55f8a
      
https://github.com/qemu/qemu/commit/be7633c33ee67090489ed6132a37b1972cf55f8a
  Author: Kevin Wolf <address@hidden>
  Date:   2019-06-17 (Mon, 17 Jun 2019)

  Changed paths:
    M monitor.c

  Log Message:
  -----------
  monitor: Remove unused password prompting fields

Commit 788cf9f8c removed the code for password prompting from the
monitor. Since then, the Monitor fields password_completion_cb and
password_opaque have been unused. Remove them.

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


  Commit: b6c7c2e4a332a921f9172cf1857438ea6706ff41
      
https://github.com/qemu/qemu/commit/b6c7c2e4a332a921f9172cf1857438ea6706ff41
  Author: Kevin Wolf <address@hidden>
  Date:   2019-06-17 (Mon, 17 Jun 2019)

  Changed paths:
    M monitor.c

  Log Message:
  -----------
  monitor: Split monitor_init in HMP and QMP function

Instead of mixing HMP and QMP monitors in the same function, separate
the monitor creation function for both.

While in theory, one could pass both MONITOR_USE_CONTROL and
MONITOR_USE_READLINE before this patch and both flags would do
something, readline support is tightly coupled with HMP: QMP never feeds
its input to readline, and the tab completion function treats the input
as an HMP command. Therefore, this configuration is useless.

After this patch, the QMP path asserts that MONITOR_USE_READLINE is not
set. The HMP path can be used with or without MONITOR_USE_READLINE, like
before.

Signed-off-by: Kevin Wolf <address@hidden>
Reviewed-by: Dr. David Alan Gilbert <address@hidden>
Reviewed-by: Markus Armbruster <address@hidden>
Message-Id: <address@hidden>
[Zero initialization of Monitor moved from monitor_data_init() to
callers]
Signed-off-by: Markus Armbruster <address@hidden>


  Commit: b8e31d6ccc40de09392766fc8a77133196ba8468
      
https://github.com/qemu/qemu/commit/b8e31d6ccc40de09392766fc8a77133196ba8468
  Author: Kevin Wolf <address@hidden>
  Date:   2019-06-17 (Mon, 17 Jun 2019)

  Changed paths:
    M monitor.c

  Log Message:
  -----------
  monitor: Make MonitorQMP a child class of Monitor

Currently, struct Monitor mixes state that is only relevant for HMP,
state that is only relevant for QMP, and some actually shared state.
In particular, a MonitorQMP field is present in the state of any
monitor, even if it's not a QMP monitor and therefore doesn't use the
state.

As a first step towards a clean separation between QMP and HMP, let
MonitorQMP extend Monitor and create a MonitorQMP object only when the
monitor is actually a QMP monitor.

Some places accessed Monitor.qmp unconditionally, even for HMP monitors.
They can't keep doing this now, so during the conversion, they are
either changed to become conditional on monitor_is_qmp() or to assert()
that they always get a QMP monitor.

Signed-off-by: Kevin Wolf <address@hidden>
Reviewed-by: Dr. David Alan Gilbert <address@hidden>
Message-Id: <address@hidden>
Reviewed-by: Markus Armbruster <address@hidden>
[Superfluous variable in monitor_data_destroy() eliminated]
Signed-off-by: Markus Armbruster <address@hidden>


  Commit: 5f9dba1600de5e6312ea2d86cff61a5f03c8207e
      
https://github.com/qemu/qemu/commit/5f9dba1600de5e6312ea2d86cff61a5f03c8207e
  Author: Kevin Wolf <address@hidden>
  Date:   2019-06-17 (Mon, 17 Jun 2019)

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

  Log Message:
  -----------
  monitor: Create MonitorHMP with readline state

The ReadLineState in Monitor is only used for HMP monitors. Create
MonitorHMP and move it there.

Can't use container_of() in hmp_change().  Cast instead, and mark
FIXME.  Will be cleaned up shortly.

Signed-off-by: Kevin Wolf <address@hidden>
Reviewed-by: Dr. David Alan Gilbert <address@hidden>
Message-Id: <address@hidden>
Reviewed-by: Markus Armbruster <address@hidden>
[Superfluous variable in monitor_data_destroy() eliminated, whitespace
tweaked in hmp_change(), commit message improved]
Signed-off-by: Markus Armbruster <address@hidden>


  Commit: 18a8887309db8137632ff71b9abb64f31639c8c6
      
https://github.com/qemu/qemu/commit/18a8887309db8137632ff71b9abb64f31639c8c6
  Author: Kevin Wolf <address@hidden>
  Date:   2019-06-17 (Mon, 17 Jun 2019)

  Changed paths:
    M monitor.c

  Log Message:
  -----------
  monitor: Remove Monitor.cmd_table indirection

Monitor.cmd_table is initialised to point to mon_cmds and never changed
afterwards. We can remove the indirection and just reference mon_cmds
directly instead.

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


  Commit: a0cd5e1c8e7fb1dc882483589fd809ca083a2725
      
https://github.com/qemu/qemu/commit/a0cd5e1c8e7fb1dc882483589fd809ca083a2725
  Author: Kevin Wolf <address@hidden>
  Date:   2019-06-17 (Mon, 17 Jun 2019)

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

  Log Message:
  -----------
  monitor: Rename HMP command type and tables

This renames the type for HMP monitor commands and the tables holding
the commands to make clear that they are related to HMP and to allow
making them public later:

* mon_cmd_t -> HMPCommand (fixing use of a reserved name, too)
* mon_cmds -> hmp_cmds
* info_cmds -> hmp_info_cmds

Signed-off-by: Kevin Wolf <address@hidden>
Message-Id: <address@hidden>
Reviewed-by: Markus Armbruster <address@hidden>
[sortcmdlist() cleaned up to make checkpatch.pl happy]
Signed-off-by: Markus Armbruster <address@hidden>


  Commit: e84328faa99ae50fd9ed36a615927e94327cf249
      
https://github.com/qemu/qemu/commit/e84328faa99ae50fd9ed36a615927e94327cf249
  Author: Kevin Wolf <address@hidden>
  Date:   2019-06-17 (Mon, 17 Jun 2019)

  Changed paths:
    M MAINTAINERS
    M Makefile.objs
    M Makefile.target
    M docs/devel/writing-qmp-commands.txt
    R monitor.c
    A monitor/Makefile.objs
    A monitor/misc.c
    A monitor/trace-events
    M trace-events

  Log Message:
  -----------
  Move monitor.c to monitor/misc.c

Create a new monitor/ subdirectory and move monitor.c there. As the plan
is to move the monitor core into separate files, use the chance to
rename it to misc.c.

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


  Commit: f1b3ccfaa682b7b5d0043ab934660a49e33d0139
      
https://github.com/qemu/qemu/commit/f1b3ccfaa682b7b5d0043ab934660a49e33d0139
  Author: Kevin Wolf <address@hidden>
  Date:   2019-06-17 (Mon, 17 Jun 2019)

  Changed paths:
    M MAINTAINERS
    M Makefile.objs
    M docs/devel/writing-qmp-commands.txt
    R hmp.c
    M monitor/Makefile.objs
    A monitor/hmp-cmds.c
    A monitor/qmp-cmds.c
    R qmp.c

  Log Message:
  -----------
  monitor: Move {hmp, qmp}.c to monitor/{hmp, qmp}-cmds.c

Now that we have a monitor/ subdirectory, let's move hmp.c and qmp.c
from the root directory there. As they contain implementations of
monitor commands, rename them to {hmp,qmp}-cmds.c, so that {hmp,qmp}.c
are free for the HMP and QMP infrastructure.

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


  Commit: 5bce308aaaab5b1b1a460b7f13940a132278e34c
      
https://github.com/qemu/qemu/commit/5bce308aaaab5b1b1a460b7f13940a132278e34c
  Author: Kevin Wolf <address@hidden>
  Date:   2019-06-17 (Mon, 17 Jun 2019)

  Changed paths:
    M MAINTAINERS
    M monitor/hmp-cmds.c
    M monitor/misc.c
    A monitor/monitor-internal.h

  Log Message:
  -----------
  monitor: Create monitor-internal.h with common definitions

Before we can split monitor/misc.c, we need to create a header file that
contains the common definitions that will be used by multiple source
files.

For a start, add the type definitions for Monitor, MonitorHMP and
MonitorQMP and their dependencies. We'll add functions as needed when
splitting monitor/misc.c.

Signed-off-by: Kevin Wolf <address@hidden>
Reviewed-by: Dr. David Alan Gilbert <address@hidden>
Message-Id: <address@hidden>
Reviewed-by: Markus Armbruster <address@hidden>
[Header guard symbol tidied up, superfluous #include dropped, FIXME in
hmp_change() resolved]
Signed-off-by: Markus Armbruster <address@hidden>


  Commit: 7e3c0deab1b76f37ac0b3199324db976a6cd1b2c
      
https://github.com/qemu/qemu/commit/7e3c0deab1b76f37ac0b3199324db976a6cd1b2c
  Author: Kevin Wolf <address@hidden>
  Date:   2019-06-17 (Mon, 17 Jun 2019)

  Changed paths:
    M Makefile.objs
    M monitor/Makefile.objs
    M monitor/misc.c
    M monitor/monitor-internal.h
    A monitor/qmp.c
    M monitor/trace-events

  Log Message:
  -----------
  monitor: Split out monitor/qmp.c

Move QMP infrastructure from monitor/misc.c to monitor/qmp.c. This is
code that can be shared for all targets, so compile it only once.

The amount of function and particularly extern variables in
monitor_int.h is probably a bit larger than it needs to be, but this way
no non-trivial code modifications are needed. The interfaces between QMP
and the monitor core can be cleaned up later.

Signed-off-by: Kevin Wolf <address@hidden>
Reviewed-by: Dr. David Alan Gilbert <address@hidden>
Message-Id: <address@hidden>
Reviewed-by: Markus Armbruster <address@hidden>
[monitor_is_qmp() tidied up to make checkpatch.pl happy,
superfluous #include dropped]
Signed-off-by: Markus Armbruster <address@hidden>


  Commit: ed7bda5d07b655a4056fc579d06150f95dbe8738
      
https://github.com/qemu/qemu/commit/ed7bda5d07b655a4056fc579d06150f95dbe8738
  Author: Kevin Wolf <address@hidden>
  Date:   2019-06-18 (Tue, 18 Jun 2019)

  Changed paths:
    M monitor/Makefile.objs
    A monitor/hmp.c
    M monitor/misc.c
    M monitor/monitor-internal.h
    M monitor/trace-events

  Log Message:
  -----------
  monitor: Split out monitor/hmp.c

Move HMP infrastructure from monitor/misc.c to monitor/hmp.c. This is
code that can be shared for all targets, so compile it only once.

The amount of function and particularly extern variables in
monitor_int.h is probably a bit larger than it needs to be, but this way
no non-trivial code modifications are needed. The interfaces between HMP
and the monitor core can be cleaned up later.

Signed-off-by: Kevin Wolf <address@hidden>
Message-Id: <address@hidden>
Reviewed-by: Markus Armbruster <address@hidden>
[Comment reformatted to make checkpatch.pl happy, #include <dirent.h>
moved to fix Windows build, superfluous #include dropped]
Signed-off-by: Markus Armbruster <address@hidden>


  Commit: 1d95db745b78439e9eec0782eca9cc0d679d6224
      
https://github.com/qemu/qemu/commit/1d95db745b78439e9eec0782eca9cc0d679d6224
  Author: Kevin Wolf <address@hidden>
  Date:   2019-06-18 (Tue, 18 Jun 2019)

  Changed paths:
    M MAINTAINERS
    M include/monitor/monitor.h
    M monitor/Makefile.objs
    M monitor/misc.c
    M monitor/monitor-internal.h
    A monitor/monitor.c
    M monitor/trace-events

  Log Message:
  -----------
  monitor: Split out monitor/monitor.c

Move the monitor core infrastructure from monitor/misc.c to
monitor/monitor.c. This is code that can be shared for all targets, so
compile it only once.

What remains in monitor/misc.c after this patch is mostly monitor
command implementations (which could move to hmp-cmds.c or qmp-cmds.c
later) and code that requires a system emulator or is even
target-dependent (including HMP command completion code).

The amount of function and particularly extern variables in
monitor_int.h is probably a bit larger than it needs to be, but this way
no non-trivial code modifications are needed. The interfaces between all
monitor parts can be cleaned up later.

Signed-off-by: Kevin Wolf <address@hidden>
Message-Id: <address@hidden>
Reviewed-by: Markus Armbruster <address@hidden>
[Superfluous #include dropped]
Signed-off-by: Markus Armbruster <address@hidden>


  Commit: 920824165c49bfbd1e0e9e07fd92e0bbbf32aea3
      
https://github.com/qemu/qemu/commit/920824165c49bfbd1e0e9e07fd92e0bbbf32aea3
  Author: Kevin Wolf <address@hidden>
  Date:   2019-06-18 (Tue, 18 Jun 2019)

  Changed paths:
    M monitor/hmp.c
    M monitor/misc.c
    M monitor/monitor-internal.h
    M monitor/monitor.c
    M monitor/qmp.c

  Log Message:
  -----------
  monitor: Split Monitor.flags into separate bools

Monitor.flags contains three different flags: One to distinguish HMP
from QMP; one specific to HMP (MONITOR_USE_READLINE) that is ignored
with QMP; and another one specific to QMP (MONITOR_USE_PRETTY) that is
ignored with HMP.

Split the flags field into three bools and move them to the right
subclass. Flags are still in use for the monitor_init() interface.

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


  Commit: fbfc29e3bf145581e84c12ffc432ab56ce1dea0d
      
https://github.com/qemu/qemu/commit/fbfc29e3bf145581e84c12ffc432ab56ce1dea0d
  Author: Kevin Wolf <address@hidden>
  Date:   2019-06-18 (Tue, 18 Jun 2019)

  Changed paths:
    M chardev/char.c
    M gdbstub.c
    M include/monitor/monitor.h
    M monitor/hmp.c
    M monitor/monitor-internal.h
    M monitor/monitor.c
    M monitor/qmp.c
    M stubs/monitor.c
    M tests/test-util-sockets.c
    M vl.c

  Log Message:
  -----------
  monitor: Replace monitor_init() with monitor_init_{hmp, qmp}()

Most callers know which monitor type they want to have. Instead of
calling monitor_init() with flags that can describe both types of
monitors, make monitor_init_{hmp,qmp}() public interfaces that take
specific bools instead of flags and call these functions directly.

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


  Commit: 3c45f62570aeacadf4a05bfa1afaa12bea05ae86
      
https://github.com/qemu/qemu/commit/3c45f62570aeacadf4a05bfa1afaa12bea05ae86
  Author: Kevin Wolf <address@hidden>
  Date:   2019-06-18 (Tue, 18 Jun 2019)

  Changed paths:
    M qemu-deprecated.texi
    M vl.c

  Log Message:
  -----------
  vl: Deprecate -mon pretty=... for HMP monitors

The -mon pretty=on|off switch of the -mon option applies only to QMP
monitors. It's silently ignored for HMP. Deprecate this combination so
that we can make it an error in future versions.

Signed-off-by: Kevin Wolf <address@hidden>
Message-Id: <address@hidden>
Reviewed-by: Markus Armbruster <address@hidden>
[Commit message tweaked]
Signed-off-by: Markus Armbruster <address@hidden>


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

  Changed paths:
    M MAINTAINERS
    M Makefile.objs
    M Makefile.target
    M chardev/char.c
    M docs/devel/writing-qmp-commands.txt
    M gdbstub.c
    M hmp-commands.hx
    R hmp.c
    M include/monitor/monitor.h
    R monitor.c
    A monitor/Makefile.objs
    A monitor/hmp-cmds.c
    A monitor/hmp.c
    A monitor/misc.c
    A monitor/monitor-internal.h
    A monitor/monitor.c
    A monitor/qmp-cmds.c
    A monitor/qmp.c
    A monitor/trace-events
    M qemu-deprecated.texi
    R qmp.c
    M stubs/fdset.c
    M stubs/monitor.c
    M tests/test-util-sockets.c
    M trace-events
    M vl.c

  Log Message:
  -----------
  Merge remote-tracking branch 'remotes/armbru/tags/pull-monitor-2019-06-17-v2' 
into staging

Monitor patches for 2019-06-17

# gpg: Signature made Tue 18 Jun 2019 07:20:25 BST
# gpg:                using RSA key 354BC8B3D7EB2A6B68674E5F3870B400EB918653
# gpg:                issuer "address@hidden"
# gpg: Good signature from "Markus Armbruster <address@hidden>" [full]
# gpg:                 aka "Markus Armbruster <address@hidden>" [full]
# Primary key fingerprint: 354B C8B3 D7EB 2A6B 6867  4E5F 3870 B400 EB91 8653

* remotes/armbru/tags/pull-monitor-2019-06-17-v2:
  vl: Deprecate -mon pretty=... for HMP monitors
  monitor: Replace monitor_init() with monitor_init_{hmp, qmp}()
  monitor: Split Monitor.flags into separate bools
  monitor: Split out monitor/monitor.c
  monitor: Split out monitor/hmp.c
  monitor: Split out monitor/qmp.c
  monitor: Create monitor-internal.h with common definitions
  monitor: Move {hmp, qmp}.c to monitor/{hmp, qmp}-cmds.c
  Move monitor.c to monitor/misc.c
  monitor: Rename HMP command type and tables
  monitor: Remove Monitor.cmd_table indirection
  monitor: Create MonitorHMP with readline state
  monitor: Make MonitorQMP a child class of Monitor
  monitor: Split monitor_init in HMP and QMP function
  monitor: Remove unused password prompting fields
  monitor: Fix return type of monitor_fdset_dup_fd_find

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


Compare: https://github.com/qemu/qemu/compare/076243ffe6c1...cdfaa2720f4a



reply via email to

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