Statistics
| Branch: | Revision:

root @ d49f626e

# Date Author Comment
d49f626e 03/19/2010 10:27 pm Anthony Liguori

qmp: don't make -qmp disable the default monitor

Instead, we introduce a default_qmp flag. We don't use it yet, but will in the
next patch.

This has a user-visible impact as specifying just -qmp will now also show a
monitor on the 'vc'.

Signed-off-by: Anthony Liguori <>

6fef28ee 03/19/2010 10:27 pm Anthony Liguori

Rewrite mouse handlers to use QTAILQ and to have an activation function

And convert usb-hid to use it (to avoid regression with bisection)

Right now, when we do info mice and we've added a usb tablet, we don't see it
until the guest starts using the tablet. We implement this behavior in order...

eb2e259d 03/19/2010 10:27 pm Anthony Liguori

Add kbd_mouse_has_absolute()

kbd_mouse_is_absolute tells us whether the current mouse handler is an absolute
device. kbd_mouse_has_absolute tells us whether we have any device that is
capable of absolute input.

This lets us tell a user that they have configured an absolute device but that...

7e581fb3 03/19/2010 10:27 pm Anthony Liguori

Add notifier for mouse mode changes

Right now, DisplayState clients rely on polling the mouse mode to determine
when the device is changed to an absolute device. Use a notification list to
add an explicit notification.

Signed-off-by: Anthony Liguori <>

1aaee43c 03/19/2010 10:27 pm Anthony Liguori

Expose whether a mouse is an absolute device via QMP and the human monitor.

For QMP, we just add an attribute which is backwards compatible. For the human
monitor, we add (absolute) to the end of the line.

Signed-off-by: Anthony Liguori <>

37c34d9d 03/19/2010 10:27 pm Anthony Liguori

input: make vnc use mouse mode notifiers

When we switch to absolute mode, we send out a notification (if the client
supports it). Today, we only send this notification when the client sends us
a mouse event and we're in the wrong mode.

Signed-off-by: Anthony Liguori <>

3af12c86 03/19/2010 10:27 pm Anthony Liguori

sdl: use mouse mode notifier

Today we poll the mouse mode whenever there is a mouse movement. There is a
subtle usability problem with this though.

If we're in relative mode and grab is enabled, when we change to absolute mode,
we break grab. This gives a user a seamless transition when the new pointer...

3b6304f7 03/19/2010 10:27 pm Anthony Liguori

Add exit notifiers

Like atexit() but with state

Signed-off-by: Anthony Liguori <>

d7234f4d 03/19/2010 10:27 pm Anthony Liguori

Convert atexit users to exit_notifier

All of these users have global state so we really don't see a benefit from
exit_notifier. However, using exit_notifier means that there's one less
justification for having global state in the first place.

Signed-off-by: Anthony Liguori <>

8af8ce4d 03/19/2010 10:27 pm Anthony Liguori

tap: invoke downscript when we exit abnormally

Right now, downscript is not invoked reliably. If you execute 'quit' from the
monitor, it won't be invoked.

This fixes that by converting tap to use an exit_notifier to execute the
downscript. In this case, allowing an exit notifier to include state is...

d1e70c5e 03/19/2010 10:27 pm Anthony Liguori

Add support for generic notifier lists

Notifiers are data-less callbacks and a notifier list is a list of registered
notifiers that all are interested in a particular event.

We'll use this in a few patches to implement mouse change notification.

Signed-off-by: Anthony Liguori <>...

77ac4862 03/19/2010 10:27 pm Avi Kivity

CODING_STYLE: Reserve qemu_ prefix for library wrappers

Signed-off-by: Avi Kivity <>
Signed-off-by: Anthony Liguori <>

31d4ee6c 03/19/2010 10:27 pm Juan Quintela

Convert io handlers to QLIST

Signed-off-by: Juan Quintela <>
Signed-off-by: Anthony Liguori <>

1c39e2a2 03/19/2010 10:27 pm Juan Quintela

remove useless cast

values are already pointers, no need to cast them to void *

