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.
Actually, the old code switches the sink slightly later, in
handle_user_command() and handle_qmp_command(), than it gets switched
now, implicitly, by setting the current monitor in monitor_read() and
monitor_control_read(). Likewise, it switches back slightly earlier
(same places). Doesn't make a difference, because there are no calls
of qemu_error() in between.
The old test assumes that "hotplugged" implies "we have a current
monitor for reading the key". This is in fact true, but it's not
obviously true.
Aside: if it were false, we could pass a null pointer to
monitor_read_bdrv_key_start(), which would then crash.
The previous commit permits us to check for "we have a current
monitor" directly, so do that.
Commits 376253ec..731b0364 introduced global variable cur_mon, which
points to the "default monitor" (if any), except during execution of
monitor_read() or monitor_control_read() it points to the monitor from
which we're reading instead (the "current monitor"). Monitor command
handlers run within monitor_read() or monitor_control_read().
Default monitor and current monitor are really separate things, and
squashing them together is confusing and error-prone.
For instance, usb_host_scan() can run both in "info usbhost" and
periodically via usb_host_auto_check(). It prints to cur_mon, which
is what we want in the former case: the monitor executing "info
usbhost". But since that's the default monitor in the latter case, it
periodically spams the default monitor there.
A few places use cur_mon to log stuff to the default monitor. If we
ever log something while cur_mon points to current monitor instead of
default monitor, the log temporarily "jumps" to another monitor.
Whether that can or cannot happen isn't always obvious.
Maybe logging to the default monitor (which may not even exist) is a
bad idea, and we should log to stderr or a logfile instead. But
that's outside the scope of this commit.
Change cur_mon to point to the current monitor. Create new
default_mon to point to the default monitor. Update users of cur_mon
accordingly.
This fixes the periodical spamming of the default monitor by
usb_host_scan(). It also stops "log jumping", should that problem
exist.
Code duplicated in commit 0ecdffbb. The two versions are similar, but
not identical:
* cmos_init() reports errors to stderr, pc_boot_set() via
qemu_error(). The latter is fine for both, so pick that for the
common code.
* cmos_init() obeys fd_bootchk, pc_boot_set() ignores it. Make it a
parameter of the common code.
Commit 0ecdffbb created pc_boot_set() for use from monitor command
"boot_set", via qemu_boot_set(). pc_boot_set() reports errors to
cur_mon, which works fine for monitor code.
Commit e0f084bf reused the function int reset handler
restore_boot_devices(). Use of cur_mon is problematic in that
context. For instance, the "Too many boot devices for PC" error for
"-boot order=abcdefgh,once=c" goes to the monitor instead of stderr.
The monitor may not even exist.
Fix by switching to qemu_error().
The monitor_printf() reports failure. Printing is wrong, because the
caller tries various arguments, and expects the function to fail for
some or all.
Disabled since commit 26a9e82a. Remove it.
Something bad has happened in the merge of commit 0ee44250, as
the log message says it's supposed to be in qemu_system_reset()
but it is do_vm_stop().
Possibly, it was a problem with the conflict resolution with
ea375f9a (which has been merged first).
This commit moves (again) the RESET event into qemu_system_reset().
Signed-off-by: Luiz Capitulino <lcapitulino@redhat.com>
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
A SIB byte with an index of 4 means "no scaled index", even if the scale
value is not 0. In 64-bit mode, if REX.X is used, an index of 4 selects
%r12. This is correctly handled by the computation of the index variable,
which includes the index bits, and also the REX.X prefix:
index = ((code >> 3) & 7) | REX_X(s);
Thanks to Avi Kivity, Jamie Lokier and Malc for the analysis of the
problem and the initial patch.
Signed-off-by: Aurelien Jarno <aurelien@aurel32.net>
Now that we changed all create calls to return errno, just print it.
Signed-off-by: Juan Quintela <quintela@redhat.com>
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
cleanup code is identical for error/success cases. Only difference
are goto labels.
Signed-off-by: Juan Quintela <quintela@redhat.com>
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
fail_gd error case would also free rgd_buf that was already freed
Signed-off-by: Juan Quintela <quintela@redhat.com>
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
we shouldn't call W*() macros until we check that fork worked.
Signed-off-by: Juan Quintela <quintela@redhat.com>
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
Allow the user to specify the format of the image to rebase.
Signed-off-by: Kevin Wolf <kwolf@redhat.com>
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
These files are created by configure and grow
unnecessarily at each new call of configure:
roms/seabios/config.mak
roms/vgabios/config.mak
libhw32/config.mak
libhw64/config.mak
libhw32/config.mak and libhw64/config.mak set
compiler options, and the wrong old code results
in very long command lines.
The new code always writes a new config.mak
instead of appending to an existing one.
Signed-off-by: Stefan Weil <weil@mail.berlios.de>
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
It's emitted whenever the watchdog device's timer expires. The action
taken is provided in the 'data' member.
Signed-off-by: Luiz Capitulino <lcapitulino@redhat.com>
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
Patch http://permalink.gmane.org/gmane.comp.emulators.qemu/63472 handle
close when using tty devices (like /dev/ttyS0),
yet tty based monitor are not restoring terminal attributes (as done
with stdio based monitor), when closing qemu after that command:
$ qemu -monitor /dev/tty
the terminal is not responding until you write reset (blindly),
this patch fix it
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
Use led status notification support in vnc.
The qemu vnc server keeps track of the capslock and numlock states based
on the key presses it receives from the vnc client. But this fails in
case the guests idea of the capslock and numlock state changes for other
reasons. One case is guest reboot (+ keyboard reset). Another case are
more recent windows versions which reset capslock state before
presenting the login screen.
Usually guests use the keyboard leds to signal the capslock and numlock
state to the user, so we can use this to better keep track of capslock
and numlock state in the qemu vnc server.
Also toggle the numlock and capslock states on keydown events (instead
of keyup). Guests do the same.
Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
Add led status notification support to the usb kbd driver.
Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
Add led status notification support to the ps/2 kbd driver.
Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
Adds infrastructure for keyboard led status tracking to qemu.
Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
You're supposed to use scsi-generic for that. Which rejects anything
but /dev/sg*.
Signed-off-by: Markus Armbruster <armbru@redhat.com>
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
Guest device and host netdev are peers, i.e. it's a 1:1 relation.
However, we fail to enforce that:
$ qemu -nodefaults --nographic -netdev user,id=net0 -device e1000,netdev=net0 -device virtio-net-pci,netdev=net0 -monitor stdio
QEMU 0.12.50 monitor - type 'help' for more information
(qemu) info network
Devices not on any VLAN:
net0: net=10.0.2.0, restricted=n peer=virtio-net-pci.0
e1000.0: model=e1000,macaddr=52:54:00:12:34:56 peer=net0
virtio-net-pci.0: model=virtio-net-pci,macaddr=52:54:00:12:34:57 peer=net0
It's all downhill from there.
Signed-off-by: Markus Armbruster <armbru@redhat.com>
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
Property "vlan" reports "failed to parse" even when the value parses
just fine, but the result doesn't name an existing VLAN.
Similarly, properties "drive", "chr" and "netdev" misleadingly report
"failed to parse" when the value doesn't name an existing host device.
Change PropertyInfo method parse to return an error code, so that
qdev_prop_parse() can report the error more accurately.
Signed-off-by: Markus Armbruster <armbru@redhat.com>
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
Use the named constant instead of -1.
Signed-off-by: Amit Shah <amit.shah@redhat.com>
Reported-by: "Michael S. Tsirkin" <mst@redhat.com>
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
net.c used a constant to signify no MSI vectors were specified. Extend
that to all qdev devices.
Signed-off-by: Amit Shah <amit.shah@redhat.com>
Reported-by: "Michael S. Tsirkin" <mst@redhat.com>
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
According to AMD document 21485D pp.141, APROMWE is bit 8 of BCR2.
Signed-off-by: Christopher Kilgour <techie@whiterocker.com>
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
Now we can say it's useful, the following changes have been made:
- Put events in alphabetical order
- Add examples to all events
- Document all 'data' members
- Small corrections and cleanups
Signed-off-by: Luiz Capitulino <lcapitulino@redhat.com>
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
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.
Signed-off-by: Luiz Capitulino <lcapitulino@redhat.com>
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
Nothing will change as that function is currently only called by
the main loop code, but it's the right place for the RESET event,
as it's where the reset is actually performed.
Signed-off-by: Luiz Capitulino <lcapitulino@redhat.com>
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
I've introduced the STOP event in the main loop, this is wrong
as it will be only emitted if the io thread is enabled.
This fixes that by moving the STOP event to do_vm_stop().
Signed-off-by: Luiz Capitulino <lcapitulino@redhat.com>
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>