summaryrefslogtreecommitdiff
AgeCommit message (Collapse)AuthorFilesLines
2010-03-16error: New QERR_PROPERTY_NOT_FOUNDMarkus Armbruster2-0/+7
2010-03-16error: Polish human-readable error descriptionsMarkus Armbruster2-21/+21
Also put error definitions in alphabetical order
2010-03-16error: Let converted handlers print in human monitorMarkus Armbruster2-44/+38
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 continue to do so after conversion. Moreover, utility functions converted to QError should remain usable from unconverted handlers. Two problems: * handler_audit() complains when a converted handler prints. Limit that to QMP monitors. * With QMP, handlers need to pass the error object by way of monitor_set_error(). However, we do that both for QMP and for the human monitor. The human monitor prints the error object after the handler returns. If the handler prints anything else, that output "overtakes" the error message. Limit use of monitor_set_error() to QMP monitors. Update handler_audit() accordingly.
2010-03-16monitor: New monitor_cur_is_qmp()Markus Armbruster2-0/+8
2010-03-16qdev: Hide "ptr" properties from usersMarkus Armbruster2-13/+23
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 print it. Fix by removing their print method. Their only use is dirty hacks. Document that.
2010-03-16qdev: Hide "no_user" devices from usersMarkus Armbruster1-6/+4
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 wasn't quite right for monitor command device_add.
2010-03-16qdev: Factor qdev_create_from_info() out of qdev_create()Markus Armbruster1-15/+22
To make it obvious that -device and device_add can't die in hw_error().
2010-03-16qdev: Fix -device and device_add to handle unsuitable bus gracefullyMarkus Armbruster1-0/+5
"device_add isa-serial,bus=pci.0" kills QEMU. Not good.
2010-03-16error: Track locations on command lineMarkus Armbruster3-5/+27
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
2010-03-16QemuOpts: Fix qemu_config_parse() to catch file read errorsMarkus Armbruster1-0/+4
2010-03-16error: Track locations in configuration filesMarkus Armbruster5-18/+49
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: -device: no driver specified become almost nice now: qemu:foo.conf:44: -device: no driver specified (A later commit will get rid of the bogus -device:)
2010-03-16error: Include the program name in error messages to stderrMarkus Armbruster3-1/+22
2010-03-16error: Infrastructure to track locations for error reportingMarkus Armbruster6-3/+138
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 accessors. Print it in error_report(). Store it in QError, and print it in qerror_print(). Store it in QemuOpt, for use by qemu_opts_foreach(). This makes error_report() do the right thing when it runs within qemu_opts_foreach(). We may still have to store it in other data structures holding user input for better error messages. Left for another day.
2010-03-16error: Rename qemu_error_new() to qerror_report()Markus Armbruster4-49/+49
2010-03-16error: Replace qemu_error() by error_report()Markus Armbruster29-119/+127
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 IFF_VNET_HDR available" (all three versions). There's one place that passes arguments without newlines intentionally: load_vmstate(). Fix it up.
2010-03-16error: Don't abuse qemu_error() for non-error in scsi_hot_add()Markus Armbruster1-4/+6
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 additional stuff that is only appropriate for proper errors, and then this will break. Clean it up.
2010-03-16error: Don't abuse qemu_error() for non-error in qbus_find()Markus Armbruster1-20/+17
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 qbus_list_bus() and qbus_list_dev() in one go, make them print it.
2010-03-16error: Don't abuse qemu_error() for non-error in qdev_device_help()Markus Armbruster1-21/+10
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 error_printf() instead. While there, simplify: instead of printing a buffer filled by qdev_print_devinfo() in one go, make qdev_print_devinfo() print it.
2010-03-16error: New error_printf() and error_vprintf()Markus Armbruster2-7/+56
2010-03-16error: Move qemu_error & friends into their own headerMarkus Armbruster16-15/+26
2010-03-16error: Simplify error sink setupMarkus Armbruster4-77/+9
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.
2010-03-16error: Move qemu_error() & friends from monitor.c to own fileMarkus Armbruster3-89/+93
They're about reporting errors, not about the monitor.
2010-03-16monitor: Factor monitor_set_error() out of qemu_error_internal()Markus Armbruster2-8/+16
This separates the monitor part from the QError part.
2010-03-16block: Simplify usb_msd_initfn() test for "can read bdrv key"Markus Armbruster1-1/+1
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.
2010-03-16monitor: Separate "default monitor" and "current monitor" cleanlyMarkus Armbruster5-9/+10
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.
2010-03-16tools: Remove unused cur_mon from qemu-tool.cMarkus Armbruster1-2/+0
2010-03-16pc: Factor common code out of pc_boot_set() and cmos_init()Markus Armbruster1-20/+8
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.
2010-03-16pc: Fix error reporting for -boot onceMarkus Armbruster1-4/+3
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().
2010-03-16savevm: Fix -loadvm to report errors to stderr, not the monitorMarkus Armbruster4-16/+14
A monitor may not even exist. Change load_vmstate() to use qemu_error() instead of monitor_printf(). Parameter mon is now unused, remove it.
2010-03-16usb: Remove disabled monitor_printf() in usb_read_file()Markus Armbruster1-8/+0
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.
2010-03-11target-ppc: fix evsrwu and evsrws (second try)Aurelien Jarno1-2/+2
Signed-off-by: Aurelien Jarno <aurelien@aurel32.net>
2010-03-11target-ppc: fix evsrwu and evsrwsAurelien Jarno1-2/+2
Signed-off-by: Aurelien Jarno <aurelien@aurel32.net>
2010-03-11target-ppc: fix evslw instructionAurelien Jarno1-1/+1
Signed-off-by: Aurelien Jarno <aurelien@aurel32.net>
2010-03-11audio: fix commentmalc1-1/+1
Signed-off-by: malc <av1474@comtv.ru>
2010-03-10QMP: Really move the RESET event to qemu_system_reset()Luiz Capitulino1-2/+1
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>
2010-03-10target-i386: fix SIB decoding with index = 4Aurelien Jarno1-2/+2
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>
2010-03-09documentation: qemu_write_full don't work with non-blocking fd'sJuan Quintela1-0/+5
Signed-off-by: Juan Quintela <quintela@redhat.com> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
2010-03-09block: print errno on errorJuan Quintela1-2/+2
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>
2010-03-09vmdk: share cleanup codeJuan Quintela1-9/+4
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>
2010-03-09vmdk: fix double freeJuan Quintela1-1/+1
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>
2010-03-09vmdk: make vmdk_snapshot_create return -errnoJuan Quintela1-21/+58
Signed-off-by: Juan Quintela <quintela@redhat.com> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
2010-03-09vmdk: return errno instead of -1Juan Quintela1-7/+7
Signed-off-by: Juan Quintela <quintela@redhat.com> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
2010-03-09qcow: return errno instead of -1Juan Quintela1-4/+4
Signed-off-by: Juan Quintela <quintela@redhat.com> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
2010-03-09qcow2: return errno instead of -1Juan Quintela1-9/+9
Signed-off-by: Juan Quintela <quintela@redhat.com> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
2010-03-09slirp: check system() successJuan Quintela1-1/+1
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>
2010-03-09cow: return errno instead of -1Juan Quintela1-3/+2
Remove not needed ret = 0 assignment. Signed-off-by: Juan Quintela <quintela@redhat.com> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
2010-03-09qemu-img rebase: Add -f optionKevin Wolf1-4/+16
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>
2010-03-09configure: Fix code which creates config.mak filesStefan Weil1-2/+2
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>
2010-03-09configure: Fix wrong stderr redirectionStefan Weil1-2/+2
Signed-off-by: Stefan Weil <weil@mail.berlios.de> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
2010-03-09QMP: Introduce WATCHDOG eventLuiz Capitulino4-0/+40
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>