Signed-off-by: Juan Quintela <>
Signed-off-by: Anthony Liguori <>

7b27a769 03/19/2010 10:27 pm Juan Quintela

rename IOCanRWHandler to IOCanReadHandler

It was always only used for reads

Signed-off-by: Juan Quintela <>
Signed-off-by: Anthony Liguori <>

ca96c316 03/19/2010 10:27 pm Juan Quintela

bt: remove bt_host_read_poll()

It allways returned true, that is the equivalent of not having the
callback.

Signed-off-by: Juan Quintela <>
Signed-off-by: Anthony Liguori <>

4bed9837 03/19/2010 10:27 pm Juan Quintela

Handle deleted IOHandlers in a single buffer

Signed-off-by: Juan Quintela <>
Signed-off-by: Anthony Liguori <>

ddbda432 03/19/2010 10:27 pm Anthony Liguori

Revert "usb-linux: remove unreachable default in switch statement"

This reverts commit 3c9c706c3b66d838942aba53c0d3fdcdf06c7423.

This breaks build (gcc 4.3.2):
CC usb-linux.o
cc1: warnings being treated as errors
/src/qemu/usb-linux.c: In function 'usb_linux_update_endp_table':...

d35215f8 03/18/2010 10:48 pm Blue Swirl

Fix OpenBSD linker warning

