Statistics
| Branch: | Revision:

root / monitor.c @ 551a2dec

History | View | Annotate | Download (124.9 kB)

# Date Author Comment
9eedeb3b 03/09/2010 04:47 pm Luiz Capitulino

QMP: Introduce WATCHDOG event

It's emitted whenever the watchdog device's timer expires. The action
taken is provided in the 'data' member.

Signed-off-by: Luiz Capitulino <>
Signed-off-by: Anthony Liguori <>

80cd3478 03/08/2010 07:30 pm Luiz Capitulino

QMP: Introduce RTC_CHANGE event

Emitted whenever the RTC time changes.

Signed-off-by: Luiz Capitulino <>
Signed-off-by: Anthony Liguori <>

51a3bd71 03/08/2010 07:30 pm Luiz Capitulino

QMP: Drop DEBUG event

This event has been introduced in the first round of QMP commits,
turns out that it's based on the usage of the EXCP_DEBUG macro,
which has discussable semantics when exposed through QMP.

As libvirt doesn't use this, let's just drop it....

93d67ee6 03/08/2010 07:29 pm Adam Litke

Fix hanging user monitor when using balloon command

This patch application failed. My patch adds a cb() call in
do_balloon(), but the change in git has added the cb() call to
do_info_balloon(). That is causing qemu segfaults. Applying the
following should correct the damage. Thanks....

c64484a5 02/23/2010 09:23 pm Gleb Natapov

fix 'i' format handling in memory dump