qemu-option.o(.text+0x20f8): In function `qemu_opts_from_qdict_1':
/src/qemu/qemu-option.c:813: warning: strcpy() is almost always misused, please use strlcpy()

Signed-off-by: Blue Swirl <>

43dc2a64 03/18/2010 08:41 pm Blue Swirl

Replace assert(0) with abort() or cpu_abort()

When building with -DNDEBUG, assert(0) will not stop execution
so it must not be used for abnormal termination.

Use cpu_abort() when in CPU context, abort() otherwise.

Signed-off-by: Blue Swirl <>

609c1dac 03/18/2010 08:41 pm Blue Swirl

Fix manpage errors

Split long unbreakable lines to smaller sections.

Spotted by Debian Lintian tool:
http://lintian.debian.org/full/pkg-qemu-devel@lists.alioth.debian.org.html#qemu

Signed-off-by: Blue Swirl <>

314b1811 03/17/2010 06:17 pm Gerd Hoffmann

scsi-disk: fix buffer overflow

In case s->version is shorter than 4 bytes we overflow the memcpy src
buffer. Fix it by clearing the target buffer, then copy only the
amount of bytes we actually have.

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

e5322f76 03/17/2010 06:17 pm Arnaud Patard (Rtp)

hw/usb-msd: fix some usb requests

The usb-msd device emulation needs some small tweaks in the requests
emulations. For instance, the reset/maxlun requests are class/interface
specific so requests for them with the type class and recipient interface
bits sets have to be handled....

3a0558b5 03/17/2010 06:16 pm Gerd Hoffmann

vnc: add no-lock-key-sync option

Add an option to disable the heuristics which try to keep
capslock and numlock state for guest and host in sync.

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

db1a4972 03/17/2010 06:16 pm Paolo Bonzini

split out qemu-timer.c

Signed-off-by: Paolo Bonzini <>
Signed-off-by: Anthony Liguori <>

07108b29 03/17/2010 06:16 pm Naphtali Sprei

read-only: minor cleanup

Really use read-only flags for opening the file when asked for read-only

Signed-off-by: Naphtali Sprei <>
Signed-off-by: Anthony Liguori <>

0056dcc1 03/17/2010 06:16 pm Naphtali Sprei

read-only: Another minor cleanup

Don't rely on CDROM hint for read_only attribute

Signed-off-by: Naphtali Sprei <>
Signed-off-by: Anthony Liguori <>

cfaf6d36 03/17/2010 06:16 pm Juan Quintela

migration: Clear fd also in error cases

Not clearing the fd and closing the file makes qemu spin using 100%CPU
after incoming migration error.

See for instance bug:
https://bugzilla.redhat.com/show_bug.cgi?id=518032

Signed-off-by: Juan Quintela <>...

af821177 03/17/2010 06:16 pm Juan Quintela

migration: unix migration should obey autostart are the other ones

This was the only incoming migration without autostart check

Signed-off-by: Juan Quintela <>
Signed-off-by: Anthony Liguori <>

16b151c3 03/17/2010 06:14 pm Paolo Bonzini

place together more #ifdef CONFIG_IOTHREAD blocks

Signed-off-by: Paolo Bonzini <>
Signed-off-by: Anthony Liguori <>

d6f4ade2 03/17/2010 06:14 pm Paolo Bonzini

disentangle tcg and deadline calculation

Just tell main_loop_wait whether to be blocking or nonblocking, so that
there is no need to call qemu_cpus_have_work from the timer subsystem.
Instead, tcg_cpu_exec can say "we want the main loop not to block because...

cd48d7e8 03/17/2010 06:14 pm Paolo Bonzini

only one flag is needed for alarm_timer

The ALARM_FLAG_DYNTICKS can be testing simply by checking if there is
a rearm function.

Signed-off-by: Paolo Bonzini <>
Signed-off-by: Anthony Liguori <>

1828be31 03/17/2010 06:14 pm Paolo Bonzini

more alarm timer cleanup

The timer_alarm_pending variable is related to the alarm timer but not
placed in the struct. Also, in qemu_mod_timer the wrong flag was being
tested: the timer is rearmed in the alarm timer "bottom half", so the
right flag to test there is the "pending" flag....

7a5e5838 03/17/2010 06:14 pm Paolo Bonzini

do not use qemu_event_increment outside qemu_notify_event

qemu_notify_event in the non-iothread case is only stopping the current
CPU. However, if the CPU is idle and the main loop is in the select
call then a call to qemu_event_increment is needed too (as done in...

1db89e91 03/17/2010 06:14 pm Paolo Bonzini

tweak qemu_notify_event

Instead of testing specially next_cpu in host_alarm_handler, just do
that in qemu_notify_event. The idea is, if we are not running (or
not yet running) target CPU code, prepare things so that the execution
loop is exited asap; just make that clear....

3a720b14 03/17/2010 06:14 pm Paolo Bonzini

remove qemu_rearm_alarm_timer from main loop

Make the timer subsystem register its own callback instead.

Signed-off-by: Paolo Bonzini <>
Signed-off-by: Anthony Liguori <>

b6964827 03/17/2010 06:14 pm Paolo Bonzini

extract timer handling out of main_loop_wait

Signed-off-by: Paolo Bonzini <>
Signed-off-by: Anthony Liguori <>

8c04ba55 03/17/2010 06:14 pm Paolo Bonzini

change qemu_run_timers interface

Signed-off-by: Paolo Bonzini <>
Signed-off-by: Anthony Liguori <>

972abbe0 03/17/2010 06:14 pm Paolo Bonzini

introduce and use qemu_clock_enable

By adding the possibility to turn on/off a clock, yet another
incestuous relationship between timers and CPUs can be disentangled.

Signed-off-by: Paolo Bonzini <>
Signed-off-by: Anthony Liguori <>

4e3de9e9 03/17/2010 06:14 pm Paolo Bonzini

centralize handling of -icount

A simple patch to place together all handling of -icount.

Signed-off-by: Paolo Bonzini <>
Signed-off-by: Anthony Liguori <>

e2a7bb4b 03/17/2010 06:14 pm Paolo Bonzini

add qemu_icount_round

Signed-off-by: Paolo Bonzini <>
Signed-off-by: Anthony Liguori <>

63255043 03/17/2010 06:14 pm Paolo Bonzini

add qemu_alarm_pending

Signed-off-by: Paolo Bonzini <>
Signed-off-by: Anthony Liguori <>

a2aaa079 03/17/2010 06:14 pm Paolo Bonzini

new function qemu_icount_delta

Tweaking the rounding in qemu_next_deadline ensures that there's
no change whatsoever.

Signed-off-by: Paolo Bonzini <>
Signed-off-by: Anthony Liguori <>

1b48824f 03/17/2010 06:14 pm Paolo Bonzini

move vmstate registration of vmstate_timers earlier

Signed-off-by: Paolo Bonzini <>
Signed-off-by: Anthony Liguori <>

9aea1029 03/17/2010 06:14 pm Paolo Bonzini

avoid dubiously clever code in win32_start_timer

The code is initializing an unsigned int to UINT_MAX using "-1", so that
the following always-true comparison seems to be always-false at a
first look. Since alarm timer initializations are never nested, it is...

291defbc 03/17/2010 06:14 pm Paolo Bonzini

fix error in win32_rearm_timer

The TIME_ONESHOT and TIME_PERIODIC flags are mutually exclusive.
The code after the patch matches the flags used in win32_start_timer.

Signed-off-by: Paolo Bonzini <>
Signed-off-by: Anthony Liguori <>

6d0ee850 03/17/2010 05:42 pm Adam Litke

balloon: Do not save VM state wrt asynchronous virtio operations

When working with the VM state (for loadvm/savevm and migration), it is not
valid to load and store pointers since the validity of those pointers cannot be
assured in the new qemu address space. Therefore, virtio_balloon_save() and...

8cfacf07 03/17/2010 05:42 pm Christoph Hellwig

block: add logical_block_size property

Add a logical block size attribute as various guest side tools only
increase the filesystem sector size based on it, not the advisory
physical block size.

For scsi we already have support for a different logical block size...

702f3e0f 03/17/2010 05:42 pm Jan Kiszka

Avoid crash on '-usbdevice <device>' without parameters

Many usbdevice_init implementors assume params is non-NULL.

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

cc39a92c 03/17/2010 05:42 pm Chris Webb

Fix SIGFPE for vnc display of width/height = 1

During boot, the screen gets resized to height 1 and a mouse click at this
point will cause a division by zero when calculating the absolute pointer
position from the pixel (x, y). Return a click in the middle of the screen...

3c9c706c 03/17/2010 05:41 pm Paul Bolle

usb-linux: remove unreachable default in switch statement

Signed-off-by: Paul Bolle <>
Signed-off-by: Anthony Liguori <>

fd04a2ae 03/17/2010 05:41 pm Shahar Havivi

Wrong error message in block_passwd command

Signed-off-by: Shahar Havivi <>
Signed-off-by: Anthony Liguori <>

b6034a39 03/17/2010 05:41 pm Bjørn Mork

sdl: improve error message on fatal error

The SDL_SetVideoMode() error condition is easily triggered by a user by
simply configure a guest with a host unsupported display resolution
and attempting to enable fullscreen. Since the error is fatal, adding
a bit of debugging help can't harm....

25b28f01 03/17/2010 05:41 pm Shahar Havivi

QError: New QERR_DEVICE_NOT_ENCRYPTED

Signed-off-by: Shahar Havivi <>
Signed-off-by: Anthony Liguori <>

4a39943b 03/17/2010 04:44 pm Anthony Liguori

Merge remote branch 'markus/qerror' into staging

7d834c74 03/17/2010 04:42 pm Anthony Liguori

Merge remote branch 'mst/pci' into staging

d4c430a8 03/17/2010 04:44 am Paul Brook

Large page TLB flush

QEMU uses a fixed page size for the CPU TLB. If the guest uses large
pages then we effectively split these into multiple smaller pages, and
populate the corresponding TLB entries on demand.

When the guest invalidates the TLB by virtual address we must invalidate...

304329ee 03/16/2010 06:45 pm Markus Armbruster

qemu-option: Rename find_list() to qemu_find_opts() & external linkage

Next commit wants to use it.

361127df 03/16/2010 06:45 pm Markus Armbruster

monitor: New argument type 'O'

In the human monitor, it declares a single optional argument to be
parsed according to the QemuOptsList given by its name.

In QMP, it declares an optional argument for each member of the
QemuOptsList.

Restriction: only lists with empty desc are supported for now. Good...

c7e4e8ce 03/16/2010 06:45 pm Markus Armbruster

monitor: Use argument type 'O' for device_add

While there, improve the params help text.

8bc27249 03/16/2010 06:45 pm Markus Armbruster

monitor: convert do_device_add() to QObject

fc98eb43 03/16/2010 06:45 pm Markus Armbruster

qdev: Relax parsing of bus option

Treat multiple successive slashes as a one slash. Ignore trailing
slashes. This is how POSIX pathnames work.

7bbd8237 03/16/2010 06:45 pm Markus Armbruster

error: New QERR_BUS_NOT_FOUND

1ae78718 03/16/2010 06:45 pm Markus Armbruster

error: New QERR_DEVICE_MULTIPLE_BUSSES

07574baf 03/16/2010 06:45 pm Markus Armbruster

error: New QERR_DEVICE_NO_BUS

ac8dae67 03/16/2010 06:45 pm Markus Armbruster

qdev: Convert qbus_find() to QError

aa924ae7 03/16/2010 06:45 pm Markus Armbruster

error: New error_printf_unless_qmp()

56e9f563 03/16/2010 06:45 pm Markus Armbruster

error: New QERR_BAD_BUS_FOR_DEVICE

8eae73b5 03/16/2010 06:45 pm Markus Armbruster

error: New QERR_BUS_NO_HOTPLUG

4d9a1a15 03/16/2010 06:45 pm Markus Armbruster

error: New QERR_DEVICE_INIT_FAILED

fab5767f 03/16/2010 06:45 pm Markus Armbruster

error: New QERR_NO_BUS_FOR_DEVICE

3801cf8a 03/16/2010 06:45 pm Markus Armbruster

Revert "qdev: Use QError for 'device not found' error"

This reverts commit 3ced9f7a36189aed94d8bf86f3f5087a53012455.

The next commit will convert all of qdev_device_add() to QError, and
it'll be clearer with this partial conversion reverted.

0204276b 03/16/2010 06:45 pm Markus Armbruster

error: Convert do_device_add() to QError

Conversion to QObject is still missing.

01e7f188 03/16/2010 06:45 pm Markus Armbruster

qemu-option: Functions to convert to/from QDict

The functions are somewhat restricted. Good enough for the job at
hand. We'll extend them when we need more.

8212c64f 03/16/2010 06:45 pm Markus Armbruster

qemu-option: Move the implied first name into QemuOptsList

We sometimes permit omitting the first option name, for example
-device foo is short for -device driver=foo. The name to use
("driver" in the example) is passed as argument to qemu_opts_parse()....

9c5eff95 03/16/2010 06:45 pm Markus Armbruster

error: New QERR_PROPERTY_VALUE_IN_USE

84745d68 03/16/2010 06:45 pm Markus Armbruster

error: New QERR_PROPERTY_VALUE_NOT_FOUND

fdcfa190 03/16/2010 06:45 pm Markus Armbruster

qdev: convert setting device properties to QError

036f7166 03/16/2010 06:01 pm Markus Armbruster

qdev: Hide "ptr" properties from users

Users can't set them, so qdev_device_help() shouldn't list them. Fix
that. Also make qdev_prop_parse() hide them instead of printing a
meaningless "has no parser" error message.

Their value means nothing to users, so qdev_print_props() shouldn't...

6620d3ce 03/16/2010 06:01 pm Markus Armbruster

monitor: New monitor_cur_is_qmp()

cde0fc75 03/16/2010 06:01 pm Markus Armbruster

error: Let converted handlers print in human monitor

While fully converted handlers are not supposed to print anything when
running in a QMP monitor, they are free to print in a human monitor.
For instance, device_add (not yet converted) prints help, and will...

fc5469d8 03/16/2010 06:01 pm Markus Armbruster

error: Polish human-readable error descriptions

Also put error definitions in alphabetical order

c58a35f8 03/16/2010 06:01 pm Markus Armbruster

error: New QERR_PROPERTY_NOT_FOUND

06b4a703 03/16/2010 06:01 pm Markus Armbruster

error: New QERR_PROPERTY_VALUE_BAD

1ecda02b 03/16/2010 05:58 pm Markus Armbruster

error: Replace qemu_error() by error_report()

error_report() terminates the message with a newline. Strip it it
from its arguments.

This fixes a few error messages lacking a newline:
net_handle_fd_param()'s "No file descriptor named %s found", and
tap_open()'s "vnet_hdr=1 requested, but no kernel support for...

ab5b027e 03/16/2010 05:58 pm Markus Armbruster

error: Rename qemu_error_new() to qerror_report()

827b0813 03/16/2010 05:58 pm Markus Armbruster

error: Infrastructure to track locations for error reporting

New struct Location holds a location. So far, the only location is
LOC_NONE, so this doesn't do anything useful yet.

Passing the current location all over the place would be too
cumbersome. Hide it away in static cur_loc instead, and provide...

65abca0a 03/16/2010 05:58 pm Markus Armbruster

error: Include the program name in error messages to stderr

cf5a65aa 03/16/2010 05:58 pm Markus Armbruster

error: Track locations in configuration files

New LOC_FILE. Use it for tracking file name and line number in
qemu_config_parse(). We now report errors like

qemu:foo.conf:42: Did not find I2C bus for smbus-eeprom

In particular, gems like this message:...

ef82516d 03/16/2010 05:58 pm Markus Armbruster

QemuOpts: Fix qemu_config_parse() to catch file read errors

0f0bc3f1 03/16/2010 05:58 pm Markus Armbruster

error: Track locations on command line

New LOC_CMDLINE. Use it for tracking option with argument in
lookup_opt(). We now report errors like this

qemu: -device smbus-eeprom: Did not find I2C bus for smbus-eeprom
327867b6 03/16/2010 05:58 pm Markus Armbruster

qdev: Fix -device and device_add to handle unsuitable bus gracefully

"device_add isa-serial,bus=pci.0" kills QEMU. Not good.

0c17542d 03/16/2010 05:58 pm Markus Armbruster

qdev: Factor qdev_create_from_info() out of qdev_create()

To make it obvious that -device and device_add can't die in
hw_error().

c64eafaf 03/16/2010 05:58 pm Markus Armbruster

qdev: Hide "no_user" devices from users

Users can't create them, so qdev_device_help() shouldn't list them.
Fix that.

Also make qdev_device_add() pretend they don't exist. Before, it
rejected them with a "can't be added via command line" message, which...

6fdb03d5 03/16/2010 05:55 pm Markus Armbruster

error: Don't abuse qemu_error() for non-error in scsi_hot_add()

Commit 30d335d6 converted an informational message from
monitor_printf() to qemu_error(), probably because the latter doesn't
need a mon argument. A later commit will make qemu_error() print...

6e4f984c 03/16/2010 05:55 pm Markus Armbruster

error: Simplify error sink setup

qemu_error_sink can either point to a monitor or a file. In practice,
it always points to the current monitor if we have one, else to
stderr. Simply route errors to the current monitor or else to stderr,
and remove qemu_error_sink along with the functions to control it....

2f792016 03/16/2010 05:55 pm Markus Armbruster

error: Move qemu_error & friends into their own header

ba0fe87a 03/16/2010 05:55 pm Markus Armbruster

error: New error_printf() and error_vprintf()

8a9662ca 03/16/2010 05:55 pm Markus Armbruster

error: Don't abuse qemu_error() for non-error in qdev_device_help()

qdev_device_help() prints device information with qemu_error(). A
later commit will make qemu_error() print additional stuff that is
only appropriate for proper errors, and then this will break. Use...

53db16b5 03/16/2010 05:55 pm Markus Armbruster

error: Don't abuse qemu_error() for non-error in qbus_find()

qbus_find() adds an informational line to error messages, and prints
both lines with one qemu_error(). Use error_printf() for the
informational line instead.

While there, simplify: instead of printing buffers filled by...