It was broken by 09b9418c6d0. (!env && = (!is_physical)
when env is true.

Signed-off-by: Gleb Natapov <>
Signed-off-by: Anthony Liguori <>

5c366a8a 02/19/2010 11:32 pm Adam Litke

Fix hanging user monitor when using balloon command

Arghh... Adding missing S-O-B

Hi Anthony. I wonder if there was a problem when importing my async
command handler patchset. Since the 'balloon' command completes
immediately, it must call the completion callback before returning....

b4475aa2 02/19/2010 11:18 pm Luiz Capitulino

Monitor: Debugging support

Add configure options (--enable-debug-mon and --disable-debug-mon)
plus the MON_DEBUG() macro.

Signed-off-by: Luiz Capitulino <>
Signed-off-by: Anthony Liguori <>

b8b08266 02/19/2010 11:18 pm Luiz Capitulino

Monitor: Drop the print disabling mechanism

We can ignore calls to monitor_vprintf() in QMP mode and use
monitor_puts() directly in monitor_json_emitter().

This allows us to drop this ugly hack.

Signed-off-by: Luiz Capitulino <>
Signed-off-by: Anthony Liguori <>

bb89c2e9 02/19/2010 11:18 pm Luiz Capitulino

Monitor: Audit handler return

This commit verifies the following two rules specified by
Markus Armbruster:

1. If the handler returns failure, it must have passed an error.

If it didn't, it's broken. Report an internal error to the client,
and report the bug to the programmer....
10e4f606 02/19/2010 11:18 pm Luiz Capitulino

Monitor: Debug stray prints the right way

QObject Monitor handlers should not call any Monitor print
function: they should only build objects, printing is done
by common code.

Current QMP code will ignore such calls, as we can't send
garbage to clients, additionally it will also emit an...

068b332a 02/19/2010 11:18 pm Luiz Capitulino

Monitor: Report more than one error in handlers

Handlers can generate only one error in a call, we let the
programmer know if they brake this rule and clients will only
get the first generated error.

Signed-off-by: Luiz Capitulino <>...

6ad3ebd2 02/19/2010 11:18 pm Luiz Capitulino

Monitor: Convert do_getfd() to cmd_new_ret()

Signed-off-by: Luiz Capitulino <>
Signed-off-by: Anthony Liguori <>

aeb91c1e 02/19/2010 11:18 pm Luiz Capitulino

Monitor: Convert do_closefd() to cmd_new_ret()

Signed-off-by: Luiz Capitulino <>
Signed-off-by: Anthony Liguori <>

9869622e 02/19/2010 11:18 pm Luiz Capitulino

Monitor: Convert do_memory_save() to cmd_new_ret()

Signed-off-by: Luiz Capitulino <>
Signed-off-by: Anthony Liguori <>

fe38a32a 02/19/2010 11:18 pm Luiz Capitulino

Monitor: Convert do_physical_memory_save() to cmd_new_ret()

Signed-off-by: Luiz Capitulino <>
Signed-off-by: Anthony Liguori <>

4fdc94b4 02/19/2010 11:18 pm Luiz Capitulino

Monitor: Convert do_info() to cmd_new_ret()

Note that this function only fails in QMP, in the user Monitor
it prints the help text instead.

Signed-off-by: Luiz Capitulino <>
Signed-off-by: Anthony Liguori <>

0bbc47bb 02/19/2010 11:18 pm Luiz Capitulino

Monitor: Convert do_change() to cmd_new_ret()

Not that trivial as the call chain also has to be modified.

Signed-off-by: Luiz Capitulino <>
Signed-off-by: Anthony Liguori <>

261394db 02/19/2010 11:18 pm Luiz Capitulino

Monitor: Rename cmd_new_ret()

Now that all handlers are converted to cmd_new_ret(), we can rename
it back to cmd_new(). But now it returns a value.

Signed-off-by: Luiz Capitulino <>
Signed-off-by: Anthony Liguori <>

97536cff 02/19/2010 11:18 pm Luiz Capitulino

Monitor: Introduce cmd_new_ret()

In order to implement the new error handling and debugging
mechanism for command handlers, we need to change the cmd_new()
callback to return a value.

This commit introduces cmd_new_ret(), which returns a value and
will be used only temporarily to handle the transition from...

ef4b7eee 02/19/2010 11:18 pm Luiz Capitulino

Monitor: Convert simple handlers to cmd_new_ret()

The following handlers always succeed and hence can be converted
to cmd_new_ret() in the same commit.

- do_stop()
- do_quit()
- do_system_reset()
- do_system_powerdown()
- do_migrate_cancel()
- do_qmp_capabilities()...

d5a7b38f 02/19/2010 11:18 pm Luiz Capitulino

Monitor: Convert do_cont() to cmd_new_ret()

Signed-off-by: Luiz Capitulino <>
Signed-off-by: Anthony Liguori <>

9b9d4d9c 02/19/2010 11:18 pm Luiz Capitulino

Monitor: Convert do_eject() to cmd_new_ret()

Signed-off-by: Luiz Capitulino <>
Signed-off-by: Anthony Liguori <>

584cbdb5 02/19/2010 11:18 pm Luiz Capitulino

Monitor: Convert do_cpu_set() to cmd_new_ret()

Signed-off-by: Luiz Capitulino <>
Signed-off-by: Anthony Liguori <>

ba85d351 02/19/2010 11:18 pm Luiz Capitulino

Monitor: Convert do_block_set_passwd() to cmd_new_ret()

Signed-off-by: Luiz Capitulino <>
Signed-off-by: Anthony Liguori <>

ba144141 02/10/2010 09:46 pm Luiz Capitulino

Monitor: remove unneeded checks

It's not needed to check the return of qobject_from_jsonf()
anymore, as an assert() has been added there.

Signed-off-by: Luiz Capitulino <>
Signed-off-by: Anthony Liguori <>

27a749fb 02/10/2010 09:46 pm Luiz Capitulino

QError: Don't abort on multiple faults

Ideally, Monitor code should report an error only once and
return the error information up the call chain.

To assure that this happens as expected and that no error is
lost, we have an assert() in qemu_error_internal()....

47116d1c 02/10/2010 09:46 pm Luiz Capitulino

QMP: Don't leak on connection close

QMP's chardev event callback doesn't call
json_message_parser_destroy() on CHR_EVENT_CLOSED. As the call
to json_message_parser_init() on CHR_EVENT_OPENED allocates memory,
we'are leaking on close.

Fix that by just calling json_message_parser_destroy() on...

ca9567e2 02/10/2010 08:46 pm Luiz Capitulino

QMP: Add QEMU's version to the greeting message

With capability negotiation support clients will only have a chance
to check QEMU's version (ie. issue 'query-version') after the
negotiation procedure is done.

It might be useful to clients to check QEMU's version before...

4a7e1190 02/10/2010 08:46 pm Luiz Capitulino

QMP: Introduce the qmp_capabilities command

This command will be used to enable QMP capabilities advertised
by the capabilities array.

Note that it will be mandatory to issue this command in order
to make QMP functional (although this behavior is not being...

09069b19 02/10/2010 08:46 pm Luiz Capitulino

QMP: Enforce capability negotiation rules

With this commit QMP will be started in Capabilities Negotiation
mode, where the only command allowed to run is 'qmp_capabilities'.

All other commands will return CommandNotFound error. Asynchronous
messages are not delivered either....

aa1db6ed 02/10/2010 07:57 pm Luiz Capitulino

QMP: BLOCK_IO_ERROR event handling

This commit adds the basic definitions for the BLOCK_IO_ERROR
event, but actual event emission will be introduced by the
next commits.

Signed-off-by: Luiz Capitulino <>
Signed-off-by: Anthony Liguori <>

cc0c4185 02/03/2010 08:39 pm Markus Armbruster

monitor: Use QERR_INVALID_PARAMETER instead of QERR_INVALID_CPU_INDEX

This changes the error message from "Invalid CPU index" to "Invalid
parameter index" in the human monitor.

Signed-off-by: Markus Armbruster <>
Signed-off-by: Anthony Liguori <>

3350a4dd 02/03/2010 08:36 pm Markus Armbruster

monitor: New argument type 'b'

This is a double value with optional suffixes G, g, M, m, K, k. We'll
need this to get migrate_set_speed() QMP-ready.

Signed-off-by: Markus Armbruster <>
Signed-off-by: Anthony Liguori <>

fccfb11e 02/03/2010 08:36 pm Markus Armbruster

monitor: New argument type 'T'

This is a double value with optional suffixes ms, us, ns. We'll need
this to get migrate_set_downtime() QMP-ready.

Signed-off-by: Markus Armbruster <>
Signed-off-by: Anthony Liguori <>

9fec543f 02/03/2010 08:36 pm Markus Armbruster

monitor: Document argument type 'M'

Was forgotten in commit b6e098d7.

Signed-off-by: Markus Armbruster <>
Signed-off-by: Anthony Liguori <>

82617d7c 01/28/2010 09:09 pm Luiz Capitulino

Monitor: Fix command execution regression

Function is_async_return() added by commit 940cc30d0d4 assumes
that 'data', which is returned by handlers, is always a QDict.

This is not true, as QLists can also be returned, in this case
we'll get a segfault.
...

940cc30d 01/27/2010 01:08 am Adam Litke

New API for asynchronous monitor commands

Qemu has a number of commands that can operate asynchronously (savevm, migrate,
etc) and it will be getting more. For these commands, the user monitor needs
to be suspended, but QMP monitors could continue to to accept other commands....

625a5bef 01/27/2010 01:08 am Adam Litke

virtio: Add memory statistics reporting to the balloon driver

When using ballooning to manage overcommitted memory on a host, a system for
guests to communicate their memory usage to the host can provide information
that will minimize the impact of ballooning on the guests. The current method...

163c8a59 01/26/2010 11:42 pm Luiz Capitulino

PCI: Convert pci_info() to QObject

The returned QObject is a QList of all buses. Each bus is
represented by a QDict, which has a key with a QList of all
PCI devices attached to it. Each device is represented by
a QDict.

As has happended to other complex conversions, it's hard to...

27e3ddd3 01/26/2010 10:59 pm Kirill A. Shutemov

monitor.c: fix warnings with _FORTIFY_SOURCE

CC i386-softmmu/monitor.o
cc1: warnings being treated as errors
/usr/src/RPM/BUILD/qemu-0.11.92/monitor.c: In function 'do_memory_save':
/usr/src/RPM/BUILD/qemu-0.11.92/monitor.c:1318: error: ignoring return value of 'fwrite', declared with attribute warn_unused_result...

95fada8c 01/26/2010 10:55 pm Markus Armbruster

monitor: convert do_physical_memory_save() to QError

Signed-off-by: Markus Armbruster <>
Signed-off-by: Anthony Liguori <>

81a1b45a 01/26/2010 10:55 pm Markus Armbruster

monitor: convert do_cpu_set() to QObject, QError

Signed-off-by: Markus Armbruster <>
Signed-off-by: Anthony Liguori <>

09b9418c 01/26/2010 10:55 pm Markus Armbruster

monitor: Don't check for mon_get_cpu() failure

mon_get_cpu() can't return null pointer, because it passes its return
value to cpu_synchronize_state() first, which crashes if its argument
is null.

Remove the (pretty cheesy) handling of this non-existing error....

c34ed28b 01/26/2010 10:55 pm Markus Armbruster

monitor: convert do_memory_save() to QError

Signed-off-by: Markus Armbruster <>
Signed-off-by: Anthony Liguori <>

23fabed1 01/20/2010 04:25 pm Luiz Capitulino

QMP: Fix asynchronous events delivery

Commit f039a563f200beee80cc10fd70b21ea396979dab introduces
a regression as monitor_protocol_event() will return in
the first user Monitor it finds in the QLIST_FOREACH()
loop.

The right thing to do is to only delivery an asynchronous...

f5edb014 01/20/2010 04:25 pm Naphtali Sprei

Clean-up a little bit the RW related bits of BDRV_O_FLAGS. BDRV_O_RDONLY gone (and so is BDRV_O_ACCESS). Default value for bdrv_flags (0/zero) is READ-ONLY. Need to explicitly request READ-WRITE.

Instead of using the field 'readonly' of the BlockDriverState struct for passing the request,...

0d2ed46a 01/20/2010 12:31 am Luiz Capitulino

QMP: Introduce VNC_INITIALIZED event

It's emitted when a VNC client session is activated by QEMU,
client's information such as port, IP and auth ID (if the
session is authenticated) are provided.

Event example:

{ "event": "VNC_INITIALIZED",
"timestamp": {"seconds": 1263475302, "microseconds": 150772},...

f039a563 01/20/2010 12:31 am Adam Litke

QMP: Emit asynchronous events on all QMP monitors

When using a control/QMP monitor in tandem with a regular monitor, asynchronous
messages can get lost depending on the order of the QEMU program arguments.
QEMU events issued by monitor_protocol_event() always go to cur_mon. If the...

586153d9 01/20/2010 12:31 am Luiz Capitulino

QMP: Introduce VNC_CONNECTED event

It's emitted when a VNC client connects to QEMU, client's information
such as port and IP address are provided.

Note that this event is emitted right when the connection is
established. This means that it happens before authentication...

0d72f3d3 01/20/2010 12:31 am Luiz Capitulino

QMP: Introduce VNC_DISCONNECTED event

It's emitted when a VNC client disconnects from QEMU, client's
information such as port and IP address are provided.

Event example:

{ "event": "VNC_DISCONNECTED",
"timestamp": { "seconds": 1262976601, "microseconds": 975795 },...

23842aab 01/12/2010 10:27 pm Blue Swirl

monitor: fix dead assignment spotted by clang

Value stored to 'nb_per_line' is never read.

Signed-off-by: Blue Swirl <>

3d72f9a2 01/12/2010 09:24 pm Luiz Capitulino

QMP: Don't free async event's 'data'

The monitor_protocol_event() function will free the
event's data, this is wrong as 'data' management is up
to the caller.

Signed-off-by: Luiz Capitulino <>
Signed-off-by: Anthony Liguori <>

810f49b5 01/08/2010 05:58 pm Luiz Capitulino

QMP: Drop wrong assert()

Some commands return a QList of QDicts, which is valid,
but will trig the assert().

Just drop it.

Reported-by: Nathan Baum <>
Signed-off-by: Luiz Capitulino <>
Signed-off-by: Anthony Liguori <>

b6e098d7 12/19/2009 04:26 pm Luiz Capitulino

monitor: Introduce 'M' argument type

This is a target long value in megabytes which should be
converted to bytes.

It will be used by handlers which accept a megabyte value
when in "user mode".

Signed-off-by: Luiz Capitulino <>
Signed-off-by: Anthony Liguori <>

3b0bd6ec 12/19/2009 04:26 pm Luiz Capitulino

monitor: do_balloon(): Use 'M' argument type

This makes do_balloon() accept megabyte values from the user
Monitor while accepting byte values for QMP.

Signed-off-by: Luiz Capitulino <>
Signed-off-by: Anthony Liguori <>

0abc6579 12/19/2009 04:26 pm Luiz Capitulino

QMP: Return an empty dict by default

Currently, when a regular command doesn't have any data to output,
QMP will emit:

{ "return": "OK" }

Returning an empty dict is better though, because dicts can support
some protocol changes in a compatible way.

So, with this commit we will return:...

3661d51e 12/19/2009 04:26 pm Luiz Capitulino

QMP: Assure that returned data is a QDict

This is for debug purposes only.

Signed-off-by: Luiz Capitulino <>
Signed-off-by: Anthony Liguori <>

43e713ce 12/19/2009 04:26 pm Luiz Capitulino

QMP: Only handle converted commands

Looks like I dropped this check when addressing the 'query-'
commands request.

QMP should only handle converted commands, obviously.

Reported-by: Markus Armbruster <>

Signed-off-by: Luiz Capitulino <>...

c62313bb 12/18/2009 07:26 pm Jan Kiszka

monitor: Accept input only byte-wise

This allows to suspend command interpretation and execution
synchronously, e.g. during migration.

Signed-off-by: Jan Kiszka <>
Signed-off-by: Anthony Liguori <>

78d714e0 12/18/2009 07:26 pm Luiz Capitulino

monitor: Use 'device' in eject

Monitor's eject command uses 'filename' for the device name
argument, but 'device' is a better name.

Signed-off-by: Luiz Capitulino <>
Signed-off-by: Anthony Liguori <>

cfdf2c40 12/18/2009 07:26 pm Luiz Capitulino

monitor: do_balloon(): Check for errors

do_balloon() should check for ballooning availability as
do_info_balloon() does.

Noted by Daniel P. Berrange <>.

Signed-off-by: Luiz Capitulino <>
Signed-off-by: Anthony Liguori <>

183e6e52 12/18/2009 07:26 pm Luiz Capitulino

monitor: Avoid readline functions in QMP

The monitor_read_command() function is readline specific
and should only be used when readline is available.

Signed-off-by: Luiz Capitulino <>
Signed-off-by: Anthony Liguori <>

2daa1191 12/18/2009 07:26 pm Luiz Capitulino

monitor: Catch printing to non-existent monitor

The monitor_vprintf() function now touches the 'mon' pointer
before calling monitor_puts(), this causes block migration
to segfault as its functions call monitor_printf() with a
NULL 'mon'.

To fix the problem this commit moves the 'mon' NULL check...

e78c48ec 12/12/2009 03:59 pm Luiz Capitulino

monitor: Convert do_info_mice() to QObject

Each mouse is represented by a QDict, the returned QObject is a QList of
all mice.

This commit should not change user output.

Signed-off-by: Luiz Capitulino <>
Signed-off-by: Anthony Liguori <>

c86a6683 12/12/2009 03:59 pm Luiz Capitulino

migration: Convert do_info_migrate() to QObject

Return a QDict, which may contain up to more two QDicts, depending
on the type of migration we're performing.

IMPORTANT: as a QInt stores a int64_t integer, RAM values are going
to be stored as int64_t and not as uint64_t as they are today. If...

d15e5465 12/12/2009 03:59 pm Luiz Capitulino

block: Convert bdrv_info() to QObject

Each block device information is stored in a QDict and the
returned QObject is a QList of all devices.

This commit should not change user output.

Signed-off-by: Luiz Capitulino <>
Signed-off-by: Anthony Liguori <>

218a536a 12/12/2009 03:59 pm Luiz Capitulino

block: Convert bdrv_info_stats() to QObject

Each device statistic information is stored in a QDict and
the returned QObject is a QList of all devices.

This commit should not change user output.

Signed-off-by: Luiz Capitulino <>
Signed-off-by: Anthony Liguori <>

588b3832 12/12/2009 03:59 pm Luiz Capitulino

char: Convert qemu_chr_info() to QObject

Each device is represented by a QDict. The returned QObject is a QList
of all devices.

This commit should not change user output.

Signed-off-by: Luiz Capitulino <>
Signed-off-by: Anthony Liguori <>

d96fd29c 12/12/2009 03:59 pm Luiz Capitulino

VNC: Convert do_info_vnc() to QObject

Return a QDict with server information. Connected clients are returned
as a QList of QDicts.

The new functions (vnc_qdict_remote_addr(), vnc_qdict_local_addr() and
put_addr_qdict()) are used to insert 'host' and 'service' information...

45e914cf 12/12/2009 03:59 pm Luiz Capitulino

monitor: do_info_version(): Use QDict

All 'info' commands should use QDict, this commit also kills
monitor_print_qobject() as do_info_version() doesn't use it
anymore (and no handler will).

Signed-off-by: Luiz Capitulino <>
Signed-off-by: Anthony Liguori <>

c0e8520e 12/12/2009 03:59 pm Luiz Capitulino

monitor: Convert do_info_status() to QObject

Signed-off-by: Luiz Capitulino <>
Signed-off-by: Anthony Liguori <>

2af5ba71 12/12/2009 03:59 pm Luiz Capitulino

monitor: Convert do_info_kvm() to QObject

Signed-off-by: Luiz Capitulino <>
Signed-off-by: Anthony Liguori <>

e05486cb 12/12/2009 03:59 pm Luiz Capitulino

monitor: Convert do_info_name() to QObject

Signed-off-by: Luiz Capitulino <>
Signed-off-by: Anthony Liguori <>

14f0720d 12/12/2009 03:59 pm Luiz Capitulino

monitor: Convert do_info_hpet() to QObject

Signed-off-by: Luiz Capitulino <>
Signed-off-by: Anthony Liguori <>

9603ceba 12/12/2009 03:59 pm Luiz Capitulino

monitor: Convert do_info_uuid() to QObject

snprintf() is used because the UUID_FMT is too complex for
qobject_from_jsonf().

Signed-off-by: Luiz Capitulino <>
Signed-off-by: Anthony Liguori <>

7f179671 12/12/2009 03:59 pm Luiz Capitulino

monitor: Fix do_info_balloon() output

Monitor commands should always return values in bytes and info
commands should always return a QDict.

Signed-off-by: Luiz Capitulino <>
Signed-off-by: Anthony Liguori <>

1a728677 12/12/2009 03:59 pm Luiz Capitulino

monitor: Fix do_info_commands() output

Should return a QDict and should not print the user protocol bits
(eg. "c|cont").

Signed-off-by: Luiz Capitulino <>
Signed-off-by: Anthony Liguori <>

55483ad6 12/12/2009 03:59 pm Luiz Capitulino

monitor: do_info_cpus(): Use QBool

While there update the documentation as well.

Signed-off-by: Luiz Capitulino <>
Signed-off-by: Anthony Liguori <>

4e307fc8 12/12/2009 03:59 pm Gerd Hoffmann

Revert "monitor: Command-line flag to enable control mode"

This reverts commit adcb181afe5a951c521411c7a8e9d9b791aa6742.

Conflicts:

monitor.h

Signed-off-by: Gerd Hoffmann <>
Signed-off-by: Anthony Liguori <>

7cdfcfe1 12/08/2009 12:34 am Markus Armbruster

monitor: convert do_getfd() to QError

Signed-off-by: Markus Armbruster <>
Signed-off-by: Anthony Liguori <>

77e595e7 12/08/2009 12:34 am Markus Armbruster

QMP: add human-readable description to error response

Signed-off-by: Markus Armbruster <>
Signed-off-by: Anthony Liguori <>

ec3b82af 12/08/2009 12:34 am Markus Armbruster

monitor: convert do_change() to QObject, QError

Signed-off-by: Markus Armbruster <>
Signed-off-by: Anthony Liguori <>

063c1a09 12/08/2009 12:34 am Markus Armbruster

monitor: convert do_closefd() to QError

Signed-off-by: Markus Armbruster <>
Signed-off-by: Anthony Liguori <>

2c2a6bb8 12/08/2009 12:34 am Markus Armbruster

monitor: convert do_eject() to QError

Also affects do_change(), because the two share eject_device().

Signed-off-by: Markus Armbruster <>
Signed-off-by: Anthony Liguori <>

94171e11 12/08/2009 12:34 am Luiz Capitulino

monitor: do_cont(): Don't ask for passwords

The do_cont() function will ask the user to enter a password if a
device is encrypted.

This is invalid under QMP, so we raise a QERR_DEVICE_ENCRYPTED
error.

Signed-off-by: Luiz Capitulino <>...

2895e075 12/08/2009 12:34 am Markus Armbruster

monitor: Fix double-prompt after "change vnc passwd BLA"

Signed-off-by: Markus Armbruster <>
Signed-off-by: Anthony Liguori <>

a3a55a2e 12/07/2009 10:04 pm Luiz Capitulino

monitor: Introduce 'block_passwd' command

When using encrypted disk images, QEMU will prompt the user
for passwords when started.

This makes sense for the user protocol, but doesn't for QMP.

The solution is to have Monitor command which allows the user...

dd5121bd 12/04/2009 10:52 pm Blue Swirl

monitor: fix use of plain integer as NULL pointer, spotted by Sparse

Signed-off-by: Blue Swirl <>

d08d6f04 12/04/2009 08:06 pm Blue Swirl

monitor: use qemu_gettimeofday(), not gettimeofday()

Fix mingw32 build.

Signed-off-by: Blue Swirl <>

242cd003 12/04/2009 08:05 pm Blue Swirl

monitor: rename EVENT_* to QEVENT_* to avoid conflict on mingw32

Partially fixes mingw32 build.

Signed-off-by: Blue Swirl <>

68ac40d2 12/03/2009 05:41 pm Mark McLoughlin

net: move slirp code from net.c to net/slirp.c

Signed-off-by: Mark McLoughlin <>
Signed-off-by: Anthony Liguori <>

b1a15e7e 12/03/2009 05:41 pm Luiz Capitulino

QMP: Introduce basic asynchronous events

Debug, shutdown, reset, powerdown and stop are all basic events,
as they are very simple they can be added in the same commit.

Signed-off-by: Luiz Capitulino <>
Signed-off-by: Anthony Liguori <>

4a29a85d 12/03/2009 05:41 pm Luiz Capitulino

QMP: Disable monitor print functions

We still have handlers which will call monitor print functions
in several places. Usually to report errors.

If they do this when we are in control mode, we will be emitting
garbage to our clients.

To avoid this problem, this commit adds a way to disable those...

25b422eb 12/03/2009 05:41 pm Luiz Capitulino

QMP: Output support

In the new Monitor output is always performed by only two
functions: do_info() and monitor_call_handler().

To support QMP output, we modify those functions to check if we
are in control mode. If so, we call monitor_protocol_emitter()...

956f1a0d 12/03/2009 05:41 pm Luiz Capitulino

QMP: do_info() checks

This commit adds specific QMP checks to do_info(), so that
it behaves as expected in QMP mode.

Signed-off-by: Luiz Capitulino <>
Signed-off-by: Anthony Liguori <>

5fa737a4 12/03/2009 05:41 pm Luiz Capitulino

QMP: Input support

The JSON stream parser is used to do QMP input. When there
are enough characters to be parsed it calls Monitor's
handle_qmp_command() function to handle the input.

This function's job is to check if the input is correct and
call the appropriate handler. In other words, it does for QMP...

5e23f480 12/03/2009 05:41 pm Luiz Capitulino

QMP: Allow 'query-' commands

The 'info' command makes sense for the user protocol, but for QMP
it doesn't, as its return data is not well defined. That is, it
can return anything.

To fix this Avi proposes having 'query-' commands when in protocol
mode. For example, 'info balloon' would become 'query-balloon'....

0d1ea871 12/03/2009 05:41 pm Luiz Capitulino

QMP: Asynchronous events infrastructure

Asynchronous events are generated with a call to
monitor_protocol_event().

This function builds the right data-type and emit the event
right away. The emitted data is always a JSON object and its
format is as follows:...

e3bba9d0 12/03/2009 05:41 pm Luiz Capitulino

monitor: Introduce 'info commands'

List QMP available commands. Only valid in control mode, where
has to be used as 'query-commands.

Signed-off-by: Luiz Capitulino <>
Signed-off-by: Anthony Liguori <>

9b57c02e 12/03/2009 05:41 pm Luiz Capitulino

QMP: Initial support

This commit adds initial QMP support in QEMU. It's important
to notice that most QMP code will be part of the Monitor.

Input will be read by monitor_control_read(). Currently it
does nothing but next patches will add proper input support....